DataMuseum.dk

Presents historical artifacts from the history of:

RC4000/8000/9000

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

See our Wiki for more about RC4000/8000/9000

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics

⟦e109075b7⟧ TextFile

    Length: 2701824 (0x293a00)
    Types: TextFile
    Names: »su2list     «

Derivation

└─⟦9ccaf6601⟧ Bits:30008165 Bånd med SW8000 kildetekst/release værktøjer
    └─⟦2ba378e4a⟧ 
        └─⟦this⟧ »su2list     « 

TextFile


    1     0  b.i. a800,  b300,  q70  w.
    2     0  
    2     0  m.
    2     0                  mondef - monitor definitions 17.0 beta

    3     0  ;--------------------------------------------------------------------------
    4     0  ;                      REVISION HISTORY 
    5     0  ;--------------------------------------------------------------------------
    6     0  ; DATE      TIME OR            DESCRIPTION
    7     0  ;           RELEASE
    8     0  ;--------------------------------------------------------------------------
    9     0  ;88.03.24  14.1A HSI   start of description
   10     0  ;                      remove double definition of a78
   11     0  ;                      insert csp-printer kind (q14=14)
   12     0  ;88.03.24  18.41 hsi   version 1B
   13     0  ;
   14     0  ;88.04.19  15.0  tsh   complete definition of all ioc/dlc processes,
   15     0  ;                      areas, pseudo and internal processes included.
   16     0  ;                      (area, pseudo and internal process descriptions
   17     0  ;                      not included in compiling yet)
   18     0  ;
   19     0  ;88.04.21 13.48  hsi   IFP/IDA main; define field: controller state
   20     0  ;88.05.04 11.30  kak   relative address of device no. changed from 22 to 48 in external ifp/ida processes
   21     0  ;88.05.24 7.45   kak   mask for RC9000 included
   22     0  ;88 05 29 14.25  hsi   define b-names for monitor constants
   23     0  ;88 05 30 13.35  hsi   define names for model10 interrupt pointers in main 
   24     0  ;                      proceses (a202-a206)
   25     0  ;88 06 01        tsh   update of mainprocess due to changed protocol
   26     0  ;88 08 16 13.24  hsi   timeout on operations to main
   27     0  ;88 11 21 13.39 kak  bit 12-14 in message buffer state field is used to result or
   28     0  ;                    a disjunction of results (chained operations)
   29     0  ;                    and the final result is extracted from this field
   30     0  ;89 03 16 09.46 kak  release 15.1
   31     0  ;----------------------------------------------------------------------------
   32     0  ;89 04 05 13.27        START OF RELEASE 16.0
   33     0  ;
   34     0  ;89 04 05 13.27 HSI shine up pd for internal and area processes
   35     0  ;89 04 07 10.12 HSI define logical volume fields in disk process
   36     0  ;----------------------------------------------------------------------------
   37     0  ;90 05 30 11.08 kak    START OF RELEASE 17.0
   38     0  
   38     0  
   38     0  ; release number of monitor base text:
   39     0    a135=17         ; release number
   40     0    a136=0          ; version number
   41     0  
   41     0  b.i30 w.
   42     0  i0=90 10 01 
   43     0  i1=08 00 00 
   44     0  
   44     0  a133=i0, a134=i1  ; will be set to newest correction
   45     0  ; if newtime (i0,i1) > oldtime (a133,a134) then oldtime:=newtime;
   46     0  c.i0-a133
   47     0    c.i0-a133-1, a133=i0, a134=i1, z.
   48     0    c.i1-a134-1,          a134=i1, z.
   49     0  z.
   50     0  
   50     0  i10=i0, i20=i1
   51     0  
   51     0  i15=i10/100000 , i10=i10-i15*100000 , i25=i20/100000 , i20=i20-i25*100000 
   52     0  i14=i10/10000  , i10=i10-i14*10000  , i24=i20/10000  , i20=i20-i24*10000 
   53     0  i13=i10/1000   , i10=i10-i13*1000   , i23=i20/1000   , i20=i20-i23*1000
   54     0  i12=i10/100    , i10=i10-i12*100    , i22=i20/100    , i20=i20-i22*100
   55     0  i11=i10/10     , i10=i10-i11*10     , i21=i20/10     , i20=i20-i21*10
   56     0  
   56     0  i2:  <:                              date  :>
   57    24       (:i15+48:)<16+(:i14+48:)<8+46
   58    26       (:i13+48:)<16+(:i12+48:)<8+46
   59    28       (:i11+48:)<16+(:i10+48:)<8+32
   60    30  
   60    30       (:i25+48:)<16+(:i24+48:)<8+46
   61    32       (:i23+48:)<16+(:i22+48:)<8+46
   62    34       (:i21+48:)<16+(:i20+48:)<8+ 0
   63    36  
   63    36  i3:  al. w0  i2.       ; write date:
   64    38       rs  w0  x2+0      ;   first free:=start(text);
   65    40       al  w2  0         ;
   66    42       jl      x3        ;   return to slang(status ok);
   67    44  
   67    44       jl.     i3.       ;
   68    46  e.
   69    46  j.
   69     0                                date  90.10.01 08.00.00

   70     0  
   70     0  
   70     0  ; rc 4000 system tape
   71     0  ; per brinch hansen
   72     0  ;     this tape is an autoload version of the rc 4000 multiprogramming
   73     0  ; system. it is written in the slang 3 language and consists of
   74     0  ; 10 segments surrounded by a global block:
   75     0  ;
   76     0  ; global block, definitions:
   77     0  ;     a names define system constants;
   78     0  ;     b names define entries in the monitor table;
   79     0  ; segment 1; start monitor segment 10:
   80     0  ;     contains a jump to segment 10;
   81     0  ; segment 2, monitor:
   82     0  ;     contains interrupt response code and monitor procedures;
   83     0  ; segment 3, external processes:
   84     0  ;     contains send message and code for input/output;
   85     0  ; segment 4, process descriptions:
   86     0  ;     contains name table, process descriptions, and message buffers;
   87     0  ; segment 5, initialize monitor:
   88     0  ;     executed and removed immediately after loading;
   89     0  ; segment 6, process functions:
   90     0  ;     contains code for catalog administration and the
   91     0  ;     creation and removal of processes;
   92     0  ; segment 7, initialize process functions:
   93     0  ;     executed and removed immediately after loading;
   94     0  ; segment 8, operating system s:
   95     0  ;     contains code which allows the operators to
   96     0  ;     create and control new process from consoles;
   97     0  ; segment 9, initialize catalog
   98     0  ;     starts the multiprogramming system and is
   99     0  ;     itself immediately executed as a part of the
  100     0  ;     process s; it can initialize the backing store
  101     0  ;     with catalog entries and binary programs
  102     0  ;     input from paper tape or magnetic tape;
  103     0  ; segment 10: move monitor:
  104     0  ;     allocates segment 2 - 9 after autoloading
  105     0  
  105     0  
  105     0  ; global block, definitions
  106     0  
  106     0  ; size options:
  107     0  ; a1 = no of area processes
  108     0  ; a3 = no of internal processes
  109     0  ; a5 = no of message buffers
  110     0  ; a7 = no of pseudoprocesses
  111     0  ; a87 = inspection interval
  112     0  ; a109 = min aux-cat key
  113     0  ; a110 = max cat key
  114     0  ; a111 = min key for entries between standard and max interval
  115     0  ; a112 = no. of bs-devices
  116     0  ; a113 = no. of drum chains
  117     0  ; a114 = size of drum chains
  118     0  ; a115 = no. of disc chains
  119     0  ; a116 = size of disc chains
  120     0  ; a117 = no of messagebuffers assigned to consoles
  121     0  ; a118 = update aux cat 
  122     0  
  122     0  a0=1<23        ; bit no 0
  123     0  
  123     0  
  123     0  
  123     0  ; predefinition of option variables:
  124     0  a1=0           ;
  125     0  a3=0           ;
  126     0  a5=0           ;
  127     0  a9=0           ; number of subdevices
  128     0  a83 = 250        ; max count not resceduling internal process (<256)
  129     0  a80=-1-1<11    ; all drivers included excl. rc8601
  130     0  a82=-1         ; ... with statistics on
  131     0  a84=-1         ; ... and test on
  132     0  a85=256        ; max time slice in 0.1 ms
  133     0  a89=8.4777 7777; standard interrupt mask
  134     0  a90= 1<0        ; special facility mask : fpacoredump 1<0
  135     0  a91=0          ;
  136     0  a92=1<10+1<21  ;
  137     0  a93=1<23       ;
  138     0  a109=2         ;
  139     0  a110=3         ;
  140     0  a111=3         ;
  141     0  a113=0         ; number of drums
  142     0  a114=0         ;
  143     0  a116=0         ;
  144     0  a128=0         ; a128=0 : std monitor gen.
  145     0                 ;     >0 : option gen.
  146     0                 ;  a128 o. 1<1 : read special s size options in segment 6
  147     0                 ;  a128 o. 1<2 : rc 6000 monitor
  148     0  a123=0         ; net-identification(jobhost)
  149     0  a124=0         ; home-region(jobhost)
  150     0  ; a125=        ; job host identification
  151     0  a130=00 00 00  ; date, time of options
  152     0  a131=00 00 00  ;   (yy mm dd, hh mm ss)
  153     0  a197=84        ; max datatransfer per operation to-from idadisc (in segments)
  154     0  a198=1<23+0<3  ; device addr of cpu
  155     0  a194= 8             ; mp level
  156     0  a199=2         ; device number of mainconsole
  157     0  a66 = 0         ; 
  158     0  a398= 8        ; lower write limit for procfunc, s and driverproc
  159     0  a399= 0         ; RC9000 mask: default nothing included
  160     0                  ; bit 0 include change of cpa and base adresses
  161     0                  ; bit 1 process description moved to montop
  162     0  a400=0         ; coroutine monitor inclusion dummy - may be removed
  163     0  t.
  163     0* type 
m.
  163     0   balsu2   90 09 27 07 45 00 

  164     0  
  164     0      a130= 90 09 27   ; date  yy mm dd
  165     0      a131= 07 45 00    ; time  hh mm ss
  166     0  
  166     0      a1=      350     ; areas
  167     0      a3=       24     ; internals
  168     0      a5=      600     ; message buffers inclusive a117
  169     0      a80= -1          ; all drivers included
  170     0     ;a82=       0     ; statistics off
  171     0     ;a84=       0     ; testoutput off
  172     0      a115=      8     ; number of logical discs with catalogs
  173     0      a116=   2046     ; max number of slices in disc slice table
  174     0      a117=    100+a3  ; number of mess buffers reserved for subprocesses 
  175     0                       ; at least number of externals + numbers of internals
  176     0      a125=    193     ; job host identification
  177     0      a197=     84     ; max non-chained transfer from ida (in segments)
  178     0      a399=8.0000 0000 ; RC9000 mask
  179     0  n.m.
  179     0                  monitor size options included

  180     0  
  180     0  ; a2 = size of area process description
  181     0  ; a4 = size of internal process description
  182     0  
  182     0     a112 = a113 + a115
  183     0     a118 = a112-2,  a119 = a118
  184     0  
  184     0  ; a88 = size of catalog entry
  185     0  ; a89 = standard interrupt mask
  186     0  ; a85 = max time slice in 0.1 msec
  187     0  ; a107 = min lower limit in bases
  188     0  ; a108 = max upper limit in bases
  189     0  
  189     0     a88=34, a107=8.4000 0001, a108=8.3777 7776
  190     0  
  190     0  ; driver options.
  191     0  ; the inclusion of drivers is controlled by the parameters a80, a82 and a84.
  192     0  ; a80 determines whether a driver shall be included, and a82 and a84 whether
  193     0  ; it shall be included with statistics and/or testoutput.
  194     0  ;
  195     0  ;  a80 = driver inclusion
  196     0  ;  a82 = statistics
  197     0  ;  a84 = testoutput
  198     0  ;
  199     0  ; the function of the bits in the parameters are -
  200     0  ;  1<0  : clock
  201     0  ;  1<1  : disc (dsc 801)
  202     0  ;  1<2  : mainproc
  203     0  ;  1<3  : receiver (fpa 801)
  204     0  ;  1<4  : transmitter (fpa 801)
  205     0  ;  1<5  : hostproc
  206     0  ;  1<6  : subprocs
  207     0  ;  1<7  ; host, subhost
  208     0  ;  1<8  ; total fpa-complex ( i.e. 1<2 - 1<7 and 1<11 - 1<15)
  209     0  ;  1<11 : rc8601
  210     0  ;  1<12 ; subdriver terminal
  211     0  ;  1<13 ;     -     magtape
  212     0  ;  1<14 ;     -     disc
  213     0  ;  1<15 ;     -     flexible disc
  214     0  
  214     0  
  214     0  ; testoptions:
  215     0  ; testoptions are used during debugging of the system.
  216     0  ; they are defined by bits in the identifier a92 as follows:
  217     0  ;    testcase i               a92=a92 o. 1<i   0<=i<=17
  218     0  ;    teststatus               a92=a92 o. 1<18
  219     0  ;    testcall                 a92=a92 o. 1<19
  220     0  ;    testoutput               a92=a92 o. 1<20
  221     0  ;    print w, type w
  222     0  ;    procfunc interrupt       a92=a92 o. 1<21
  223     0  ;    procfunc testbuffer      a92=a92 o. 1<22
  224     0  ; testoptions in s are defined by bits in the identifier a93
  225     0  ; as explained in s.
  226     0  
  226     0  
  226     0  ;** common format for all proces descriptions **
  227     0  
  227     0  a48 = -4           ; lower name base
  228     0  a49 = -2           ; upper name base
  229     0  a10 =  0           ; kind
  230     0  a11 =  2           ; name
  231     0  
  231     0  \f


  231     0  
  231     0  ; I N T E R N A L   P R O C E S S
  232     0  ; ============================================================================
  233     0  ;
  234     0  ; name    rel. addr     use
  235     0  ; -----   ---------     ------------------------------------------------
  236     0  ;
  237     0  ; a48   = - 4      ;    lower name base
  238     0  ; a49   = - 2      ;    upper name base
  239     0  ; a10   =   0      ;    kind (0)
  240     0  ; a11   =   2      ;    name
  241     0    a12   =  10 ; hw ;    stop count
  242     0    a13   =  11 ; hw ;    state
  243     0    a14   =  12      ;    identification bit
  244     0    a15   =  14      ;    event queue: first
  245     0                     ;    event queue: last
  246     0    a16   =  18      ;    process queue: next
  247     0                     ;    process queue: prev
  248     0    a17   =  22      ;    first address (logical)
  249     0    a18   =  24      ;    top address   (logical)
  250     0    a19   =  26 ; hw ;    buffer claim
  251     0    a20   =  27 ; hw ;    area claim
  252     0    a21   =  28 ; hw ;    internal claim
  253     0    a22   =  29 ; hw ;    function mask
  254     0   a301   =  30      ;    priority
  255     0    a24   =  32 ; hw ;    mode_1
  256     0    a25   =  33 ; hw ;    mode_2
  257     0    a26   =  34      ;    interrupt mask
  258     0    a27   =  36      ;    user exception (interrupt) address (logical)
  259     0   a170   =  38      ;    user escape address (logical) 
  260     0   a171   =  40      ;    initial cpa
  261     0   a172   =  42      ;       -    base
  262     0   a173   =  44      ;       -    lower write limit (physical)
  263     0   a174   =  46      ;       -    top   write limit (physical)
  264     0   a175   =  48      ;       -    interrupt levels 
  265     0    a34   =  50      ;    parent description address
  266     0    a35   =  52      ;    quantum
  267     0    a36   =  54      ;    run time
  268     0    a38   =  58      ;    start run
  269     0    a39   =  62      ;    start wait
  270     0    a40   =  66      ;    wait address
  271     0  \f


  271     0  
  271     0  
  271     0    a42   =  68      ;    catalog base, lower
  272     0    a43   =  70      ;    catalog base, upper
  273     0                     ;    max interval, lower
  274     0    a44   =  74      ;    max interval, upper
  275     0                     ;    standard interval, lower
  276     0    a45   =  78      ;    standard interval, upper
  277     0    a28   =  80      ;    save w0 (first of register dump)
  278     0    a29   =  82      ;      -  w1
  279     0    a30   =  84      ;      -  w2
  280     0    a31   =  86      ;      -  w3
  281     0    a32   =  88      ;    status
  282     0    a33   =  90      ;    ic
  283     0   a176   =  92      ;    cause
  284     0   a177   =  94      ;    sb
  285     0   a181   =  96      ;    current cpa  (first of fixed parameters)
  286     0   a182   =  98      ;       -    base
  287     0   a183   = 100      ;       -    lower write limit
  288     0   a184   = 102      ;       -    top   write limit
  289     0   a185   = 104      ;       -    interrupt levels 
  290     0   a186   = 106      ;    pu-index
  291     0   a302   = 108      ;    save area
  292     0                     ;        -
  293     0   a339   = 112      ;    footprint if internal break
  294     0   a340   = 114      ;    not used
  295     0   a341   = 116      ;    not used
  296     0   a342   = 118      ;    not used
  297     0   a343   = 120      ;    not used
  298     0   a305   = 122      ;    not used
  299     0   a306   = 124      ;    not used
  300     0                     ;    --------- bs claim start ---------
  301     0    a46   = 126      ;    chain_0: key_0 : entries
  302     0                     ;       -   :   -   : slices
  303     0                     ;       -   : key_1 : entries
  304     0                     ;       -   :   -   : slices
  305     0                     ;       -   : key_2 : entries
  306     0                     ;       -   :   -   : slices
  307     0                     ;       -   : key_3 : entryes
  308     0                     ;       -   :   -   : slices
  309     0                     ;    chain_1: key_0 : entries
  310     0                     ;       - - -  osv  - - -
  311     0  
  311     0  a47=-4             ; start of internal process description
  312     0  a4 = a46+(:a110<2+4:)*a112-a47 ; size of internal process
  313     0  
  313     0  ; format of save area:
  314     0  ;   8 words, used by deliver-result-procedures
  315     0  a304 = 16  ; address of wait first event
  316     0  
  316     0  a179 = a181 - a28  ; displacement between fixed params and first of regdump.
  317     0  a178 = a181        ; top of regdump
  318     0  a303 = a305        ; top of save area
  319     0  \f


  319     0  
  319     0  ; internal process states:
  320     0  ; ---------------------------------------------------------
  321     0  ;
  322     0  
  322     0  ; actual bitpatterns are relevant to process functions only
  323     0  
  323     0  a94 = 2.00001011 ; running
  324     0  a95 = 2.11001000 ; waiting for cpu
  325     0  a96 = 2.00001000 ; running after error
  326     0  a97 = 2.10110000 ; waiting for stop by parent
  327     0  a98 = 2.10100000 ; waiting for stop by ancestor
  328     0  a99 = 2.10111000 ; waiting for start by parent
  329     0  a100= 2.10101000 ; waiting for start by ancestor
  330     0  a101= 2.11001100 ; waiting for process function
  331     0  a102= 2.10001101 ; waiting for message
  332     0  a103= 2.10001110 ; waiting for answer
  333     0  a104= 2.10001111 ; waiting for event
  334     0  
  334     0  
  334     0  ; bit patterns used to test or change the above states:
  335     0  
  335     0  a105 = 2.00100000; waiting for stop or start
  336     0  a106 = 2.00001000; waiting for start
  337     0  
  337     0  ;** commen format of all external process description **
  338     0  ;   writeprotection array only used in connection with areas!
  339     0  
  339     0  a401= (:a3+23:)/24 ; number of words in user and writeprotection bittable
  340     0  a403 = a401*2      ; number of halfwords in user and writeprotection bittable
  341     0  a404 = -a403-2     ; displacement from user bit array element to
  342     0                     ; corresponding writeprotection array element
  343     0  
  343     0  
  343     0  b. j0 w.
  344     0      j0=0
  345     0  a250= j0 , j0=j0+2    ; <driver  description >
  346     0                         ;  > 0 : driver process description address
  347     0                         ;  < 0 : device driven by monitor   -1: IDA801
  348     0  a402= j0 , j0=j0+a403 ; <user bit table
  349     0  ;a48                  ; <lower name base>
  350     0  ;a49                  ; <upper name base>
  351     0  
  351     0  ; these fields are defined relative to the 
  352     0  ;common part of all process descriptions
  353     0  
  353     0  j0=j0-a48
  354     0  
  354     0  
  354     0  a250 = a250-j0 , a402 = a402 -j0 
  355     0  
  355     0  e.
  356     0  a50 = 10              ; process description address of main process
  357     0  a52 = 12              ;  reserver
  358     0  a57 = 14 , a58 = 15   ; <work0> , <work1>
  359     0  
  359     0  \f


  359     0  
  359     0  ;
  360     0  ; A R E A   A N D   P S E U D O   P R O C E S S E S
  361     0  ; ===========================================================================
  362     0  ;
  363     0  ; AREA PROCESS
  364     0  ; ------------
  365     0  ;
  366     0  ; name    rel. addr     use
  367     0  ; -----   ---------     --------------------------------------------
  368     0  ;
  369     0  ;                  ;    write protect bit array (variable in size)
  370     0  ;                  ;    user bit array (variable in size)
  371     0  ; a48   = - 4      ;    lower name base 
  372     0  ; a49   = - 2      ;    upper name base
  373     0  ; a10   =   0      ;    kind (4)
  374     0  ; a11   =   2      ;    name
  375     0  ; a50   =  10      ;    address of bs device
  376     0  ; a52   =  12      ;    reserver
  377     0  ; a57   =  14 ; hw ;    work1
  378     0  ; a58   =  15 ; hw ;    work2
  379     0    a60   =  16      ;    first slice of area
  380     0    a61   =  18      ;    number of segments
  381     0    a62   =  20      ;    document name
  382     0    a411  =  28      ;    number of write accesses
  383     0    a412  =  30      ;    number of read  accesses
  384     0  
  384     0    a349= a250 - a403; <start of process>
  385     0    a405= a349       ; <writeprotection bit array>
  386     0    a2 = a412 - a349 + 2 ; size of area process description
  387     0    a23 = 27         ; use area processes as pseudoprocesses
  388     0  
  388     0  
  388     0  ; PSEUDO PROCESS   (uses an area process)
  389     0  ; ---------------------------------------
  390     0  ;
  391     0  ; name    rel. addr     use
  392     0  ; -----   ---------     ------------------------------------------------
  393     0  ;
  394     0  ; a48   = - 4      ;    lower name base
  395     0  ; a49   = - 2      ;    upper name base
  396     0  ; a10   =   0      ;    kind (64)
  397     0  ; a11   =   2      ;    name
  398     0  ; a50   =  10      ;    process description address of owner
  399     0  ; a60   =  16      ;    message description
  400     0  \f


  400     0  
  400     0  ; format of device description:
  401     0  ; The following fields are only used by pheriperal proceses for controllers
  402     0  ; using channel programs:
  403     0  ; a220, a221, a226, a227, a230, a231 a232, a233
  404     0  ; The following fields are only used by pheripheral proceses for controllers
  405     0  ; not using channel programs ( IDA801, IFPXXX ) "intelligent" controllers (ITC)
  406     0  ; a228, a229
  407     0  
  407     0  ; definition of device-dependant part of device-description
  408     0  
  408     0  b. j0 w.
  409     0  
  409     0  j0 = 0              ; (used to set up the definitions)
  410     0  
  410     0  ; pointers to private area in device descriptor, used by driver and start-io:
  411     0  
  411     0  a220= j0, j0 = j0+2 ; first of private area, rel to a10
  412     0  a221= j0, j0 = j0+2 ; top   of private area, rel to a10
  413     0  
  413     0  ; the following word is used to indicate a transfer in progress
  414     0  ;   (sender descr) a.1 = 1 : transfer to driver process
  415     0  ;   (sender descr) a.(-2)>0: transfer to sender process
  416     0  ;   (sender descr)     = 0 : no transfer
  417     0  ; for intelligent controllers only the following two values are used:
  418     0  ;   -1: reset controller (after timeout)
  419     0  ;    0: no reset to controller
  420     0  a225= j0, j0 = j0+2 ; transfer code
  421     0  
  421     0  ; pointers to channel program area, in device descriptor, used by start-io:
  422     0  
  422     0  a226= j0, j0 = j0+2 ; first of channel program area, rel to a10
  423     0  a227= a226+2,j0=j0+2; top   of channel program area, rel to a10
  424     0  ; pointer needed by monitor acknowledge interrupt routine for intelligent controllers:
  425     0   
  425     0  a228= j0            ; <jl w2 c46>
  426     0  a229= a228+2        ; after jump: w2=a229
  427     0  
  427     0  
  427     0  ; standard status area: used when the controller delivers an interrupt:
  428     0  
  428     0  a230= j0, j0 = j0+8 ; channel program address
  429     0  a231= a230+2        ; remaining character count
  430     0  a232= a230+4        ; current status
  431     0  a233= a230+6        ; event status
  432     0  
  432     0  ; device address, also used as index to controller table:
  433     0  
  433     0  a235= j0, j0 = j0+2 ; device address
  434     0  
  434     0  ; interrupt operation, as needed by monitor interrupt response:
  435     0  
  435     0  a240= j0, j0 = j0+2 ; <jl w2 c51> (monitor service instruction)
  436     0  a241= a240+2        ; <after jl w2 ...>
  437     0  a242= a241, j0=j0+2 ; next operation link
  438     0  a243= a242+2,j0=j0+2; prev operation link
  439     0  a244= j0, j0 = j0+2 ; timeout / result from start-io
  440     0  
  440     0  ; interrupt operation, as needed by driver process:
  441     0  
  441     0  a245= a244+2,j0=j0+2; interrupt address in driver code (logic addr)
  442     0  a246= j0, j0 = j0+2 ; <jl w1 c30> (driver service instruction)
  443     0  a247= a246+2        ; <after jl w1 ...>
  444     0  
  444     0  ; which driver process governs this device ? (used by monitor):
  445     0  ;a250 <0             ; device driven by monitor
  446     0  ;a250 >0             ; driver process description adr
  447     0  ;a401                ; start of user bit array
  448     0  
  448     0  ;these fields are defined relative to the common part
  449     0  ;of an external process description
  450     0  
  450     0  
  450     0  j0 = j0 - a250
  451     0  a220=a220-j0, a221=a221-j0
  452     0  a225=a225-j0, a226=a226-j0, a227=a227-j0
  453     0  a228=a228-j0,  a229=a229-j0
  454     0  a230=a230-j0, a231=a231-j0, a232=a232-j0, a233=a233-j0
  455     0  a235=a235-j0
  456     0  a240=a240-j0, a241=a241-j0, a242=a242-j0, a243=a243-j0,
  457     0  a244=a244-j0, a245=a245-j0, a246=a246-j0, a247=a247-j0,
  458     0  
  458     0  e.
  459     0  
  459     0  
  459     0  
  459     0  ; format of peripheral process description for devices driven by driverproc:
  460     0  
  460     0  ;a250               ; <driver process description addr>
  461     0  ;a402               ; <start of user bit array>
  462     0  ;a48 = -4           ; <lower name base>
  463     0  ;a49 = -2           ; <upper name base>
  464     0  ;a10 =  0           ; <kind>
  465     0  ;a11 =  2           ; <name>
  466     0  ;a50 = 10           ; <process description of main process>
  467     0  ;a52 = 12           ; <reserver>
  468     0  ;a57 = 14 , a58 = 15; <work1> , <work2>
  469     0   a54 = 16           ; <next message>
  470     0   a55 = 18           ; <last message>
  471     0   a56 = 20           ; <regretted flag>
  472     0  
  472     0  ; optional parameters for peripheral devices :
  473     0  
  473     0   a70 = 22           ; <parameter0> : <state>
  474     0   a71 = 24           ; <parameter1> : <chaintable>
  475     0   a72 = 26           ; <parameter2> : <slicelenght>
  476     0  
  476     0  ; parameters used in connection with subprocesses:
  477     0  a63 = a70+14       ;  address of subkind;
  478     0  a64 = a63+2        ;  address of state(subproc);
  479     0  
  479     0  ; format of controller description
  480     0  
  480     0  a310= 0             ; first of channel program or communication area address (ITC)
  481     0  a311= 2             ; first of std status (pointer also used by reset)
  482     0  a312= 4             ; interrupt destination
  483     0  a313= 6             ; interrupt number
  484     0  a314= 8             ; size of controller description
  485     0  
  485     0  ; format of std status
  486     0  
  486     0  a315= 0             ; top of last executed command
  487     0  a316= 2             ; remaining character count
  488     0  a317= 4             ; current status
  489     0  a318= 6             ; event status
  490     0  
  490     0  ; format of logic channel program (as demanded by the start i/o procedure)
  491     0  
  491     0  a321= 0             ; address code < 12 + command < 8 + modif
  492     0  a322= 2             ; param 1
  493     0  a323= 4             ; param 2
  494     0  
  494     0  a320= 6             ; size of channel program entry
  495     0  
  495     0  \f


  495     0  
  495     0  ; I O C / D L C   P R O C E S S   D E S C R I P T I O N S
  496     0  ;--------------------------------------------------------------------------
  497     0  ;--------------------------------------------------------------------------
  498     0  ;
  499     0  ; (+)     set at monitor configuration time
  500     0  ; ($)     set at create link time
  501     0  ;
  502     0  ; I O C   ,   D L C   A N D   S S P   M A I N   P R O C E S S :
  503     0  ; =============================================================
  504     0  ; 
  505     0  ;
  506     0  ; name    rel. addr    use
  507     0  ; -----   ---------    ----------------------------------------------------
  508     0  ;
  509     0                     ;   user bit array (variable in size)
  510     0  ; a48   = - 4      ;   lower name base (+)
  511     0  ; a49   = - 2      ;   upper name base (+)
  512     0  ; a10   =   0      ;   kind (ioc: 20,  dlc: 26,  ssp: 24) (+)
  513     0  ; a11   =   2      ;   name
  514     0  ; a50   =  10      ;   main process (points at itself) ($)
  515     0  ; a52   =  12      ;   reserver
  516     0  ; a57   =  14 ; hw ;   controller state
  517     0  ; a58   =  15 ; hw ;   not used
  518     0  ; a54   =  16      ;   first message in event queue (+)
  519     0  ; a55   =  18      ;   last message in event queue (+)
  520     0                     ;   not used
  521     0  ; a70   =  22      ;   test: start (next record) (+)
  522     0  ; a71   =  24      ;   test: top   (next record) (+)
  523     0  ; a72   =  26      ;   test: start (test buffer) (+)
  524     0    a73   =  28      ;   test: top   (test buffer) (+)
  525     0    a74   =  30      ;   test: test mask (bit 0  - 23) (+)
  526     0    a75   =  32      ;   test: test mask (bit 24 - 47) (+)
  527     0    a86   =  34      ;   no_of_outstanding messages
  528     0    a87   =  36      ;   timeout (In  units of 0,1 msek)
  529     0    a76   =  38      ;   device index of superviser process (0) ($)
  530     0    a77   =  40      ;   rc8000 process address of main process ($)
  531     0    a78   =  42      ;   free buffers, state of process and communication area (*)
  532     0    a81   =  44      ;   waiting queue: first message (+)
  533     0                     ;   waiting queue: last message  (+)
  534     0    a59   =  48      ;   device number	 (+)
  535     0   \f


  535     0  
  535     0  
  535     0   
  535     0        		   ;   --> communication area: controller to RC8000
  536     0    a500  =  50      ;   function
  537     0    a501  =  52      ;   message buffer address
  538     0    a502  =  54      ;   device_id (device handler index)
  539     0    a503  =  56      ;   proc_id (ext. process address of receiver)
  540     0    a510  =  58      ;   mess_0     a150
  541     0    a511  =  60      ;   mess_1     a151
  542     0    a512  =  62      ;   mess_2     a152
  543     0    a513  =  64      ;   mess_3     a153
  544     0    a514  =  66      ;   mess_4     a154
  545     0    a515  =  68      ;   mess_5     a155
  546     0    a516  =  70      ;   mess_6     a156
  547     0    a517  =  72      ;   mess_7     a157
  548     0  
  548     0                     ;   --> communication area: RC8000 to controller <--
  549     0    a550  =  74      ;   function
  550     0    a551  =  76      ;   message buffer address
  551     0    a552  =  78      ;   device_id (device handler index)
  552     0    a553  =  80      ;   proc_id (ext. process address of receiver)
  553     0    a560  =  82      ;   mess_0     a150
  554     0    a561  =  84      ;   mess_1     a151
  555     0    a562  =  86      ;   mess_2     a152
  556     0    a563  =  88      ;   mess_3     a153
  557     0    a564  =  90      ;   mess_4     a154
  558     0    a565  =  92      ;   mess_5     a155
  559     0    a566  =  94      ;   mess_6     a156
  560     0    a567  =  96      ;   mess_7     a157
  561     0  \f


  561     0  
  561     0  
  561     0    a580  =  98      ;   start of save area for a550 - a567
  562     0    a581  = a580+24-2;   last  of save area for a550 - a567
  563     0    a216  = 122      ;   no of times controller was not ready to receive
  564     0                     ;   total number of operations delivered to controller
  565     0    a217  = 126      ;   (2 words, 48 bits unsigned integer)
  566     0    a218  = 128      ;   number of chained operations delivered to controller
  567     0    a200  = 130      ;   pending prepare dump message
  568     0    a201  = 132      ;   prepare dump area process
  569     0  ; a242  = 134      ;   interrupt queue: next
  570     0  ;       = 136      ;   interrupt queue: prev
  571     0  
  571     0    a219  = (:a550-a500:)/2 ; size of comm. area in words (used by rc8000)
  572     0  
  572     0    a520  = a510-8   ;   pointer to pseudo message ( a140 )
  573     0    a570  = a560-8   ;   pointer to pseudo message ( a140 )
  574     0  
  574     0  ;
  575     0  ;
  576     0  ;     (*)  states of process and communication area (a78, bit 12 - 23):
  577     0  ;          bit 21-23: connect state: 
  578     0  ;                     0 = free,             1 = during connect,
  579     0  ;                     2 = connected,        (3-7: not possible)
  580     0  ;
  581     0  ;          bit 20:    0 = no chain,         1 = in a chain
  582     0  ;          bit 19:    0 = controller ready  1 = controller busy  
  583     0  ;          bit 18:    0 = controller ok,    1 = controller not ok
  584     0  ;          bit 17:    0 = controller ok,    1 = controller after reset
  585     0  ;
  586     0  \f


  586     0  
  586     0  
  586     0  
  586     0  ; I O C  -  D I S C   P R O C E S S   D E S C R I P T I O N :
  587     0  ; ===========================================================
  588     0  ;
  589     0  ;
  590     0  ; name    rel. addr    use
  591     0  ; -----   ---------    ---------------------------------------------------
  592     0  ;
  593     0  ;                  ;   user bit array (variable in size)
  594     0  ; a48   = - 4      ;   lower name base
  595     0  ; a49   = - 2      ;   upper name base
  596     0  ; a10   =   0      ;   kind (6) ($)
  597     0  ; a11   =   2      ;   name
  598     0  ; a50   =  10      ;   mainprocess (physical disc: main; logical disc: physical disc) ($)
  599     0  ; a52   =  12      ;   reserver
  600     0  ; a57   =  14 ; hw ;   type (*)
  601     0  ; a58   =  15 ; hw ;   not used
  602     0  ; a54   =  16      ;   first message in eventqueue ($)
  603     0  ; a55   =  18      ;   last message in eventqueue ($)
  604     0  ; a56   =  20      ;   next part of logical volume (last in chain: 0)
  605     0  ; a70   =  22      ;   next logical disc (last in chain: 0)
  606     0  ; a71   =  24      ;   chain table reference
  607     0  ; a72   =  26      ;   slicelength
  608     0  ; a73   =  28      ;   first segment
  609     0  ; a74   =  30      ;   number of segments ($)
  610     0  ; a75   =  32      ;   segments pr track ($)
  611     0  ; a86   =  34      ;   max transfer (segments) ($)
  612     0  ; a87   =  36      ;   buffer size  (segments) ($)
  613     0  ; a76   =  38      ;   controller device index (logical disc: dev. index of physical disc) ($)
  614     0  ; a77   =  40      ;   rc8000 device address (logical disc: dev. addr. of physical disc) ($)
  615     0  ; a78   =  42      ;   unused, state of subprocess (**) ($)
  616     0  ; a81   =  44      ;   next in process queue (not used) ($)
  617     0  ;                  ;   prev in process queue (  - " - ) ($)
  618     0  ; a59   =  48      ;   device number (+)
  619     0    a67   =  50      ;   control module (logical disc: control module of physical disc) ($)
  620     0    a68   =  52      ;   slave unit (logical disc: slave unit of physical disc) ($)
  621     0  a215=(:a68-a50+2:)/2  ; size of ext proc description from main to top
  622     0  ;
  623     0  ;
  624     0  ;     (*)   type (a57 - bit encoded):
  625     0  ;           .....vvxxyyz: xx: 00: rc8000 catalog
  626     0  ;                         yy: 00: without catalog;  01: with catalog
  627     0  ;                          z:  0: physical disc;  1: logical disc
  628     0  ;                         vv: 00: not part of logical volume
  629     0  ;                             10: logical volume head;  
  630     0  ;                             01: logical volume subdisc;
  631     0  ;
  632     0  ;     (**)  state of subprocess (a78  bit 12 - 23):
  633     0  ;           bit 21-23: 0 = free;  1 = during connect;  2 = connected; 
  634     0  ;                      3 = during disconnect;  4 = after intervention
  635     0  ;
  636     0  \f


  636     0  
  636     0  
  636     0  
  636     0  ; I O C  -  M A G N E T I C   T A P E   P R O C E S S   D E S C R I P T I O N :
  637     0  ; =============================================================================
  638     0  ;
  639     0  ;
  640     0  ; name    rel. addr     use
  641     0  ; -----   ---------     ---------------------------------------------------
  642     0  ;
  643     0  ;                  ;    user bit array (variable in size)
  644     0  ; a48   = - 4      ;    lower name base
  645     0  ; a49   = - 2      ;    upper name base
  646     0  ; a10   =   0      ;    kind (18) ($)
  647     0  ; a11   =   2      ;    name
  648     0  ; a50   =  10      ;    main ($)
  649     0  ; a52   =  12      ;    reserver
  650     0  ; a57   =  14 ; hw ;    type (*)
  651     0  ; a58   =  15 ; hw ;    not used
  652     0  ; a54   =  16      ;    first message in event queue ($)
  653     0  ; a55   =  18      ;    last message in event queue ($)
  654     0  ;                  ;    not used
  655     0  ; a70   =  22      ;    state of document (**) ($)
  656     0  ; a71   =  24      ;    not used
  657     0  ; a72   =  26      ;    not used
  658     0  ; a73   =  28      ;    not used
  659     0  ; a74   =  30      ;    not used
  660     0  ; a75   =  32      ;    remoter process ($)
  661     0  ; a86   =  34      ;    max transfer + 1 (octects  = buffer size + 1) ($)
  662     0  ; a87   =  36      ;    buffer size (octects) ($)
  663     0  ; a76   =  38      ;    device index in controller of device ($)
  664     0  ; a77   =  40      ;    rc8000 process address ($)
  665     0  ; a78   =  42      ;    unused, state of subprocess (***) ($)
  666     0  ; a81   =  44      ;    next in process queue (not used) ($)
  667     0  ;                  ;    prev in process queue (  - " - ) ($)
  668     0  ; a59   =  48      ;   device number (+)
  669     0  ; a67   =  50      ;    formatter ($)
  670     0  ; a68   =  52      ;    station ($)
  671     0  ;
  672     0  ;
  673     0  ;     (*)    type (a57):
  674     0  ;            at present none is defined 
  675     0  ;
  676     0  ;     (**)   state of document (a70):
  677     0  ;            0 = identified document mounted;  2 = unidentified document mounted
  678     0  ;            1 = no document mounted;
  679     0  ;
  680     0  ;     (***)  state of subprocess (a78 bit 12 - 23):
  681     0  ;            bit 21-23: 0 = free;  1 = during connect;  2 = connected;
  682     0  ;                       3 = during disconnect;  4 = after intervention;
  683     0  \f


  683     0  
  683     0  
  683     0  
  683     0  ; I F P  -  G E N E R A L   S E Q U E N T I A L   D E V I C E :
  684     0  ; =============================================================
  685     0  ;
  686     0  ;
  687     0  ; name    rel. addr     use
  688     0  ; -----   ---------     ---------------------------------------
  689     0  ;
  690     0  ;                  ;    user bit array (variable in size)
  691     0  ; a48   = - 4      ;    lower name base
  692     0  ; a49   = - 2      ;    upper name base
  693     0  ; a10   =   0      ;    kind (28) ($)
  694     0  ; a11   =   2      ;    name
  695     0  ; a50   =  10      ;    main (ifp-main) ($)
  696     0  ; a52   =  12      ;    reserver
  697     0  ; a57   =  14 ; hw ;    not used
  698     0  ; a58   =  15 ; hw ;    not used
  699     0  ; a54   =  16      ;    first message in event queue ($)
  700     0  ; a55   =  18      ;    last  message in event queue ($)
  701     0  ;                  ;    not used
  702     0  ; a70   =  22      ;    not used
  703     0  ; a71   =  24      ;    not used
  704     0  ; a72   =  26      ;    not used
  705     0  ; a73   =  28      ;    not used
  706     0  ; a74   =  30      ;    not used
  707     0  ; a75   =  32      ;    not used
  708     0  ; a86   =  34      ;    max transfer + 1 (octets  = buffer size + 1) ($)
  709     0  ; a87   =  36      ;    buffer size (octets) ($)
  710     0  ; a76   =  38      ;    device index in ifp of device ($)
  711     0  ; a77   =  40      ;    rc8000 device address of device ($)
  712     0  ; a78   =  42      ;    unused, state of subprocess (*) ($)
  713     0  ; a81   =  44      ;    next in itc process queue (not used) ($)
  714     0  ;                  ;    prev in itc process queue (  - " - ) ($)
  715     0  ; a59   =  48      ;   device number (+)
  716     0  ; a67   =  50      ;    (unit ($))
  717     0  ; a68   =  52      ;    (device ($))
  718     0  ;
  719     0  ;
  720     0  ;
  721     0  ;     (*)     state of subprocess (a78 bit 12 - 23):
  722     0  ;             bit 21-23: 0 = free;  1 = during connect;  2 = connected;
  723     0  ;                        3 = during disconnect;  4 = after intervention;
  724     0  ;
  725     0  \f


  725     0  
  725     0  
  725     0    
  725     0  ; I F P  -  C S P   T E R M I N A L / S S P   C O N S O L E    
  726     0  ; =============================================================
  727     0  ;
  728     0  ;
  729     0  ; name    rel. addr     use
  730     0  ; -----   ---------     ---------------------------------------
  731     0  ;
  732     0  ;                  ;    user bit array (variable in size)
  733     0  ; a48   = - 4      ;    lower name base
  734     0  ; a49   = - 2      ;    upper name base
  735     0  ; a10   =   0      ;    kind (csp terminal: 8, ssp console: 9) ($)
  736     0  ; a11   =   2      ;    name
  737     0  ; a50   =  10      ;    main (ifp-main) ($)
  738     0  ; a52   =  12      ;    reserver
  739     0  ; a57   =  14 ; hw ;    not used
  740     0  ; a58   =  15 ; hw ;    not used
  741     0  ; a54   =  16      ;    first message in event queue ($)
  742     0  ; a55   =  18      ;    last  message in event queue ($)
  743     0  ;                  ;    not used
  744     0  ; a70   =  22      ;    not used
  745     0  ; a71   =  24      ;    attention buffer address
  746     0  ; a72   =  26      ;    not used
  747     0  ; a73   =  28      ;    not used
  748     0  ; a74   =  30      ;    process address of reserver
  749     0  ; a75   =  32      ;    last internal which did i/o
  750     0  ; a86   =  34      ;    max transfer + 1 ($)
  751     0  ; a87   =  36      ;    buffer size ($)
  752     0  ; a76   =  38      ;    device index in controller of device ($)
  753     0  ; a77   =  40      ;    rc8000 device address of device ($)
  754     0  ; a78   =  42      ;    unused, state of subprocess (*) ($)
  755     0  ; a81   =  44      ;    next in itc process queue ($)
  756     0  ;                  ;    prev in itc process queue ($)
  757     0  ; a59   =  48      ;   device number (+)
  758     0  ; a67   =  50      ;    (unit ($))
  759     0  ; a68   =  52      ;    (device ($))
  760     0  ;
  761     0  ;
  762     0  ;
  763     0  ;     (*)     state of subprocess (a78 bit 12 - 23):
  764     0  ;             bit 21-23: 0 = free;  1 = during connect;  2 = connected;
  765     0  ;                        3 = during disconnect;  4 = after intervention;
  766     0  ;
  767     0  \f


  767     0  
  767     0  
  767     0  
  767     0  
  767     0  ; P R O C E S S   K I N D S
  768     0  ; ============================================================================
  769     0  ;
  770     0  
  770     0      q0  =   0   ; internal process
  771     0      q4  =   4   ; area process
  772     0      q6  =   6   ; disk process (physical or logical)
  773     0      q8  =   8   ; terminal process
  774     0      q9  =   9   ; ssp console
  775     0     q14  =  14   ; printer process
  776     0     q18  =  18   ; magnetic tape process
  777     0     q20  =  20   ; ioc main process
  778     0     q24  =  24   ; ssp main process
  779     0     q26  =  26   ; dlc main process
  780     0     q28  =  28   ; general sequentil device process
  781     0     q68  =  68   ; free (external) process
  782     0  
  782     0  \f


  782     0  
  782     0  
  782     0          
  782     0  ; M E S S A G E 
  783     0  ; ============================================================================
  784     0  ;
  785     0  ;
  786     0  
  786     0        a138  =  -4      ;   count, state
  787     0        a139  =  -2      ;   flag
  788     0        a140  =   0      ;   next message
  789     0                         ;   previous message
  790     0        a141  =   4      ;   receiver/result      (if receiver < 0 : claimed)
  791     0        a142  =   6      ;   sender               (if sender   < 0 : regretted)
  792     0        a150  =   8      ;   mess_0
  793     0        a151  =  10      ;   mess_1
  794     0        a152  =  12      ;   mess_2
  795     0        a153  =  14      ;   mess_3
  796     0        a154  =  16      ;   mess_4
  797     0        a155  =  18      ;   mess_5
  798     0        a156  =  20      ;   mess_6
  799     0        a157  =  22      ;   mess_7
  800     0  
  800     0        a145  =  a150    ;   message part of message
  801     0        a146  =  a157+2  ;   top of buffer
  802     0        a6    =  a146-a138;  size of message buffer
  803     0        a7    =  a140-a138;   size of negative part
  804     0  
  804     0  ;
  805     0  ;
  806     0  ;  state (a138 + 1):
  807     0  ;        bit    23 : i/o, set when the message involve an i/o transfer
  808     0  ;            21-22 : transfer state of message when ioc/dlc message:
  809     0  ;                  : 2.xxxx00x : not transfered
  810     0  ;                  : 2.xxxx01x : during transfer
  811     0  ;                  : 2.xxxx10x : transfer complete
  812     0  ;               20 : regretted (stopped) set when the message has been regretted
  813     0  ;               19 : use_copy, when set a chain was interrupted by a high-
  814     0  ;                  : priority operation causing the com_area (a550-a573) to be
  815     0  ;                  : saved in a580 - a581. the com_area must be re-established.
  816     0  ;               18 : answer - when set (first part of) answer has been copied
  817     0  ;                  : from com_area to message.
  818     0  ;               17 : force - when set the message is a high-priority operation
  819     0  ;                  : (dump or regret)
  820     0  ;            12-14 : result (1 or 3 or 4) or a disjunction of 1 and 3 and 4
  821     0  \f


  821     0  
  821     0  
  821     0  ; message buffer states (according to sender/receiver fields):
  822     0  
  822     0  ; the possible states of a message buffer are defined by the values 
  823     0  ; of the sender and receiver fields in the buffer:
  824     0  ;
  825     0  ;         sender:        receiver:          state:
  826     0  ;   1.       0              0               free
  827     0  ;   2.    sender addr    receiver addr      message pending
  828     0  ;   3.    sender addr   -receiver addr      message received
  829     0  ;   4.   -sender addr    receiver addr      (not possible)
  830     0  ;   5.   -sender addr   -receiver addr      message received, but regretted by sender
  831     0  ;   6.
  832     0  ;   7.
  833     0  ;   8.    sender addr       1               pending answer,  result = normal
  834     0  ;   9.    sender addr       2                  -       -     result = rejected
  835     0  ;  10.    sender addr       3                  -       -     result = unintelligible
  836     0  ;  11.    sender addr       4                  -       -     result = malfunction
  837     0  ;  12.    sender addr       5                  -       -     result = unknown
  838     0  ;
  839     0  ; explanations:
  840     0  ;  sender addr   > 0 :  message buffer claim of the sender has been decreased
  841     0  ;  receiver addr > 0 :  message buffer has not been detected by the receiver, i.e. mess
  842     0  ;                       buf claim of sender is untouched. the message buffer may be removed
  843     0  ;                       from the receivers queue without further actions.
  844     0  ;  receiver addr < 0 :  mess buf claim of receiver has been decreased, indicating that the
  845     0  ;                       receiver has deposited a mess buff in the pool, while the receiver
  846     0  ;                       is processing the original one.
  847     0  ;  sender addr   < 0 :  the sender has regretted the message, or has been removed. the mess buf
  848     0  ;                       claim of the sender has been increased, i.e. the sender may now use
  849     0  ;                       the deposited message buffer.
  850     0  ;  1 <= receiver <= 5 : the mess buf claim of the receiver has been readjusted, i.e. the
  851     0  ;                       receiver has regained its deposited mess buf claim
  852     0  \f


  852     0  
  852     0  ;
  853     0  ;
  854     0  ; the following table shows how the different monitor procedures react upon the possible
  855     0  ; bufferstates. the table contains the new state.
  856     0  ;
  857     0  ;                      <-----------------sender/parent----------------->
  858     0  ;                               remove                     <-------------receiver-------------><---drivers--->
  859     0  ;                               process/
  860     0  ;                      send     regret    wait     stop     wait     get      wait     send     link     next
  861     0  ;                      message  message   answer   process  event    event    message  answer     operation
  862     0  ;
  863     0  ; 1 free                  2     illegal   illegal     3     illegal  illegal    -      illegal  illegal    -
  864     0  ; 2 message pending       -        1       unch.      -        3        3       3      illegal     2       2
  865     0  ; 3 message received      -        5       unch.      -       2-3       3       -        8-12      2       -
  866     0  ; 5 mess rec, but regr.   -     illegal   illegal     -        1        5       -         1       1       -
  867     0  ; 8-12 pending answer     -        1         1        -      unch.      1       -      illegal  illegal    -
  868     0  ;
  869     0  ;                               modify/
  870     0  ;                               remove
  871     0  ;                               process
  872     0  ;
  873     0  \f


  873     0  
  873     0  
  873     0  
  873     0  ; format of pu information table:
  874     0  ; =========================================================================
  875     0  ;
  876     0  
  876     0  a350= 0             ; pu table address
  877     0  a351= 2             ; inf register
  878     0  a352= 4             ; mon top register
  879     0  a353= 6             ; core size register
  880     0  a354= 8             ; exception address offset
  881     0  a355=10             ; register dump area offset
  882     0  
  882     0  ; format of pu table:
  883     0  
  883     0  ;+0                 ; no of free pu's
  884     0  ;+2                 ; 1.st pu: process description address or -1;
  885     0  ;+4                 ; 2.nd pu: ---------"------------"---- or -3;
  886     0  ;+6                 ; 3.rd pu: ---------"------------"---- or -5;
  887     0  ;+8                 ; 4.th pu: ---------"------------"---- or -7;
  888     0  
  888     0  ; define not mp offset
  889     0  a8=4
  890     0  \f


  890     0  
  890     0  m.
  890     0                  moncentral - monitor central logic 17.0 beta

  891     0  ;--------------------------------------------------------------------------
  892     0  ;                      REVISION HISTORY 
  893     0  ;--------------------------------------------------------------------------
  894     0  ; DATE      TIME OR INIT       DESCRIPTION
  895     0  ;           RELEASE
  896     0  ;--------------------------------------------------------------------------
  897     0  ;88.03.24 R14.1A HSI  start of description
  898     0  ;88.03.24 14.53 hsi  insert ap procedure (d4)
  899     0  ;         18.30 hsi  addr 138: max number of processors 
  900     0  ;                     initialized at power up
  901     0  ;88.04.19 15.0  tsh  c45, c46 rewritten and c47 added
  902     0  ;88.04.24 14.24 hsi  addr 138 count instead value in monitor call
  903     0  ;88.04.24 11.16 kak  io-test change in decrease stopcount (x2+8 --> x2+a138+1)       
  904     0  ;88.05.09 10.05 kak  w1=main at c45 and c46 before test
  905     0  ;         14.33 kak  at return from c45 check-result in w0 instead of w2
  906     0  ;88.05.24 07.50 kak  change of cpa and address base included
  907     0  ;88 05 30 10.59 hsi  define global constants in monitor table
  908     0  ;88 06 01 09.15 hsi  add constants to table
  909     0  ;88 06 02 07.00 tsh  updates of c45 and c47 due to protocol changes
  910     0  ;88 06 16 11.12 kak  function table at 'check itc function' extended
  911     0  ;88 08 16 13.32 hsi  update constant table
  912     0  ;88 08 17 17.45 hsi  add new function: stop normal communication
  913     0  ;88 09 12 13.54      d132: answer to removed link: use driverproc
  914     0  ;88 09 16 16.36      update constant table
  915     0  ;88 09 19 11.37 hsi  move constant table to hw addr 160
  916     0  ;88 10 06 13.07 hsi    error in calculate hw (c47) (R15)
  917     0  ;88 10 13 13.55 kak  queue in ioc/lan main is checked after answer device and
  918     0  ;                    deliver interrupt
  919     0  ;88 11 21 13.39 kak  bit 12-14 in message buffer state field is used to result or
  920     0  ;                    a disjunction of results (chained operations)
  921     0  ;                    and the final result is extracted from this field
  922     0  ;88 12 06 15.36 kak  only the first status from chained operations are used
  923     0  ;89 01 23 12.53 kak  deactivate process after program error (c2)
  924     0  ;89 03 08 09.09 kak  no check of waiting operation to mainprocesses after deliver interrupt to driverproc,
  925     0  ;                    the check is performed when driverproc has token care of the interrupt
  926     0  ;89 03 15 15.10 kak  decrease number of outstanding operation is delayed until answer device operation (c47)
  927     0  ;                    or after deliver interrupt to driver (c48), in the last case the main process
  928     0  ;                    is removed from the timer queue before the interrupt is delivered
  929     0  ;89 03 20 10.36 kak  it is checked that clock process is not in queue before the clockinterrupt is delivered
  930     0  ;89 04 03 20.44 hsi  error in c5: set process in running after error
  931     0  ;89 05 25 14.10 kak call of deliver answer changed: result must not be set in receiver field, but kept in w0
  932     0  
  932     0  ;--------------------------------------------------------------------------
  933     0  ;90 05 10 09.36 kak release 17.0
  934     0  ;90 05 10 09.37 kak new test point (41) at deliver interrupt to itc-main (c48)
  935     0  ;90 05 29 14.37 kak errorlog called at ioc and lan errors 
  936     0  ;                   special watched receiver introducted for ioc and lan devices
  937     0  
  937     0  b.i30 w.
  938     0  i0=91 02 01 
  939     0  i1=09 36 00 
  940     0  
  940     0  ; if newtime (i0,i1) > oldtime (a133,a134) then oldtime:=newtime;
  941     0  c.i0-a133
  942     0    c.i0-a133-1, a133=i0, a134=i1, z.
  943     0    c.i1-a134-1,          a134=i1, z.
  944     0  z.
  945     0  
  945     0  i10=i0, i20=i1
  946     0  
  946     0  i15=i10/100000 , i10=i10-i15*100000 , i25=i20/100000 , i20=i20-i25*100000 
  947     0  i14=i10/10000  , i10=i10-i14*10000  , i24=i20/10000  , i20=i20-i24*10000 
  948     0  i13=i10/1000   , i10=i10-i13*1000   , i23=i20/1000   , i20=i20-i23*1000
  949     0  i12=i10/100    , i10=i10-i12*100    , i22=i20/100    , i20=i20-i22*100
  950     0  i11=i10/10     , i10=i10-i11*10     , i21=i20/10     , i20=i20-i21*10
  951     0  
  951     0  i2:  <:                              date  :>
  952    24       (:i15+48:)<16+(:i14+48:)<8+46
  953    26       (:i13+48:)<16+(:i12+48:)<8+46
  954    28       (:i11+48:)<16+(:i10+48:)<8+32
  955    30  
  955    30       (:i25+48:)<16+(:i24+48:)<8+46
  956    32       (:i23+48:)<16+(:i22+48:)<8+46
  957    34       (:i21+48:)<16+(:i20+48:)<8+ 0
  958    36  
  958    36  i3:  al. w0  i2.       ; write date:
  959    38       rs  w0  x2+0      ;   first free:=start(text);
  960    40       al  w2  0         ;
  961    42       jl      x3        ;   return to slang(status ok);
  962    44  
  962    44       jl.     i3.       ;
  963    46  e.
  964    46  j.
  964     0                                date  91.02.01 09.36.00

  965     0  \f


  965     0  
  965     0  
  965     0  
  965     0  ; segment 1 : enter monitor after load
  966     0  ; the monitor is entered in word 8. the words +2,+4 must at entry contain -
  967     0  ;  +2  load flag, writetext
  968     0  ;  +4  medium
  969     0  ; where
  970     0  ;   load flag: 1  autoload of device controllers
  971     0  ;              0  no autoload
  972     0  
  972     0  s. i3
  973     0  w.
  974     0  
  974     0  i0:             i2.     ;   length of segment 1
  975     2                   0      ;   init cat switch: writetext
  976     4  i1:              0      ;   init cat switch: medium
  977     6  ; entry from autoloader:
  978     6       al. w3     i0.     ;   calculate top address of
  979     8       rl  w2  x3         ;     last segment;
  980    10       wa  w3     4      ;
  981    12  ds. w3 i3.   ; ---------
  982    14       se  w2     0       ;     (i.e. until segment size = 0)
  983    16       jl.       -8       ; -6
  984    18       al. w2     i2.     ;   insert start address of segment 2;
  985    20       dl. w1     i1.     ;   get init cat switches
  986    22       jd      x3-2       ;   jump to segment 10
  987    24       0,
  988    26  i3:0 ; -----------
  989    28  i2:                     ;   first word of segment 2
  990    28  
  990    28  ; exit with:
  991    28  ;   w0, w1 = init cat switches
  992    28  ;   w2     = start address of segment 2
  993    28  
  993    28  e.   ;  end segment 1
  994    28  
  994    28  
  994    28  b. v100, r28, l60, g70, f30, e70, d160, c200
  995    28  \f


  995    28  
  995    28  ; segment 2: monitor
  996    28  
  996    28  s. k = 8, j0
  997     8  w.b127=k, j0, k=k-2
  998     8  ; segment structure:
  999     8  ;     monitor table          (b names)
 1000     8  ;     interrupt response     (c names)
 1001     8  ;     utility procedures     (d names)
 1002     8  ;     monitor procedures     (e names)
 1003     8  ;     name table             (f names)
 1004     8  ;     process descriptions   (f names)
 1005     8  ;     buffers                (f names)
 1006     8  ;     ITC  functions         (l names)
 1007     8  ;     ITC  states            (l names)
 1008     8  ;
 1009     8  ;     (g and h i and j names are used locally)
 1010     8  
 1010     8  ; monitor table
 1011     8  
 1011     8  ; all addresses are absolute addresses
 1012     8  ; an integer after the semicolon means, that the address can't
 1013     8  ;    be changed, because it - unfortunately - has been published
 1014     8  ;    or because they have a hardware-function
 1015     8  
 1015     8  b65: 0-0-0             ;  8: base of controller description table
 1016    10  b66: c25               ; 10: power up entry
 1017    12  b67: 0-0-0             ;     first controller table entry
 1018    14  b68: 0-0-0             ;     top   controller table entry
 1019    16  b69: b69               ;     queue head: software timeout
 1020    18       b69               ;                 (for devices)
 1021    20  b70: 0 , 0             ;     time when last inspected
 1022    24  b72: 0-0-0 ; b53       ;     start of interrupt table
 1023    26  b73: 0-0-0 ; b54       ;     max external interrupt number
 1024    28  b0:  0-0-0 ; b53 - b16 ;     (relative start of interrupt table
 1025    30  b74: a198              ;     device address of i/o cpu
 1026    32  b75: 0                 ;     after powerfail (0==false, else true)
 1027    34  
 1027    34  b18: 0                 ;     current buffer address
 1028    36  b19: 0                 ;     current receiver
 1029    38  b20: c96               ;     address of simple wait event procedure
 1030    40  b21: 0-0-0             ;     process description address of driverpoc
 1031    42  b101:0                 ;     return from subprocs
 1032    44  b102:0-0-0 ; a66       ;     start of table(subproc-drivers)
 1033    46  b103:0                 ;     address of entry for send message for linkdriver areas
 1034    48  b76: 0                 ;     start of secondary interrupt chain
 1035    50  b30: 0-0-0             ;     errorlog proc
 1036    52  b31: g66               ;     errorlog entry
 1037    54  b58: 0                 ; 54: device address register (used by ifp)
 1038    56  b59: 0-0-0             ;     pu-information table address
 1039    58  b38: 0-0-0             ;     rtc-table address
 1040    60       r. (:64-k+2:) > 1 ; 60-62 reserved for testprograms
 1041    64       a135<12+a136      ; 64: release, version of monitor
 1042    66  b42: -1000000          ; 66: current process (single cpu)
 1043    68  b2:  b2                ;     time slice queue head:  next process
 1044    70       b2                ;                             last process
 1045    72  b3:  0-0-0             ; 72: name table start
 1046    74  b4:  0-0-0             ; 74: first device in name table
 1047    76  b5:  0-0-0             ; 76: first area in name table
 1048    78  b6:  0-0-0             ; 78: first internal in name table
 1049    80  b7:  0-0-0             ; 80: name table end
 1050    82  b8:  b8                ;     mess buf pool queue head:  next buf
 1051    84       b8                ;                                last buf
 1052    86       0-0-0             ; 86: first byte of mess buf pool area
 1053    88       0-0-0             ; 88: last byte  of mess buf pool area;( last word of last monitor table)
 1054    90       a6                ; 90: size of message buffer
 1055    92  b22: 0-0-0             ; 92: first drum chain  in name table
 1056    94  b23: 0-0-0             ; 94: first disc chain  in name table
 1057    96  b24: 0-0-0             ; 96: chain end         in name table
 1058    98  b25: 0                 ; 98: main cat chain table
 1059   100  b1:  0-0-0             ;cur process in monitor
 1060   102  b10: a85               ;     maximum time slice
 1061   104  b11: 0                 ;104: time slice (of current process)
 1062   106       0                 ;106: zero (earlier:  micro seconds)
 1063   108  b13: 0 , 0             ;108:110: time (unit of 0.1 milli seconds)
 1064   112  b14: 0                 ;     last sensed clock value
 1065   114  b9:  0-0-0             ; pu kind offset
 1066   116  b12: 0-0-0             ;116: number of storage bytes
 1067   118       a111<12 + a109    ;118: min global key, min aux cat key ?????
 1068   120  b15: 0 , 0             ;     clockchange, after set clock:
 1069   124                         ;        newtime - oldtime
 1070   124  b79: 0-0-0             ; interrupt statistical table (init in tabinit)
 1071   126  b81: b80               ; monitor call statistical table
 1072   128  b82: 0                 ; current number of processors
 1073   130  b83: 0, 0, 0, 0        ; rescedule counter
 1074   138       r. (:160-k+2:) > 1; start of constant table:
 1075   160  b200: 0 , 0            ; double nul
 1076   164  b201: 1
 1077   166  b202: 2
 1078   168  b203: 3
 1079   170  b204: 4
 1080   172  b205: 5
 1081   174  b206: 6
 1082   176  b207: 7
 1083   178  b208: 8
 1084   180  b209: 9
 1085   182  b210:10
 1086   184  b211: 8.00030000       ; format identifier (in SSP/clock interrupt word)
 1087   186  b212: 8.37777777       ; last  23 bits
 1088   188  b213: 8.77777776       ; first 23 bits
 1089   190  b214: 8.00017777       ; last  13 bits
 1090   192  b215: 8.00007777       ; last  hw
 1091   194  b216: 8.00003777       ; last  11 bits
 1092   196  b217: 8.77770000       ; first hw
 1093   198  b218: 8.77600000       ; first byte
 1094   200  b219: 8.00177400       ; midt  byte
 1095   202  b220: 8.00000377       ; last  byte
 1096   204  b235: 8.77777400       ; first tree byte
 1097   206  b236: 8.77777777       ; full house
 1098   208  b221: 512              ;
 1099   210  b222: 768
 1100   212  b223: 1<12 
 1101   214  b224: 1<13
 1102   216  b225: 1<14
 1103   218  b226: 1<15
 1104   220  b227: 1<16
 1105   222  b228: 1<17
 1106   224  b229: 1<18
 1107   226  b230: 1<19
 1108   228  b231: 1<20
 1109   230  b232: 1<21
 1110   232  b233: 1<22
 1111   234  b234: 1<23
 1112   236  b237: 8.00177777
 1113   238  
 1113   238  ;redefinition of old constants
 1114   238  g48 = b203
 1115   238  g49 = b234
 1116   238  g50 = b213
 1117   238  g51 = b217
 1118   238  g52 = b215
 1119   238  g53 = b220
 1120   238  g62 = b229
 1121   238  g63 = b201
 1122   238  g65 = b212
 1123   238  g67 = b216
 1124   238  g68 = b214
 1125   238  
 1125   238  
 1125   238  b26 = b5                ; use area proceses as pseudo processes
 1126   238  
 1126   238  l50 = (:a80>16a.1:)-1   ; ida/ifp device driver included (not used anymore)
 1127   238  l53 = (:a84>16a.1:)-1   ; ida/ifp device driver testoutput 0=yes, -1=no
 1128   238                          ; Sending a message to the main process the test mask may set, the mask contain 48 bit,
 1129   238                          ;  default bit 45 and 46 and 47 are set, the meaning of the bits are:
 1130   238                          ;  no   procedure                       output          no of hw
 1131   238                          ;  1: area driver part 1                message           18
 1132   238                          ;  2: area driver part 2                message           18
 1133   238                          ;  3: area driver part 2                message state      2
 1134   238                          ;  6: disc driver part 1                message           18
 1135   238                          ;  7: disc driver part 2                message           18
 1136   238                          ;  8: disc driver part 2                message state      2
 1137   238                          ; 11: tape driver part 1                message           18
 1138   238                          ; 12: tape+printer+gsd driver part 2    message           18
 1139   238                          ; 13: tape+printer+gsd driver part 2    message state      2
 1140   238                          ; 16: main driver part 2                message           18
 1141   238                          ; 17: main driver part 2                message state      2
 1142   238                          ; 24: tape+printer+gsd driver part 1    message           18
 1143   238                          ; 25: csp terminal driver part 1        message           18
 1144   238                          ; 26: csp terminal driver part 2        message           18
 1145   238                          ; 40: special set up reserve and
 1146   238                          ;     release process                   ext proc          14
 1147   238                          ; 41: interrupt, supervisor message     comm. area        24
 1148   238                          ; 45: interrupt                         buffer addr.       2
 1149   238                          ; 46: start controller                  comm. area        24
 1150   238                          ; 47: interrupt                         comm. area        24
 1151   238  
 1151   238  
 1151   238  c.(:a399>23a.1:)-1
 1152   238  ; definition of dump area used in prepare dump (only RC9000-model 10)
 1153   238        0                 ; lower dump area: first address
 1154   238  b27:  0                 ; lower dump area: no of segments
 1155   238        0                 ; upper dump area: first address
 1156   238  b28:  0                 ; upper dump area: no of segments
 1157   238  z.
 1158   238  
 1158   238  ; definition of general registers in rc8000
 1159   238  
 1159   238  b90 = 8.14 * 2         ; ilevc  : interrupt level limit copy
 1160   238  b91 = 8.15 * 2         ; inf    : current interrupt stack element address
 1161   238  b92 = 8.17 * 2         ; size   : top available core address
 1162   238  b93 = 8.20 * 2         ; montop : 1 < 11 - top monitor procedure number
 1163   238  b94 = 8.62 * 2         ; clock
 1164   238  b95 = 8.57 * 2         ; ir     : used to clear selected bits in interrupt reg
 1165   238  b96 = 8.04 * 2         ; status : cpu status register
 1166   238  b97 = 8.60 * 2         ; dswr   : data swithes
 1167   238  b98 = 8.61 * 2         ; regsel : register swithes
 1168   238  b99 = 8.60 * 2         ; display
 1169   238  ;
 1170   238  b100= 8.21*2         ; cpukind: 0:  /45
 1171   238                       ;         -1:  /15, /25, /35
 1172   238                       ;         50:  /50
 1173   238                       ;         55:  /55
 1174   238                       ;         60:  /60
 1175   238                       ;         65:  /65
 1176   238  
 1176   238  ; the following registers are only defined in a mp:
 1177   238  
 1177   238  b104= 8.24*2         ; cur process register
 1178   238  b105= 8.26*2         ; pu table register
 1179   238  b106= 8.27*2         ; exception offset register
 1180   238  b107= 8.30*2         ; dump offset register
 1181   238  b108= 8.25*2         ; pu index register
 1182   238  
 1182   238  ; definition of interrupt stack.
 1183   238  ; parameters are relative to base of stack element (i.e. 1,3,5,..)
 1184   238  
 1184   238  b.j0
 1185   238  j0=-1   ,  j0=j0+2  ;   base of stack element
 1186   238  
 1186   238  a326=j0 ,  j0=j0+2  ;    regdump
 1187   238  a327=j0 ,  j0=j0+2  ;    exception routine
 1188   238  a328=j0 ,  j0=j0+2  ;    escape routine
 1189   238  a329=j0 ,  j0=j0+2  ;    monitor call entry
 1190   238  a330=j0 ,  j0=j0+2  ;    external interrupt entry
 1191   238  a331=j0 ,  j0=j0+2  ;    interrupt limits, disabled/enabled
 1192   238  
 1192   238  a325=j0-a326        ;  size of interrupt stack element
 1193   238  
 1193   238  e.
 1194   238  
 1194   238  ; parameter errors in monitor call:
 1195   238  ;
 1196   238  ; all monitor procedures check that the parameters are
 1197   238  ;    within certain limits.
 1198   238  ; if the parameters are wrong, the calling process is break'ed.
 1199   238  ;
 1200   238  ; (all regs irrellevant)
 1201   238  c29: jl.      (+2)   ; goto internal break
 1202   240              c28      ;
 1203   242  
 1203   242  
 1203   242  ; interrupt return:
 1204   242  ; a new internal process may have been put up in front of
 1205   242  ;    the time slice queue, due to an external interrupt, or because
 1206   242  ;    the current monitor call was 'send message' or the like.
 1207   242  ; therefore it must be tested, that the current process is still
 1208   242  ;    the one in front. if not: select that one.
 1209   242  
 1209   242  b.  i2, j0  w.
 1210   242  c99:                   ; interrupt return:
 1211   242  b. h1 w.               ;  if mp then
 1212   242       am        (b9)    ;
 1213   244  h0=k
 1214   244       jl.       0       ;  begin
 1215   246       jl         c24    ; goto mp activation
 1216   248  c.(:h0+a8-k-1:)
 1217   248       am  0, r.(: h0+a8+2-k :)>1 ;  fill up
 1218   248  z.
 1219   248  e.                     ;  end mp
 1220   248  
 1220   248       rl  w1     b1     ; proc := cur
 1221   250       sh  w1     0      ; if cur defined and
 1222   252       jl.        i0.    ;
 1223   254       zl  w0  x1+a13    ;  proc.state <> running then
 1224   256       sn  w0     a94    ;  begin
 1225   258       ri         a179   ;
 1226   260  i0:  jl. w3     d8.    ;     activate process
 1227   262       rs  w1     b42    ;
 1228   264       rs  w1     b51    ;     cur:= proc
 1229   266       rs  w1     b1     ;     cur process in monitor := proc;
 1230   268       al  w2  x1        ;
 1231   270       gg  w3     b91    ;    w3 := inf (= address of current stack element);
 1232   272       dl  w1  x2+a170   ;    move:  user escape address (cur)
 1233   274                         ;           user exception address (cur)
 1234   274       ds  w1  x3+a325+a328;
 1235   276       al  w0  x2+a28    ;           address of regdump area (cur)
 1236   278       rs  w0  x3+a325+a326;    to:  previous interrupt stack element;
 1237   280  
 1237   280       ri         a179   ;    return interrupt;
 1238   282  c24: rl  w2     b2     ;    proc:=first in queue ; activated:=true
 1239   284       al  w1  x2-a16    ;
 1240   286       se  w2     b2     ;    do while queue not empty and activated
 1241   288       jl  w3     d4     ;     activate process; 88.03.24 14.53
 1242   290       ri         1      ;     return to user;
 1243   292       jl. w3     d8.    ;
 1244   294       rl  w3     b82    ;    if no of cpues = 1 then
 1245   296       sn  w3     1      ;    cur process := proc;
 1246   298       rs  w1     b42    ;
 1247   300       jl         c24    ;    endwhile
 1248   302                         ; end
 1249   302                         ; return
 1250   302  e.
 1251   302  
 1251   302  
 1251   302  ; procedure check itc function
 1252   302  ;
 1253   302  ;
 1254   302  ;     call
 1255   302  ;
 1256   302  ;  w0  - 
 1257   302  ;  w1  -
 1258   302  ;  w2  - (8000 special: main + a241)
 1259   302  ;  w3  -
 1260   302  ;
 1261   302  
 1261   302  b. i10,  j21  w.
 1262   302  c45:                      ; procedure check_itc_function
 1263   302                            ; begin
 1264   302  c.l53  b.  f4  w.         ; ****** test 47 ******
 1265   302       rs. w3     f1.       ;
 1266   304       al  w1  x2-a241      ; 
 1267   306       rs. w1     f0.       ;
 1268   308       jl. w3    (f3.)      ;
 1269   310       47                   ;
 1270   312  f0:  0                    ; main
 1271   314  f1:  0                    ;
 1272   316       jl.        f2.       ;
 1273   318       al  w0  x1+a500      ; dump main.communication area
 1274   320       al  w1  x1+a517      ;
 1275   322       jl. w3    (f4.)      ;
 1276   324       jl.        f2.       ;
 1277   326  f3:  d150                 ;
 1278   328  f4:  d151                 ;
 1279   330  f2:                       ;
 1280   330  e.z.                      ; ****** end test 47 ******
 1281   330                            ;   -----> 8000 special <------
 1282   330       al  w1  x2-a241      ; 
 1283   332                            ;   -----> end 8000 special <------
 1284   332       al  w0     8.0377    ;
 1285   334       la  w0  x1+a500      ;   if main.gen_info.result = no_credit or
 1286   336       se  w0     6         ;      main.gen_info.result = illigal_link then
 1287   338       sn  w0     7         ;      panic; <* protocol error *>
 1288   340       jl        -1         ;
 1289   342       rs. w0     i6.       ;   <* save result *>
 1290   344                            ;
 1291   344       rl  w0     b227      ;   if main.gen_info.answer then   <* bit 1<16 *>
 1292   346       la  w0  x1+a500      ;   begin
 1293   348       sn  w0     0         ;
 1294   350       jl.        j1.       ;     main.free_buffers :=
 1295   352       al  w0     1         ;     main.free_buffers + 1;
 1296   354       ba  w0  x1+a78+0     ;
 1297   356       hs  w0  x1+a78+0     ;   end;
 1298   358  j1:                       ;
 1299   358       rl  w0     b219      ;   <* middle octet *>
 1300   360       la  w0  x1+a500      ;
 1301   362       ls  w0    -8         ;
 1302   364       rl  w3  x1+a503      ;
 1303   366       sn  w3     0         ;   if process-id = 0 then
 1304   368       jl.        j2.       ;   skip errorlog check;
 1305   370       se  w3     (b32)     ;   if special watched receiver or
 1306   372       se  w0     0         ;      check<>0 then
 1307   374       sz                   ;
 1308   376       jl.        j2.       ;   begin
 1309   378       rx  w1     6         ;
 1310   380       jl  w2     (b31)     ;     < call error-log >
 1311   382       al  w1  x3           ;
 1312   384       al  w2  x1+a241      ;
 1313   386                            ;   end;
 1314   386  j2:                       ;
 1315   386       rl  w3     b218      ;   <* left octet *>
 1316   388       la  w3  x1+a500      ;
 1317   390       ls  w3    -15        ;
 1318   392       sl  w3     63        ;   if main.function > 15 then
 1319   394       jl        -1         ;   panic;
 1320   396                            ;
 1321   396       rl. w0     i6.       ;   <* w0: result, w1: main, w2: main+a241 *>
 1322   398       jl.    (x3+j3.)      ;   goto case function of
 1323   400                            ;func, a :
 1324   400  j3:            -1         ;  0   0 : undef
 1325   402                 -1         ;  0   1 : undef
 1326   404                 -1         ;  1   0 : undef
 1327   406       c47                  ;  1   1 : answer device operation
 1328   408       c48                  ;  2   0 : create link           - deliver interrupt
 1329   410       c48                  ;  2   1 : answer create link    - deliver interrupt
 1330   412                 -1         ;  3   0 : undef
 1331   414       c48                  ;  3   1 : answer remove link    - deliver interrupt
 1332   416       c48                  ;  4   0 : attention             - deliver interrupt
 1333   418                 -1         ;  4   1 : undef
 1334   420                 -1         ;  5   0 : undef
 1335   422       c48                  ;  5   1 : answer regret         - deliver interrupt
 1336   424                 -1         ;  6   0 : undef
 1337   426       c48                  ;  6   1 : answer reserve device - deliver interrupt
 1338   428                 -1         ;  7   0 : undef
 1339   430       c48                  ;  7   1 : answer release device - deliver interrupt
 1340   432       c48                  ;  8   0 : remove link request   - deliver interrupt
 1341   434                 -1         ;  8   1 : undef
 1342   436                 -1         ;  9   0 : undef
 1343   438       c48                  ;  9   1 : answer initialize controller - deliver interrupt
 1344   440                 -1         ; 10   0 : undef
 1345   442       c47                  ; 10   1 : answer supervisor_operation
 1346   444                 -1         ; 11   0 : undef
 1347   446       c48                  ; 11   1 : answer reset
 1348   448                 -1         ; 12   0 : undef
 1349   450       c48                  ; 12   1 : answer stop normal communication
 1350   452                 -1         ; 13   0 : undef
 1351   454       c47                  ; 13   1 : answer operator message
 1352   456                 -1         ; 14   0 : undef
 1353   458                 -1         ; 14   1 : answer close system: just panic
 1354   460                 -1         ; 15   0 : undef
 1355   462                 -1         ; 15   1 : answer reload system: just panic
 1356   464  
 1356   464  i6:  0                    ; save result
 1357   466                            ;
 1358   466  e.                        ; end;
 1359   466  
 1359   466  
 1359   466  ; interrupt acknowledge procedure
 1360   466  ;
 1361   466  ; the controller has read it's communication area
 1362   466  ;
 1363   466  ;     call
 1364   466  ; w0  -
 1365   466  ; w1  -
 1366   466  ; w2  - (8000 special: main + a229)
 1367   466  ; w3  -
 1368   466  ;
 1369   466  
 1369   466  b. j5 w.
 1370   466  c46:                      ; procedure acknowledge interrupt
 1371   466                            ; begin
 1372   466  c. l53  b.  f4 w.         ; ****** test 45 ******
 1373   466       rs. w3     f1.       ;
 1374   468       al  w1  x2-a229      ; 
 1375   470       rs. w1     f0.       ;
 1376   472       jl. w3    (f3.)      ;
 1377   474       45                   ;
 1378   476  f0:  0                    ; main
 1379   478  f1:  0                    ;
 1380   480       jl.        f2.       ;
 1381   482       al  w0  x1+a551      ; dump message buffer address
 1382   484       al  w1  x1+a551      ;
 1383   486       jl. w3    (f4.)      ;
 1384   488       jl.        f2.       ;
 1385   490  f3:  d150                 ;
 1386   492  f4:  d151                 ;
 1387   494  f2:                       ;
 1388   494  e.z.                      ; ****** end test 45 ******
 1389   494                            ;
 1390   494                            ; ------>    RC8000 special    <-------
 1391   494       al  w1  x2-a229      ; 
 1392   496                            ; ------>  end RC8000 special  <-------
 1393   496       ac  w0     2.010000+1;
 1394   498       la  w0  x1+a78       ;   main.com_state := ready;
 1395   500       hs  w0  x1+a78+1     ;
 1396   502  ;
 1397   502  c42:                      ; entry2: <* after answer device *>
 1398   502       rl  w2  x1+a81       ;   element := main.waiting_q.first;
 1399   504       sn  w2  x1+a81       ;   if element = none then
 1400   506       jl         c99       ;      return_from_interrupt;
 1401   508       al  w0     0         ;   force :=
 1402   510       sl  w2     (b8+4)    ;
 1403   512       sl  w2     (b8+6)    ;   if element <> message then no
 1404   514       jl         j2        ;
 1405   516       al  w0     2.1000000 ;   else message.state.force;
 1406   518       la  w0  x2+a138      ;
 1407   520       ls  w0     -6
 1408   522  j2:                       ;
 1409   522       jl.       (+2)       ;   test_ready_and_setup(force, message);
 1410   524                  d142      ;
 1411   526                            ; end;
 1412   526  
 1412   526  e.
 1413   526  
 1413   526  ; procedure deliver clock interrupt.
 1414   526  ; only the clock interrupt from the i-o mp (or the cpu) is transferred to
 1415   526  ; the monitor clock driver.
 1416   526  ; return: interrupt return
 1417   526  
 1417   526  c49: al  w0     0      ; 
 1418   528  b. h0 w.               ; if mp then
 1419   528       am        (b9)    ; get pu index
 1420   530     h0=k                ;
 1421   530       jl.         0     ;
 1422   532       gg  w0     b108   ; 
 1423   534  c.(:h0+a8-k-1:)
 1424   534       am 0, r.(:h0+a8+2-k:)>1
 1425   534  z.
 1426   534  e.                     ; end
 1427   534       sn  w2  (x2)      ; if in queue or
 1428   536       se  w0     0      ; not i-o pu or cpu then
 1429   538       jl         c99    ;   return 
 1430   540       jl         c50    ; else deliver interrupt
 1431   542  
 1431   542  
 1431   542  
 1431   542  ; procedure deliver external interrupt
 1432   542  ;
 1433   542  ; when an external interrupt is accepted by the monitor,
 1434   542  ;    control is transferred out into the corresponding
 1435   542  ;    device description, which should contain:
 1436   542  ;
 1437   542  ;        dev descr + a240 :  jl  w2     c51
 1438   542  ;
 1439   542  ; return must be made to the standard interrupt return action,
 1440   542  ;    which will take care of a possible selection of the driver.
 1441   542  ;
 1442   542  ; call: w2 = dev descr + a241
 1443   542  ; return address = interrupt return
 1444   542  
 1444   542  c51: rl  w3  x2-a241+a230;  w3 := top of executed channel program;
 1445   544       al  w0     4      ;    result := 4; (i.e. prepare for abnormal termination)
 1446   546       se  w3     0      ;    if top command address defined then
 1447   548       bl  w3  x3-6+1    ;      w3 := last command executed;
 1448   550       sn  w3    -1<8    ;    if last command = 'stop' then
 1449   552       al  w0     0      ;      result := 0;
 1450   554       sn  w3     4<8    ;    if last command = 'wait' then
 1451   556       al  w0     5      ;      result := 5;
 1452   558  
 1452   558  c50: al  w3     c99    ;    link := interrupt return;
 1453   560                         ; continue with deliver interrupt
 1454   560  
 1454   560  ; procedure deliver interrupt
 1455   560  ; function: delivers the interrupt operation in the event queue
 1456   560  ;           of the corresponding driver process.
 1457   560  ;           the driver process is started, if it was waiting for
 1458   560  ;           an event.
 1459   560  ;
 1460   560  ; call: w0 = result (=0, 1, 2, 3, 4, 5, 6), w2 = operation, w3 = link
 1461   560  ; exit: all regs undef
 1462   560  ; return address: link
 1463   560  
 1463   560  b. h10 w.              ;
 1464   560  d121:rs  w3     h0     ;    save (return);
 1465   562       jl  w1     d131   ;    set result and descrease all stopcounts;
 1466   564  ; w2 = device descr
 1467   564  
 1467   564       rl  w1  x2+a250   ;    driver := driverproc (device descr);
 1468   566       sh  w1     0      ;    if driver undefined then
 1469   568    jl -10         ; test test
 1470   570  ;    jl        (h0)    ;      return;
 1471   570  
 1471   570       al  w2  x2+a241   ;    oper := timeout operation (device descr);
 1472   572       rl  w3     h0     ;    restore (return);
 1473   574  
 1473   574       bz  w0  x1+a13    ;    state := state(driver);
 1474   576       sn  w0     a104   ;    if driver is waiting for event then
 1475   578       jl         d127   ;      goto take interrupt;
 1476   580  
 1476   580       al  w1  x1+a15    ;    link (event queue (driver) , oper);
 1477   582       rl  w3  x1+2      ;
 1478   584       rs  w2  x1+2      ;
 1479   586       rs  w2  x3+0      ;
 1480   588       rs  w1  x2+0      ;
 1481   590       rs  w3  x2+2      ;
 1482   592       jl        (h0)    ;
 1483   594  h0:  0                 ; saved return;
 1484   596  e.                     ;
 1485   596  
 1485   596  ; procedure take interrupt
 1486   596  ; function: let the driver receive the interrupt operation at once
 1487   596  ;
 1488   596  ; call: w1 = driver process, w2 = interrupt operation, w3 = link
 1489   596  ; exit: all regs undef
 1490   596  ; return address: link
 1491   596  
 1491   596  d127:al  w2  x2-a241+a246;
 1492   598       rs  w2  x1+a30    ;    save w2 (driver) := address of driver service inst
 1493   600  
 1493   600       al  w0     2      ;    save w0 (driver) := 2;  i.e. indicate interrupt;
 1494   602       rs  w0  x1+a28    ;    link internal (driver);
 1495   604       zl  w0  x1+a13    ; if process not running then
 1496   606       se  w0     a94    ; link process to running queue
 1497   608       jl         d10    ;
 1498   610       jl      x3        ;
 1499   612  
 1499   612  
 1499   612  ; procedure prepare driver(proc)
 1500   612  ; function: initializes current external process and current buffer
 1501   612  ;           exits to the interrupt address given in proc:
 1502   612  ;              int addr    :  normal exit
 1503   612  ;
 1504   612  ; the call must be made like this:
 1505   612  ;
 1506   612  ;   proc + a246:  jl  w1     c30 ; driver service instruction
 1507   612  ;     ---
 1508   612  ;   proc + a245:  interrupt address
 1509   612  ;     ---
 1510   612  ;   proc + a54 :  next message buf
 1511   612  ;
 1512   612  ; call: w1 = proc + a247
 1513   612  ; exit: w0 = result(proc), w1 = proc, w2 = buf(proc)
 1514   612  ;                int.addr    :  normal exit
 1515   612  
 1515   612  c30: al  w1  x1-a247   ;
 1516   614       rs  w1     b19    ;    current receiver := buf;
 1517   616       rl  w2  x1+a54    ;
 1518   618       rs  w2     b18    ;    current buffer address := next mess(proc);
 1519   620       rl  w0  x1+a244   ;    result := timeout(proc);
 1520   622       jl     (x1+a245)  ;    goto interrupt address(proc);
 1521   624  
 1521   624  ; procedure clear device
 1522   624  ;
 1523   624  ; function: everything is cleared-up in the device description,
 1524   624  ;           i.e.       the controller is reset (except after 'wait'-program)
 1525   624  ;                      a possible pending interrupt is cleared
 1526   624  ;                      a possible pending interrupt operation is removed
 1527   624  ;                      if any stopcounts were increased, they will be decreased
 1528   624  ;
 1529   624  ; call: w1 = link, w2 = device descr
 1530   624  ; exit: w2 = unchanged, w0, w1, w3 = undef
 1531   624  ; return address: link
 1532   624  b. i5, j5  w.
 1533   624  
 1533   624  i1: 0                  ; saved return
 1534   626                         ;
 1535   626  d129:                  ; unconditionally reset:
 1536   626       am       a235-a225;   <point at something <> 0>
 1537   628  d130:                  ; conditionally reset:
 1538   628       rl  w0  x2+a225   ;   note: the controller is not reset when a
 1539   630       rl  w3  x2+a235   ;         wait program is timed out;
 1540   632       sn  w0     0      ;   if transfer in progress then
 1541   634       jl         j1     ;   begin
 1542   636       rs  w1     i1     ;     <w3: physical device address>
 1543   638       al  w1     3      ;     if proc.kind = ifpmain then
 1544   640       rl  w0  x2+a10    ;        reset device(ifp-reset)
 1545   642       sn  w0     q26    ;        device address := physical address;
 1546   644       rs  w3     b58    ;
 1547   646       se  w0     q26    ;     else 
 1548   648       am         2.01<1 ;        reset device(normal reset);
 1549   650       do  w1  x3+0      ;     note: ifp: sub address must be zero - reset is
 1550   652       rl  w1     i1     ;                signaled in work register!
 1551   654  j1:                    ;   end;
 1552   654  
 1552   654       ls  w3     1      ;    entry := device address
 1553   656       ls  w3    -1      ;      (remove bit 0)
 1554   658       wa  w3     b65    ;      + controller table base;
 1555   660  
 1555   660       rl  w0  x3+a313   ;    w0 := interrupt number(controller table (entry));
 1556   662       gp  w0     b95    ;    clear interrupt bit in cpu;
 1557   664  
 1557   664       al  w2  x2+a242   ;    oper := timeout operation(device descr);
 1558   666                         ; continue with set result and decrease all stopcounts
 1559   666                         ; (result = undef)
 1560   666  e.
 1561   666  
 1561   666  ; procedure set result and decrease all stopcounts
 1562   666  ;
 1563   666  ; call: w0 = result:   0 = transfer terminated by stop
 1564   666  ;                      1 = bus reject when started
 1565   666  ;                      2 = bus timeout when started (i.e. disconnected)
 1566   666  ;                     (3 = software timeout)
 1567   666  ;                      4 = transfer terminated, before stop
 1568   666  ;                      5 = wait-program terminated
 1569   666  ;                    (6 = power restart)
 1570   666  ;       w1 = link w2 = timeout operation
 1571   666  ; exit: w2 = device description, w0, w1, w3 = undef
 1572   666  
 1572   666  d131:rs  w0  x2-a241+a244;  save result in timeout-field;
 1573   668       se  w2 (x2)       ;    (if in timer queue then
 1574   670       jl  w3     d5     ;      remove(timeout operation); )
 1575   672       al  w2  x2-a241   ;    w2 := device descr;
 1576   674                         ; continue with decrease all stopcounts
 1577   674  
 1577   674  ; procedure decrease all stopcounts
 1578   674  ;
 1579   674  ; function: if any stopcounts increased, then decrease them again
 1580   674  ;           transfer code(device descr) := 0
 1581   674  ;
 1582   674  ; call: w1 = link, w2 = device descr
 1583   674  
 1583   674  b. h10, i10 w.         ;
 1584   674       ds  w2     h1     ;    save (link, device descr);
 1585   676       rl  w1  x2+a225   ;    get transfer code(device descr);
 1586   678       sn  w1    -1      ;    if no transfer to processes then
 1587   680       jl         i1     ;      goto clear up;
 1588   682  
 1588   682       so  w1     2.1    ;    if transfer code odd then
 1589   684       jl         i0     ;      begin i.e. transfer to/from driver area;
 1590   686  
 1590   686       rl  w1  x2+a250   ;      driver := driver process (device descr);
 1591   688       jl  w3     d133   ;      decrease stopcount(driver);
 1592   690  
 1592   690       rl  w2     h1     ;      restore(device descr);
 1593   692       al  w1    -1<1    ;
 1594   694       la  w1  x2+a225   ;      restore (transfer code)  (even)
 1595   696  i0:                    ;      end;
 1596   696       sn  w1     0      ;    if transfer code shows transfer to/from sender the
 1597   698       jl         i1     ;      begin
 1598   700  
 1598   700       jl  w3     d133   ;      decrease stopcount(sender);
 1599   702       rl  w2     h1     ;      restore (device descr);
 1600   704                         ;      end;
 1601   704  i1:  al  w1     0      ; clear up:
 1602   706       rs  w1  x2+a225   ;    transfer code(device descr) := 0; i.e. no transfer
 1603   708       jl        (h0)    ;    return;
 1604   710  
 1604   710  h0:  0                 ; saved return
 1605   712  h1:  0                 ; saved device descr
 1606   714  e.                     ;
 1607   714  ; procedure decrease stopcount(sender.mess): d132
 1608   714  
 1608   714  ; procedure decrease stopcount(process): d133
 1609   714  ;
 1610   714  ; function: the stopcount of the process is decreased by 1.
 1611   714  ;           if the stopcount becomes zero, and the process is waiting
 1612   714  ;           to be stopped, the process is stopped now (i.e. put in
 1613   714  ;           the state 'waiting for start by...'), and the following will
 1614   714  ;           be done:
 1615   714  ;               if the process was stopped by its parent, the stop-answer
 1616   714  ;                 will be send to the parent (as defined by the wait-address
 1617   714  ;                 in the process), indicating that the stopping has been
 1618   714  ;                 accomplished.
 1619   714  ;               the decrease-action is repeated for the parent etc.etc.
 1620   714  ;
 1621   714  ; call: d132: w2= message or
 1622   714  d132:
 1623   714       rl  w1  x2+a142   ;    proc= sender(mess)
 1624   716       sh  w1  0         ;    if regretted then
 1625   718       ac  w1  x1        ;    proc= -sender(mess)
 1626   720       rl  w0  x1+a10    ;    if kind.proc = pseudo then
 1627   722       sn  w0  64        ;    proc = main proc.sender
 1628   724       rl  w1  x1+a50    ;
 1629   726       sz  w0  -1-64     ;    if proc is neither internal nor pseudo then
 1630   728       rl  w1  b21       ;    proc = driverproc (there is only one)
 1631   730                         ;    (continue with d133)
 1632   730  ; call: d133: w1 = process, w3 = link
 1633   730  ; exit: all regs undef
 1634   730  ; return address: link
 1635   730  
 1635   730  b. i10 w.              ;
 1636   730  d133:rs  w3     i3     ; decrease stopcount:
 1637   732  i0:  al  w0    -1      ; loop:
 1638   734       ba  w0  x1+a12    ;    stopcount (process) :=
 1639   736       hs  w0  x1+a12    ;      stopcount (process) - 1;
 1640   738       bz  w2  x1+a13    ;
 1641   740       sn  w0     0      ;    if stopcount <> 0  or
 1642   742       so  w2     a105   ;      process not waiting for being stopped then
 1643   744       jl         (i3)   ;      return;
 1644   746  
 1644   746       al  w0  x2+a106   ;    state (process) := state (process)
 1645   748       hs  w0  x1+a13    ;      + 'waiting for start';
 1646   750  
 1646   750  ; prepare for repeating the loop:
 1647   750       rl  w2  x1+a40    ;    buf := wait address(process);
 1648   752       rl  w1  x1+a34    ;    process := parent (process);
 1649   754       se  w0     a99    ;    if state <> 'waiting for start by parent' then
 1650   756       jl         i0     ;      goto loop;
 1651   758  
 1651   758  ; prepare the buffer for returning the answer:
 1652   758       al  w0     1      ;    receiver(buf) := result := 1;
 1653   760       jl. w3     (i1.)  ;    deliver answer(buf);
 1654   762       jl         i0     ;    goto loop;
 1655   764  i1:  d15               ;
 1656   766  i3:  0                 ;    saved return;
 1657   768  e.                     ;
 1658   768  
 1658   768  
 1658   768  ; procedure activate_process(internal)
 1659   768  ;
 1660   768  ; sw-implementation of 'ap'-instruction.
 1661   768  ; when using this procedure it is possible to connect and disconnect 
 1662   768  ; cpu's during normal operation only by increase and decrease b82.
 1663   768  ;
 1664   768  ;       call          return
 1665   768  ;  w0    -            destroyed
 1666   768  ;  w1   internal      internal
 1667   768  ;  w2    -            destroyed
 1668   768  ;  w3   link          destroyed
 1669   768  ;
 1670   768  ;  return:  link + 0: no free pu
 1671   768  ;           link + 2: internal has been activated
 1672   768  ;
 1673   768  
 1673   768  b.  i5,  j5  w.
 1674   768  
 1674   768  d4:                       ; procedure activate_process(internal)
 1675   768       rl  w2    (b59)      ; begin
 1676   770       rl  w0  x2+0         ;
 1677   772       sh  w0     0         ;   if pu_table.free_pu = 0 then
 1678   774       jl      x3+0         ;      return(link);
 1679   776                            ;
 1680   776       rs. w3     i3.       ;
 1681   778       rl  w3  x1+a186      ;
 1682   780       am      x3           ;
 1683   782       rl  w0  x2+2         ;
 1684   784       ls  w3    -1         ;   if internal.last_pu < no_of_pu and
 1685   786       sl  w3    (b82)      ;      pu_table(internal.last_pu) = 0 then
 1686   788       jl.        j1.       ;   begin
 1687   790       ls  w3    +1         ;
 1688   792       sn  w0     0         ;     selected_pu := internal.last_pu;
 1689   794       jl.        j3.       ;   end
 1690   796  j1:                       ;   else
 1691   796       rl  w3     b82       ;   begin
 1692   798       ls  w3    +1         ;     selected_pu := no_of_pu;
 1693   800  j2:  am      x3           ;     while pu_table(selected_pu) <> 0 do
 1694   802       rl  w0  x2           ;     begin
 1695   804       al  w3  x3-2         ;       selected_pu := selected_pu - 1;
 1696   806       se  w0     0         ;
 1697   808       jl.        j2.       ;     end;
 1698   810  j3:                       ;   end;
 1699   810       al  w0    -1         ;
 1700   812       wa  w0  x2+0         ;   pu_table.free_pu :=
 1701   814       rs  w0  x2+0         ;   pu_table.free_pu - 1;
 1702   816       am      x3           ;
 1703   818       rs  w1  x2+2         ;   pu_table(selected_pu) := internal;
 1704   820       rl. w3     i3.       ;
 1705   822       jl      x3+2         ;   return(link+2);
 1706   824                            ;
 1707   824  i3:  0                    ; saved link
 1708   826  
 1708   826  e.                        ; end;
 1709   826  
 1709   826  ; elementary link-procedures:
 1710   826  
 1710   826  ; procedure remove(elem);
 1711   826  ; comment: removes a given element from its queue and leaves the element linked to itself.
 1712   826  ; call: w2=elem, w3=link
 1713   826  ; exit: w0, w1, w2=unchanged, w3=next(elem)
 1714   826  ; return address: link
 1715   826  
 1715   826  b. i1 w.
 1716   826  
 1716   826  d5:  rs  w3     i0     ;    save return;
 1717   828       rl  w3  x2        ;    w3 := next(elem);
 1718   830       rx  w2  x2+2      ;    w2 := prev(elem);  prev(elem) := elem;
 1719   832       rs  w3  x2        ;    next(w2) := next(elem);
 1720   834       rx  w2  x3+2      ;    w2 := elem;  prev(next(elem)) := old prev(elem);
 1721   836       rs  w2  x2        ;    next(elem) := elem;
 1722   838       jl        (i0)    ;    return;
 1723   840  
 1723   840  ; procedure increase bufclaim, remove release buf;
 1724   840  ; comment: bufclaim(cur) is increased, continue with release buf
 1725   840  ; call: w1=cur, w2=buf, w3=link
 1726   840  ; exit: w0, w1=undef, w2, w3=unchanged
 1727   840  ; return address: link
 1728   840  
 1728   840  d109:                  ;
 1729   840       al  w0     1      ;
 1730   842       ba  w0  x1+a19    ;    increase(bufclaim(cur));
 1731   844       hs  w0  x1+a19    ;
 1732   846  ; continue with d106
 1733   846  
 1733   846  ; procedure remove release buf;
 1734   846  ; comment: removes the buffer from its queue, continue with release mess buf
 1735   846  ; call: w2=buf, w3=link
 1736   846  ; exit: w0, w2, w3=unchanged, w1=undef
 1737   846  ; return address: link
 1738   846  
 1738   846  d106:                  ;
 1739   846       al  w1  x3        ;    save return
 1740   848       jl  w3     d5     ;    remove (buf);
 1741   850       al  w3  x1        ;    restore return;
 1742   852  ; continue with d13
 1743   852  
 1743   852  ; procedure release mess buf(buf);
 1744   852  ; comment: clears sender and receiver and links the buffer to the pool.
 1745   852  ; call: w2=buf, w3=link
 1746   852  ; exit: w0=unchanged, w1=undef, w2, w3=unchanged
 1747   852  ; return address: link
 1748   852  
 1748   852  d13: al  w1     0      ;    sender(buf):=0;
 1749   854       rs  w1  x2+4      ;    receiver(buf):=0;
 1750   856       rs  w1  x2+6      ;    
 1751   858       al  w1     b8    ;    head := mess buf pool head; (i.e. link in rear);
 1752   860  
 1752   860  ; procedure link(head, elem);
 1753   860  ; comment: links the element to the end of the queue
 1754   860  ; call: w1=head, w2=elem, w3=link
 1755   860  ; exit: w0, w1, w2=unchanged, w3=old last(head);
 1756   860  
 1756   860  d6:  rs  w3     i0     ;    save return;
 1757   862       rl  w3  x1+2      ;    old last:=last(head);
 1758   864       rs  w2  x1+2      ;    last(head):=elem;
 1759   866       rs  w2  x3+0      ;    next(old last):=elem;
 1760   868       rs  w1  x2+0      ;    next(elem):=head;
 1761   870       rs  w3  x2+2      ;    last(elem):=old last;
 1762   872       jl        (i0)    ;    return;
 1763   874  i0: 0                  ; saved return: remove, link
 1764   876  e.
 1765   876  
 1765   876  ; ****** stepping stones for absolute addresseable monitor routines ******
 1766   876  ;
 1767   876  
 1767   876  ; procedure claim buffer(cur, buffer);  <* d108 *>
 1768   876  ;
 1769   876  ;        call          return
 1770   876  ;  w0    -             destroyed
 1771   876  ;  w1    cur           cur
 1772   876  ;  w2    buffer        buffer
 1773   876  ;  w3    link          link
 1774   876  ;
 1775   876  
 1775   876  d108: jl.       (+2)    ; claim buffer
 1776   878                    d58   ;
 1777   880  
 1777   880  
 1777   880  ; procedure regretted message(buffer);  <* d75 *>
 1778   880  ;
 1779   880  ;        call          return
 1780   880  ;
 1781   880  ;  w0    -             unchanged
 1782   880  ;  w1    -             unchanged
 1783   880  ;  w2    buffer        buffer
 1784   880  ;  w3    link          destroyed
 1785   880  ;
 1786   880  
 1786   880  d75:  jl.       (+2)    ; regretted message
 1787   882                    d65   ;
 1788   884  
 1788   884  
 1788   884  ; procedure check mess area and name (save w3) area;
 1789   884  ; procedure check name (save w3) area;
 1790   884  ; procedure check name (save w2) area;
 1791   884  ; comment: checks that the areas are within the process
 1792   884  ;
 1793   884  ; call: w1=cur,  w3=link
 1794   884  ; exit: w0=undef, w1=unchanged, w2=name, w3=unchanged
 1795   884  ; return addr: link: within process
 1796   884  ;              c29 : not within process
 1797   884  
 1797   884  d110: jl.      (+2)     ; check message area and name area:
 1798   886                   d66    ;
 1799   888  d17:  jl.      (+2)     ; check name (save w3) area:
 1800   890                   d67    ;
 1801   892  d111: jl.      (+2)     ; check name (save w2) area:
 1802   894                   d115   ;
 1803   896  
 1803   896  ; procedure check within(first, last);
 1804   896  ; comment: checks that the specified area is within the process
 1805   896  ;        call          return
 1806   896  ;  w0    last          last
 1807   896  ;  w1    cur           cur
 1808   896  ;  w2    first         first
 1809   896  ;  w3    link          link
 1810   896  ;  return: link: within process
 1811   896  ;          c29 : not within process
 1812   896  
 1812   896  d112: jl.      (+2)     ; check within:
 1813   898                   d116   ;
 1814   900  
 1814   900  
 1814   900  ; procedure check message area and buf
 1815   900  ;        call          return
 1816   900  ;  w0    -             destroyed
 1817   900  ;  w1    cur           cur
 1818   900  ;  w2    -             buf
 1819   900  ;  w3    link          link
 1820   900  ;  return:  link: ok
 1821   900  ;           c29 : mess area outside cur
 1822   900  ;           c29 : buf not message buf
 1823   900  
 1823   900  d103: jl.      (+2)     ; check message area and buf
 1824   902                   d117   ;
 1825   904  
 1825   904  
 1825   904  ; procedure check message buffer;
 1826   904  ; checks whether the save w2 of the internal process is a message buffer address
 1827   904  ;        call          return
 1828   904  ;  w0    -             destroyed
 1829   904  ;  w1    cur           cur
 1830   904  ;  w2    -             buf
 1831   904  ;  w3    link          link
 1832   904  
 1832   904  d12: jl.       (+2)     ; check message buffer:
 1833   906                   d68    ;
 1834   908  
 1834   908  
 1834   908  ; procedure check event(proc, buf);
 1835   908  ; checks that buf is the address of an operation in the event queue of 
 1836   908  ; the internal process
 1837   908  ;        call          return
 1838   908  ;  w0    -             destroyed
 1839   908  ;  w1    proc          proc
 1840   908  ;  w2    buf           buf
 1841   908  ;  w3    link          link
 1842   908  ;  return: link: buffer address ok
 1843   908  ;          c29:  buf is not in the queue
 1844   908  
 1844   908  d19: jl.      (+2)      ; check event:
 1845   910                  d69     ;
 1846   912  ; procedure conditional reschedule
 1847   912  ; procedure unconditional reschedule
 1848   912  ; If the 'conditional' entrypoint is used, the internal process is 
 1849   912  ; rescheduled if 'no of free pu' in the pu-table is 0 otherwise no
 1850   912  ; rescheduling is performed. This test is done because there is no
 1851   912  ; need for rescheduling if ther is an idle pu; if done the process
 1852   912  ; may change pu and the cache will be destroyed.
 1853   912  ;         call              return
 1854   912  ; w0      -                 destroyed
 1855   912  ; w1      internal          internal
 1856   912  ; w2      -                 destroyed
 1857   912  ; w3      link              destroyed
 1858   912  ;
 1859   912  
 1859   912  d20:  jl.      (+2)      ; conditional reschedule
 1860   914                   d40     ;
 1861   916  
 1861   916  d21:  jl.      (+2)      ; unconditional reschedule
 1862   918                   d41     ;
 1863   920  
 1863   920  
 1863   920  
 1863   920  ; procedure check and search name (=d17+d11);
 1864   920  ;
 1865   920  ; call: w1=cur, save w3(cur)=name, w3=link
 1866   920  ; exit: w0, w1=unchanged, w2=name, w3=entry
 1867   920  ; return address: link: entry not found
 1868   920  ;                 link+2: entry found
 1869   920  ;                 c29 : name area outside current process
 1870   920  d101:jl.      (+2)      ; check and search name;
 1871   922                  d43     ;
 1872   924  
 1872   924  ; the following procedures searches the name table for a given entry and delivers its entry in
 1873   924  ; the name table. if name is undefined, the entry is name table end.
 1874   924  
 1874   924  ; procedure search name(name, entry);
 1875   924  ; call: w2=name, w3=link
 1876   924  ; exit: w0, w1, w2=unchanged, w3=entry
 1877   924  ; return address: link  : name not found, w3=(b7)
 1878   924  ;                 link+2: name found
 1879   924  d11: jl.      (+2)      ; search name;
 1880   926                  d44     ;
 1881   928  
 1881   928  ; procedure search name(name, entry, base);
 1882   928  ; call: w0, w1=base, w2=name, w3=link
 1883   928  ; exit: w0, w1=undef, w2=unchanged, w3=entry
 1884   928  ; return address: link  : name not found, w3=(b7)
 1885   928  ;                 link  : name found, w3 <> (b7)
 1886   928  d71: jl.      (+2)      ; search name;
 1887   930                  d45     ;
 1888   932  
 1888   932       a107              ; max base lower
 1889   934  d72: a108              ; max base upper
 1890   936       a107-1            ; extreme lower
 1891   938  d73: a108+1            ; extreme upper
 1892   940  
 1892   940  
 1892   940   
 1892   940  
 1892   940  ; procedure update time(slice);
 1893   940  ; comment: senses the timer and updates current time slice and time;
 1894   940  ;
 1895   940  ; call: w3=link
 1896   940  ; exit: w0=undef, w1=unchanged, w2=new clock, w3=unchanged
 1897   940  ; return address: link
 1898   940  
 1898   940  b. i9, j4 w.
 1899   940  d7:  gg  w2     b94    ;
 1900   942       al  w0     0      ;
 1901   944  b. h1 w.               ;  if mp then
 1902   944       am        (b9)   ;
 1903   946  h0=k
 1904   946       jl.       0       ;  begin
 1905   948       gg  w0     b108   ; get pu index
 1906   950  c.(:h0+a8-k-1:)
 1907   950       am  0, r.(: h0+a8+2-k :)>1 ;  fill up
 1908   950  z.
 1909   950  e.                     ;  end mp
 1910   950       sn  w0     0      ; if not i-o pu or cpu then
 1911   952       jl.        i6.    ;  begin
 1912   954       rl. w0     i9.    ;    rct(i-o mp) := undefined
 1913   956       rs  w0    (b38)   ;    get clock from i-0 mp
 1914   958       al  w0     a194   ;    wait until rct(i-o mp) defined
 1915   960       do  w0    (b74)   ;
 1916   962  j4:  rl  w2    (b38)   ;
 1917   964       sn. w2    (i9.)   ;   
 1918   966       jl.        j4.    ; end
 1919   968  i6:
 1920   968  
 1920   968       al  w0  x2        ;    new value:=sense(timer);
 1921   970       ws  w2     b14    ;    increase:=new value-clock;
 1922   972       rs  w0     b14    ;    clock:=new value;
 1923   974       sh  w2    -1      ;    if increase<0 then
 1924   976       wa  w2     i9     ;      increase:=increase+size of clock;
 1925   978                         ;      comment: timer overflowed...;
 1926   978       rx  w0     4      ;
 1927   980  
 1927   980       wa  w0     b13+2  ;
 1928   982       rs  w0     b13+2  ;    time low:=time low+increase;
 1929   984       sx         2.01   ;
 1930   986       jl         i8     ;    if carry then
 1931   988       jl      x3        ;
 1932   990  
 1932   990  i8:  al  w0     1      ;      time high:=time high+1;
 1933   992       wa  w0     b13    ;
 1934   994       rs  w0     b13    ;
 1935   996       jl      x3        ;    return;
 1936   998  i9:  1<16              ; increase when timer overflows;
 1937  1000  
 1937  1000  
 1937  1000  ;procedure activate process
 1938  1000  ;comment: unlinks the first proc in running queue, increases stopcount
 1939  1000  ;         and  sets the state to running,
 1940  1000  ;      call:      return:
 1941  1000  ; w0:             undefined
 1942  1000  ; w1:             proc
 1943  1000  ; w2:             proc+a16 (running queue link)
 1944  1000  ; w3: link        undefined
 1945  1000  d8:  rs  w3     j0     ; save return;
 1946  1002  
 1946  1002       rl  w2     b2     ; get first in running queue
 1947  1004       al  w1  x2-a16    ; w1:= proc
 1948  1006       al  w0     1      ; proc.stopcount:= 
 1949  1008       ba  w0  x1+a12    ;     proc.stopcount + 1
 1950  1010       hs  w0  x1+a12    ;
 1951  1012       al  w0     a94    ; proc.state:= running
 1952  1014       hs  w0  x1+a13    ;
 1953  1016       jl  w3     d7     ; update time;
 1954  1018       al  w0  x2        ;
 1955  1020       al  w2  x1+a16    ;
 1956  1022       ws  w0  x1+a35    ; proc.quantum := starttime
 1957  1024       rs  w0  x1+a35    ;
 1958  1026       rl  w3  x2        ; unlink proc
 1959  1028       rx  w2  x2+2      ;
 1960  1030       rs  w3  x2        ;
 1961  1032       rx  w2  x3+2      ;
 1962  1034       rs  w2  x2        ;
 1963  1036       jl        (j0)    ; return
 1964  1038  
 1964  1038  
 1964  1038  ; the following entries removes the current process from the timequeue, and initializes state.
 1965  1038  ; call: w1=cur
 1966  1038  ; return address: interrupt return
 1967  1038  
 1967  1038  d105:                  ; remove wait message:
 1968  1038  ;    bz  w0  x1+a19    ;
 1969  1038  ;    sn  w0     0      ;    if buf claim(cur)=0 then
 1970  1038  ;    jl         d108   ;      goto claim buffer (and exit with save w2=0);
 1971  1038       am         a102-a104 ; state:=wait message;
 1972  1040  d107:                  ; remove wait event:
 1973  1040       am         a104-a103 ; state:=wait event;
 1974  1042  d104:                  ; remove wait answer:
 1975  1042       al  w0     a103   ;    state:=wait answer;
 1976  1044       al  w3     c99    ;    return:=interrupt return;
 1977  1046  ; continue with remove internal;
 1978  1046  
 1978  1046  ; procedure passivate process (new state)
 1979  1046  ; passivates the current process i.e
 1980  1046  ;     - decreases stopcount (eventually stopping the process)
 1981  1046  ;     - updates the time quantum used by the process
 1982  1046  ;     - sets the state to new state if the process has not been stopped
 1983  1046  ;
 1984  1046  ;       call         return
 1985  1046  
 1985  1046  ;w0   new state      process state
 1986  1046  ;w1   proc           undefined
 1987  1046  ;w2                  proc.timeq (proc +a16)
 1988  1046  ;w3   link           undefined
 1989  1046  
 1989  1046  
 1989  1046  d9:  
 1990  1046       ds  w0     j1     ; save state , return, and proc
 1991  1048       rs  w1     j2     ;
 1992  1050       jl  w3     d7     ; update time
 1993  1052       sh  w2 (x1+a35)   ; if stoptime > starttime then
 1994  1054       wa. w2     i9.    ;    stoptime := stoptime + size of clock
 1995  1056       ws  w2  x1+a35    ; proc.quantum:= stoptime-starttime     
 1996  1058       rs  w2  x1+a35    ;
 1997  1060       dl  w3  b13+2     ; proc.start wait:= now
 1998  1062       ds  w3  x1+a39+2  ;
 1999  1064       jl  w3  d133      ; test and decrease stopcount
 2000  1066       al  w0     0      ; rescedule count := 0
 2001  1068       al  w1     0      ; 
 2002  1070  b. h1 w.               ;
 2003  1070       am     (b9)       ;
 2004  1072  h0=k                   ;
 2005  1072       jl.        0      ;
 2006  1074       gg  w1     b108   ;
 2007  1076  c. (:h0+a8-k-1:)       ;
 2008  1076       am 0, r.(:h0+a8+2-k:)>1;
 2009  1076  z.                     ;
 2010  1076  e.                     ;
 2011  1076       rs  w0  x1+b83    ;
 2012  1078       rl  w1  j2        ; if proc.state still is running then
 2013  1080       zl  w0  x1+a13    ;
 2014  1082       sn  w0     a94    ;
 2015  1084       rl  w0     j1     ; proc.state:= new state
 2016  1086       hs  w0  x1+a13    ;
 2017  1088       al  w2  x1+a16    ;
 2018  1090  b. h1 w.               ;  if mp then
 2019  1090       am        (b9)    ;
 2020  1092  h0=k
 2021  1092       jl.       0       ;  begin
 2022  1094       dp                ;   deactivate process;
 2023  1096  c.(:h0+a8-k-1:)
 2024  1096       am  0, r.(: h0+a8+2-k :)>1 ;  fill up
 2025  1096  z.
 2026  1096  e.                     ;  end mp
 2027  1096       jl        (j0)    ;
 2028  1098  
 2028  1098  j0: 0                  ; return
 2029  1100  j1: 0                  ; new state
 2030  1102  j2: 0                  ; current process
 2031  1104  
 2031  1104                         ;    return;
 2032  1104  
 2032  1104  i0:  0                 ; saved return
 2033  1106  
 2033  1106  ; procedure link internal(proc);
 2034  1106  ; comment: links the internal process to the timer queue. the timer queue is kept as a
 2035  1106  ;          sorted list, according to the priority. (the smaller the priority is, the better
 2036  1106  ;          is the priority).
 2037  1106  ;          if the time quantum is less than the maximum time slice, the process will be
 2038  1106  ;          linked up in front of other processes with the same priority. otherwise in the
 2039  1106  ;          rear (the time quamtum of the process is transferred to runtime(proc), except
 2040  1106  ;          the amount which is already used of the next quantum).
 2041  1106  ; call: w1=proc, w3=link
 2042  1106  ; exit: w0, w1, w2, w3=undef
 2043  1106  
 2043  1106  d10: rs  w3     i0     ;    save(return);
 2044  1108       al  w0     a95    ;  
 2045  1110       hs  w0  x1+a13    ;    state(proc):=waiting for cpu;
 2046  1112  
 2046  1112       al  w2  x1+a16    ;
 2047  1114       rl  w3  x1+a301   ;    priority:=priority(proc);
 2048  1116       rl  w1  x1+a35    ;
 2049  1118       sl  w1    (b10)   ;    if quantum(proc)>=max slice then
 2050  1120       jl         i3     ;      goto insert in rear;
 2051  1122  
 2051  1122       al  w3  x3-1      ;    (code facility);
 2052  1124       al  w1     b2     ;    worse:=timer q head;
 2053  1126  i1:  rl  w1  x1        ; next: worse:=next(worse);
 2054  1128       sn  w1     b2     ; until last
 2055  1130       jl         i2     ;
 2056  1132       sl  w3 (x1-a16+a301) ; if priority(worse)<priority then
 2057  1134       jl         i1     ;    goto next;
 2058  1136  i2:                    ; insert process:
 2059  1136       rl  w3  x1+2      ;
 2060  1138       rs  w2  x1+2      ;
 2061  1140       rs  w2  x3+0      ;
 2062  1142       rs  w1  x2+0      ;
 2063  1144       rs  w3  x2+2      ;
 2064  1146       jl        (i0)    ;      internal then return;
 2065  1148  
 2065  1148  ; the process has been in front of the queue for more than the max time slice.
 2066  1148  ; the run time should be updated with all the quantum, but this would give the process a
 2067  1148  ; complete time slice next time. instead the used quantum is split in two parts:
 2068  1148  ; the amount by which it exceeds a multiplum of the max slice, and the rest. these parts
 2069  1148  ; are the increase in runtime and the new quantum.
 2070  1148  ; finally the process is inserted in the rear of the timer queue, according to priority.
 2071  1148  
 2071  1148  i3:  al  w0     a85-1  ;    w0 := mask for extracting new quantum;
 2072  1150       la  w0     2      ;    quantum(proc) := quantum(proc) extract slice;
 2073  1152       rs  w0  x2-a16+a35;
 2074  1154       ws  w1     0      ;
 2075  1156       al  w0     0      ;
 2076  1158       aa  w1  x2-a16+a36+2;  add the remaining part of quantum to
 2077  1160       ds  w1  x2-a16+a36+2;     runtime(proc);
 2078  1162       al  w1     b2     ; insert process in rear of queue
 2079  1164  
 2079  1164       al  w3  x3+1      ;    (code facility)
 2080  1166  i4:  rl  w1  x1+2      ; next: worse:=last(worse);
 2081  1168       sn  w1     b2     ;    if worse<>timer q head and
 2082  1170       jl         i5     ;
 2083  1172       sh  w3 (x1-a16+a301) ;   priority(worse)>priority then
 2084  1174       jl         i4     ;    goto next;
 2085  1176  
 2085  1176  ; notice: the loop went one step to far . . .;
 2086  1176  i5:  rl  w1  x1        ;    now w1 has been repaired;     
 2087  1178       jl         i2     ;    goto insert proc;
 2088  1180  e.
 2089  1180  \f


 2089  1180  m.
 2089  1180                         end of link internal

 2090  1180  ; to facilitate the error recovery the interrupt stack and the 
 2091  1180  ; stationary pointers of the monitor table are placed at fixed
 2092  1180  ; addresses. 
 2093  1180  
 2093  1180  b128=1200, 0,r.(:b128-k+2:)>1-7
 2094  1186  a125        ;  job host identification
 2095  1188  a130        ;  date of options
 2096  1190  a131        ;  time of options
 2097  1192  t.
 2097  1192* type 

 2098  1192  
 2098  1192  
 2098  1192  m.
 2098  1192   jobhost name

 2099  1192      <:balsu2:>, 0, 0
 2100  1200  n.
 2101  1200  
 2101  1200  m.
 2101  1200                  copies of some mon table entries, int stack, mon reg dump (26, 32, 26 hw)

 2102  1200  
 2102  1200  ; copy of some monitor pointers:
 2103  1200  
 2103  1200       0-0-0             ; b3:   72: name table start
 2104  1202       0-0-0             ; b4:   74: first device in name table
 2105  1204       0-0-0             ; b5:   76: first area in name table
 2106  1206       0-0-0             ; b6:   78: first internal in name table
 2107  1208       0-0-0             ; b7:   80: name table end
 2108  1210       0-0-0             ; b8+4: 86: first byte of mess buf pool area
 2109  1212       0-0-0             ; b8+6: 88: last byte  of mess buf pool area
 2110  1214       0-0-0             ; b22:  92: first drum chain  in name table
 2111  1216       0-0-0             ; b23:  94: first disc chain  in name table
 2112  1218       0-0-0             ; b24:  96: chain end         in name table
 2113  1220       b50               ;           start of interrupt stack
 2114  1222       0-0-0             ; b86:      driver proc save area
 2115  1224       a135<12+a136      ;       64: release, version of monitor
 2116  1226       0-0-0             ; b59:  56: pu inf table
 2117  1228       0-0-0             ; b79: 124: interrupt stat table
 2118  1230       0-0-0             ; b81: 126: monitor call stat table
 2119  1232       0-0-0             ;           reserved
 2120  1234       0-0-0             ;           reserved
 2121  1236       0-0-0             ;           reserved
 2122  1238  
 2122  1238  ; definition of interrupt stack:
 2123  1238  
 2123  1238  b50: 0                 ; end of stack
 2124  1240  b49=k-1                ; terminating stack-address
 2125  1240  
 2125  1240  ; power fail element:
 2126  1240       0                 ;    (irrellevant regdump)
 2127  1242       0                 ;    (exception disabled)
 2128  1244       -1                ;    (escape disabled)
 2129  1246       0                 ;    (monitor call not permitted in monitor)
 2130  1248       c8                ;    external interrupt, second level
 2131  1250       1 < 23 + 0        ;    monitor mode + totally disabled
 2132  1252  
 2132  1252  ; monitor element:
 2133  1252       b52               ;    monitor regdump
 2134  1254       0                 ;    monitor exception routine
 2135  1256  b51: -1                ;     current process in monitor (escape not used in monitor mode
 2136  1258       c0                ;    monitor call entry
 2137  1260       c1                ;    external interrupt entry, first level
 2138  1262       1 < 23 + 6        ;    monitor mode + disable all but power/bus error
 2139  1264  
 2139  1264  ; user element:
 2140  1264       0-0-0             ;    user regdump (initialized by select internal)
 2141  1266       0-0-0             ;    user exception (   -      -    -        -   )
 2142  1268       0-0-0             ;    user escape  (     -      -    -        -   )
 2143  1270  
 2143  1270  ; monitor regdump area
 2144  1270  ;
 2145  1270  ; used when initializing the whole system,
 2146  1270  ;    and to hold the working registers etc. in case of
 2147  1270  ;    powerfailure or buserror during monitor code
 2148  1270  
 2148  1270  b52: 0                 ; w0 = 0 (irrellevant)
 2149  1272       0                 ; w1 = 0 (irrellevant)
 2150  1274       0                 ; w2 = 0 (irrellevant)
 2151  1276       0                 ; w3 = 0 (irrellevant)
 2152  1278       1 < 23+1<5    ; status = monitor mode + no process active
 2153  1280       c99               ; ic = interrupt return
 2154  1282       0                 ; cause = 0 (irrellvant)
 2155  1284       0                 ; sb = 0 (irrellvant)
 2156  1286  
 2156  1286       0                 ; cpa = 0 (irrellevant)
 2157  1288       0                 ; base = 0 (irrellevant)
 2158  1290       8                 ; lower write limit
 2159  1292       8.3777 7777       ; upper write limit = all possible core
 2160  1294       0 < 12 + 6        ; interrupt limits
 2161  1296       0                 ; puindex
 2162  1298  
 2162  1298  
 2162  1298  ; procedure move message(from, to);  <* d14 *>
 2163  1298  ;
 2164  1298  ;        call          return
 2165  1298  ;  w0    -             destroyed
 2166  1298  ;  w1    from          from
 2167  1298  ;  w2    to            to
 2168  1298  ;  w3    link          destroyed
 2169  1298  ;
 2170  1298  
 2170  1298  d14:  jl.      (+2)     ; move message
 2171  1300                   d64    ;
 2172  1302  
 2172  1302  ; return result in save w0(cur);
 2173  1302  ; entry: w1=cur
 2174  1302  r5:  am         5-4    ;
 2175  1304  r4:  am         4-3    ;
 2176  1306  r3:  am         3-2    ;
 2177  1308  r2:  am         2-1    ;
 2178  1310  r1:  am         1-0    ;
 2179  1312  r0:  al  w0     0      ;
 2180  1314  r28: rs  w0  x1+a28    ;    save w0:=result;
 2181  1316       jl         c99    ;    goto interrupt return;
 2182  1318  
 2182  1318  
 2182  1318  ; procedure remove user(internal, proc);      <* d123 *>
 2183  1318  ; procedure remove reserver(internal, proc);  <* d124 *>
 2184  1318  ;
 2185  1318  ;        call          return
 2186  1318  ;  w0    -             destroyed
 2187  1318  ;  w1    internal      internal
 2188  1318  ;  w2    proc          proc
 2189  1318  ;  w3    link          link
 2190  1318  ;
 2191  1318  
 2191  1318  d123: jl.      (+2)     ; remove user
 2192  1320                   d53    ;
 2193  1322                          ;
 2194  1322  d124: jl.      (+2)     ; remove reserver
 2195  1324                   d54    ;
 2196  1326  
 2196  1326  
 2196  1326  ; procedure insert reserver(internal, proc);  <* d125 *>
 2197  1326  ; procedure insert user(internal, proc);      <* d126 *>
 2198  1326  ;
 2199  1326  ;        call          return
 2200  1326  ;  w0    -             destroyed
 2201  1326  ;  w1    internal      internal
 2202  1326  ;  w2    proc          proc
 2203  1326  ;  w3    link          link
 2204  1326  ;
 2205  1326  
 2205  1326  d125: jl.      (+2)     ; insert reserver
 2206  1328                   d55    ;
 2207  1330                          ;
 2208  1330  d126: jl.      (+2)     ; insert user
 2209  1332                   d56    ;
 2210  1334  
 2210  1334  
 2210  1334  ; procedure lock monitor
 2211  1334  ; returns disabled!
 2212  1334  
 2212  1334  b. h0  w.
 2213  1334  d80:                 ;
 2214  1334       am       (b9)   ; if mp then 
 2215  1336  h0=k                 ;
 2216  1336       je.       0     ; (lock must be called with interrupts enabled)
 2217  1338       lk      b51     ; lock(monitor);
 2218  1340  c.(:h0+a8-k-1:)
 2219  1340       am        0     ;
 2220  1340  r.(:h0+a8+2-k:)>1    ;
 2221  1340  z.
 2222  1340  
 2222  1340       jd    x3        ; return disabled
 2223  1342  
 2223  1342  
 2223  1342  ; procedure unlock
 2224  1342  ; returns enabled
 2225  1342  
 2225  1342  d81:                 ;
 2226  1342       am      (b9)    ; if mp then
 2227  1344  h0=k                 ;
 2228  1344       jl.      0      ;
 2229  1346       ul      b51     ; unlock(monitor)
 2230  1348  c.(:h0+a8-k-1:)
 2231  1348       am       0
 2232  1348  r.(:h0+a8+2-k:)>1
 2233  1348  z.
 2234  1348       je     x3       ; returns enabled
 2235  1350  e.
 2236  1350  \f


 2236  1350  
 2236  1350  
 2236  1350  
 2236  1350  ; comment: the following utility procedures are used by external
 2237  1350  ; processes during input/output;
 2238  1350  
 2238  1350  ; procedure deliver result(result)
 2239  1350  ; comment: moves the general input/output answer to the beginning of the driver process.
 2240  1350  ;          (the last 3 words of the message buffer are copied too, so they will remain unchanged).
 2241  1350  ;          the answer is send with the specified result to the sender of the buffer.
 2242  1350  ;
 2243  1350  ; call: w0 = result, w3 = link, b18 = buffer
 2244  1350  ; exit: w0 = undef, w1 = proc (= b19), w2 = undef, w3= unchanged
 2245  1350  ; return address: link: answer delivered
 2246  1350  ;            (internal 3 if buf not claimed and claims exceeded)
 2247  1350  
 2247  1350  b. i10 w.
 2248  1350  g3:  am         5-4    ; result 5:
 2249  1352  g4:  am         4-3    ; result 4:
 2250  1354  g5:  am         3-2    ; result 3:
 2251  1356  g6:  am         2-1    ; result 2:
 2252  1358  g7:  al  w0     1      ; result 1: w0 := result;
 2253  1360       rl  w3     b20    ;    return := wait-next action in driver process;
 2254  1362       jl         g19    ;    goto deliver result;
 2255  1364  g18: al  w0     1      ; result 1: w0 := result;
 2256  1366  
 2256  1366  g19:                   ; deliver result:
 2257  1366       jd         k+2    ;    disable;
 2258  1368       ds  w0     i3     ;    save(link, result);
 2259  1370  
 2259  1370       rl  w1     b21     ; cur = driverproc
 2260  1372       rl  w2     b18    ;    buf := current buffer;
 2261  1374       ac  w3 (x2+4)     ;
 2262  1376       sl  w3     0      ;    if receiver(buf) > 0 then
 2263  1378       jl         i0     ;      begin comment: buf not claimed, see link operation;
 2264  1380       bz  w0  x1+a19    ;      if bufclaim(cur) <> 0 then
 2265  1382       sn  w0     0      ;        begin
 2266  1384       jl         i0     ;        decrease(bufclaim(cur));
 2267  1386       bs. w0     1      ;        receiver(buf) := -receiver(buf);
 2268  1388       hs  w0  x1+a19    ;        end; (i.e. claims exceeded will provoke a break below);
 2269  1390       rs  w3  x2+4      ;      end;
 2270  1392  i0:  rl  w0  x1+a182   ;
 2271  1394       rl  w1  x1+a302   ;
 2272  1396       wa  w1  0         ; get physical address of save area
 2273  1398       dl  w0  x2+a151   ; save first four words of mess.
 2274  1400       ds  w0  g29       ; (used by errorlog )
 2275  1402       dl  w0  x2+a153   ; 
 2276  1404       ds  w0  g30       ;
 2277  1406  
 2277  1406       dl  w0  x2+22     ;    move last 3 words from buf
 2278  1408       ds  w0  x1+14     ;      to area;
 2279  1410       rl  w0  x2+18     ;      (to retain compatibility with old conventions)
 2280  1412       rl  w3     g24    ;
 2281  1414       ds  w0  x1+10     ;    move the 5 std answer words
 2282  1416       dl  w0     g23    ;      to area;
 2283  1418       ds  w0  x1+6      ;
 2284  1420       dl  w0     g21    ;
 2285  1422       ds  w0  x1+2      ;    (you are disabled, so do not worry about timeslicing...);
 2286  1424  
 2286  1424       dl  w0     i3     ;    restore (link, result);
 2287  1426       am      (b21)     ;
 2288  1428       rl  w1  +a302     ; get logical address of save area
 2289  1430       jd         1<11+22;    send answer(result, area, buf);
 2290  1432  
 2290  1432       rl  w1     b19    ;    w1 := current receiver;
 2291  1434       rl  w2  x1        ; if kind of receiver=subprocess then
 2292  1436       se  w2  84        ; check status
 2293  1438       sn  w2  85        ; else return
 2294  1440       jl.     i1.       ;
 2295  1442       jd      x3        ;
 2296  1444  
 2296  1444  i1:  rl  w2  g20       ; if one or more of statusbits 1,2,4,9,10,11
 2297  1446       se. w1  (b32.)     ; or  if receiver = special watched receiver
 2298  1448       sz. w2  (i5.)     ;  then 
 2299  1450       jl  w2  (b31)     ; call errorlog
 2300  1452       jd      x3        ; restore link and return
 2301  1454  
 2301  1454  i2:  0                 ; saved link
 2302  1456  i3:  0                 ; saved result
 2303  1458  b32: -2                 ; proc adr for special watched receiver
 2304  1460  m.
 2304  1460                  statusmask for errorlog

 2305  1460  i5:  8.36070000        ; status mask: bit 1 2 3 4 9 10 11
 2306  1462  
 2306  1462  ; procedure link operation (buf)
 2307  1462  ; comment: links a message to the receiver and returns to the receiver, in case it is the only
 2308  1462  ;           message in the queue (and interrupt address is even).
 2309  1462  ;           otherwise it returns to the wait-next action in the driver process.
 2310  1462  ;
 2311  1462  ; call: w2 = buf, w3 = link
 2312  1462  ; exit: w0 = operation, w1 = proc, w2 = unchanged, w3 = unchanged
 2313  1462  ; return address: link: single in queue
 2314  1462  ;                (b20): others in queue
 2315  1462  ;                (b20): interrupt addr odd (i.e. driver busy)
 2316  1462  
 2316  1462  g17: jd         k+2    ; link operation:
 2317  1464       rs  w3     i3     ;    save return;
 2318  1466       ac  w3 (x2+4)     ;
 2319  1468       sh  w3     0      ;    if receiver(buf) < 0 then
 2320  1470       jl         i4     ;      begin comment: buf claimed. now release claim;
 2321  1472       rs  w3  x2+4      ;      receiver(buf) := -receiver(buf); i.e. positive;
 2322  1474       rl  w1     b21    ; cur = driverproc
 2323  1476       bz  w3  x1+a19    ;      increase(buf claim(cur));
 2324  1478       al  w3  x3+1      ;
 2325  1480       hs  w3  x1+a19    ;      end;
 2326  1482  
 2326  1482  i4:  am        (b19)   ;
 2327  1484       al  w1    +a54    ;
 2328  1486       jl  w3     d6     ;    link(mess q(proc), buf);
 2329  1488       se  w3  x1        ;    if old last <> mess q(proc) then
 2330  1490  c33: jl        (b20)   ;      goto wait next(driver process);
 2331  1492  
 2331  1492       al  w1  x1-a54    ;    w1 := proc;
 2332  1494       rl  w0  x1+a56    ;    w0 := interrupt addr(proc);
 2333  1496       so  w0     2.1    ;    if interrupt addr(proc) is odd then
 2334  1498       jl  w3     g64    ;+2    goto wait next(driver process);
 2335  1500       jl        (b20)   ;+2  examine queue: empty => goto wait next;
 2336  1502       jl        (i3)    ;    return
 2337  1504  
 2337  1504  e.
 2338  1504  
 2338  1504  
 2338  1504  ; procedure check user 
 2339  1504  ; comment: checks whether an external process is used
 2340  1504  ; by the current internal process. if the external is reserved
 2341  1504  ; it is also checked whether it is reserved by the current
 2342  1504  ; internal process.
 2343  1504  ;     call:    return:
 2344  1504  ; w0           destroyed
 2345  1504  ; w1  cur      cur
 2346  1504  ; w2  buf      buf
 2347  1504  ; w3  link     destroyed
 2348  1504  b. i5 w.
 2349  1504  g14:                   ; check user;
 2350  1504       sn  w1    (b 21)    ;  if curr.intproc=driverproc then
 2351  1506       jl      x3        ; return 
 2352  1508       ds  w3     i3     ;  save w2 w3;
 2353  1510       rl  w2     b19    ;  w2:= extproc;
 2354  1512       jl  w3     d113   ;  check reserver;
 2355  1514       jl         g6     ;  return 0   other reservers  goto result 2 else
 2356  1516       jl         i0     ;  return 2  intproc is reserver  goto nornal return else
 2357  1518                         ;  return 4 no reservers
 2358  1518       jl  w3     d102   ;  check user
 2359  1520       jl          g6    ;  if not user then result 2 else
 2360  1522  i0:
 2361  1522       rl  w2     i2     ;
 2362  1524       jl         (i3)   ; normal return;
 2363  1526  i2:  0                 ;  save w2;
 2364  1528  i3:  0                 ;  save w3;
 2365  1530  e.                    ; end
 2366  1530  
 2366  1530  ; procedure check reservation
 2367  1530  ; comment: checks whether an external process is reserved
 2368  1530  ; by the current internal process.
 2369  1530  ;      call:    return:
 2370  1530  ; w0            reserved
 2371  1530  ; w1   cur      cur
 2372  1530  ; w2   buf      buf
 2373  1530  ; w3   link     link
 2374  1530  
 2374  1530  b.i24                 ; begin
 2375  1530  w.
 2376  1530  g15:                   ;  check reserver;
 2377  1530       sn  w1    (b 21)    ;  if curr.intproc= driverproc then
 2378  1532       jl      x3        ;  return  ;
 2379  1534       am        (b19)   ;
 2380  1536       rl  w0     a52    ;  w0:=reserver.extproc;
 2381  1538       sn  w0  (x1+a14)  ;  if intproc is reserver then
 2382  1540       jl       x3       ;  normal return else
 2383  1542       jl          g6    ;  result 2;
 2384  1544  e.                    ; end
 2385  1544  
 2385  1544  ; procedure check operation(oper mask, mode mask)
 2386  1544  ; comment: checks whether the operation and mode are
 2387  1544  ; within the repertoire of the receiver. the legal values are
 2388  1544  ; defined by two bitpatterns in which bit i=1 indicates
 2389  1544  ; that operation (or mode) number i is allowed. if the
 2390  1544  ; operation is odd, it is checked whether the input/output
 2391  1544  ; area is within the internal process.
 2392  1544  ;     call:       return:
 2393  1544  ; w0  oper mask   destroyed
 2394  1544  ; w1  mode mask   destroyed
 2395  1544  ; w2  buf         buf
 2396  1544  ; w3  link        destroyed
 2397  1544  
 2397  1544  b.i24                 ; begin
 2398  1544  w.g16:rs  w3  i0      ;
 2399  1546        bz  w3  x2+9    ;
 2400  1548        ls  w1  x3+0    ;
 2401  1550        bz  w3  x2+8    ;
 2402  1552        ls  w0  x3+0    ;
 2403  1554        sh  w0  -1      ;   if mode mask(mode(buf))=0
 2404  1556        sl  w1   0      ;   or oper mask (operation(buf))=0
 2405  1558        jl      g5      ;   then goto result 3;
 2406  1560        so  w3  1       ;
 2407  1562        jl     (i0)     ;
 2408  1564        rl  w1  x2+6    ;
 2409  1566        dl  w0  x2+12   ;   if odd(operation(buf))
 2410  1568        la  w3  g50     ;   make first and
 2411  1570        la  w0  g50     ;   last address  in buf even;
 2412  1572        sl  w3 (x1+a17) ;   and (first addr(buf)<first addr(sender)
 2413  1574        sl  w0 (x1+a18) ;   or last addr(buf)>=top addr(sender)
 2414  1576        jl      g5      ;
 2415  1578        sh  w0  x3-2    ;   or first addr(buf)>last addr(buf))
 2416  1580        jl      g5      ;   then goto result 3;
 2417  1582        ds  w0  x2+12   ;   message even;
 2418  1584        jl     (i0)     ;
 2419  1586    i0: 0               ;
 2420  1588  e.                    ; end
 2421  1588  
 2421  1588  ; input/output answer:
 2422  1588  w.g20: 0  ; status
 2423  1590    g21: 0  ; bytes
 2424  1592    g22: 0  ; characters
 2425  1594    g23: 0  ; file count
 2426  1596    g24: 0  ; block count
 2427  1598  
 2427  1598    g40: 0  ; word5
 2428  1600    g41: 0  ; word6
 2429  1602    g42: 0  ; word7
 2430  1604         0  ; mess(1) operation
 2431  1606  g29:   0  ; mess(2) first
 2432  1608         0  ; mess(3) last
 2433  1610  g30:   0  ; mess(4) segment no
 2434  1612  
 2434  1612  
 2434  1612  ; procedure next operation
 2435  1612  ; comment: examines the message queue of the receiver and
 2436  1612  ; returns to the receiver if there is a message from a
 2437  1612  ; not-stopped sender. otherwise it returns to the current
 2438  1612  ; internal process.
 2439  1612  ;     call:   return:
 2440  1612  ; w0          oper
 2441  1612  ; w1          proc
 2442  1612  ; w2          buf
 2443  1612  ; w3  link    sender
 2444  1612  
 2444  1612  b.i24                   ; begin
 2445  1612  w.g25:rs  w3  i2        ;
 2446  1614        jl  w3  g64       ;   examine queue(
 2447  1616        jl      c33       ;     dummy interrupt);
 2448  1618        jl     (i2)       ;
 2449  1620    i2: 0                 ;
 2450  1622  e.                      ; end
 2451  1622  
 2451  1622  ; procedure examine queue(queue empty)
 2452  1622  ;     call:   return:
 2453  1622  ; w0          operation
 2454  1622  ; w1          proc
 2455  1622  ; w2          buf
 2456  1622  ; w3  link    sender
 2457  1622  
 2457  1622  b.i24                   ; begin
 2458  1622  w.g64:rs  w3  i2        ;
 2459  1624    i0: rl  w1  b19       ; exam q:proc:=current receiver;
 2460  1626        rl  w2  x1+a54    ;   buf:=next(mess q(proc));
 2461  1628        sn  w2  x1+a54    ;   if buf=mess q(proc)
 2462  1630        jl     (i2)       ;   then goto queue empty;
 2463  1632        rs  w2  b18       ;
 2464  1634        rl  w3  x2+6      ;   internal:=sender(buf);
 2465  1636        xl      x2+8      ;
 2466  1638        sh  w3  -1        ;
 2467  1640        ac  w3  x3+0      ;
 2468  1642        bz  w0  x3+a13    ;
 2469  1644        rl  w3  x2+6      ;   if state(internal)=stopped
 2470  1646        sx      2.1       ;   and operation(buf)(23)=1
 2471  1648        so  w0  a105      ;   or internal<0
 2472  1650        sh  w3  -1        ;   then
 2473  1652        jl      i1        ;   begin
 2474  1654        bz  w0  x2+8      ;
 2475  1656        am     (i2)       ;   no operation;
 2476  1658        jl      2         ;   goto exam q;
 2477  1660    i1: jl  w3  g26       ;   end;
 2478  1662        jl      i0        ;   oper:=byte(buf+8);
 2479  1664    i2: 0                 ;
 2480  1666  e.                      ; end
 2481  1666  
 2481  1666  ; procedure no operation
 2482  1666  ;     call:   return:
 2483  1666  ; w0          destroyed
 2484  1666  ; w1          proc
 2485  1666  ; w2          destroyed
 2486  1666  ; w3  link    destroyed
 2487  1666  
 2487  1666  b.i24                   ; begin
 2488  1666  w.g26:al  w0  1         ;
 2489  1668    g27:al  w1  0         ;
 2490  1670        rs  w1  g20       ;   status:=
 2491  1672    g28:rs  w1  g21       ;   bytes:=
 2492  1674        rs  w1  g22       ;   character:=0;
 2493  1676        jl      g19       ;   deliver result(1);
 2494  1678  e.                      ; end
 2495  1678  
 2495  1678  ; procedure increase stop count
 2496  1678  ; comment: increases the stop count of the sender by 1.
 2497  1678  ;     call:   return:
 2498  1678  ; w0          unchanged
 2499  1678  ; w1          unchanged
 2500  1678  ; w2  buf     buf
 2501  1678  ; w3  link    destroyed
 2502  1678  
 2502  1678  b.i24                   ; begin
 2503  1678  w.g31:rs  w3  i0        ;
 2504  1680        am     (x2+6)     ;
 2505  1682        bz  w3  a12       ;
 2506  1684        al  w3  x3+1      ;   stop count(sender(buf)):=
 2507  1686        am     (x2+6)     ;   stop count(sender(buf))+1;
 2508  1688        hs  w3  a12       ;
 2509  1690        jl     (i0)       ;
 2510  1692    i0: 0                 ;
 2511  1694  e.                      ; end
 2512  1694  
 2512  1694  ; procedure decrease stop count
 2513  1694  ; comment: the stop count of the sender is decreased by 1
 2514  1694  ; if the operation is odd. if stop count becomes zero and the
 2515  1694  ; sender is waiting to be stopped, the sender is stopped
 2516  1694  ; and the stop count of its parent is decreased by 1.
 2517  1694  ; if the parent has stopped its child, an answer is sent to
 2518  1694  ; the parent in the buffer defined by the wait address of
 2519  1694  ; the child.
 2520  1694  ;     call:   return:
 2521  1694  ; w0          destroyed
 2522  1694  ; w1          destroyed
 2523  1694  ; w2          destroyed
 2524  1694  ; w3  link    destroyed
 2525  1694  
 2525  1694  b.i24                   ; begin
 2526  1694  w.g32:rs  w3  i3        ;
 2527  1696        rl  w2  b18       ;
 2528  1698        zl  w0  x2+a138+1 ;
 2529  1700        rl  w3  x2+6      ;   internal:=sender(buf);
 2530  1702        sz  w0  2.0000001 ;   if io_operation(buf))
 2531  1704        sh  w3  -1        ;   and internal>=0 then
 2532  1706        jl     (i3)       ;   begin
 2533  1708        bz  w0  x3+a12    ;
 2534  1710        bs. w0  1         ;   stop count(internal):=
 2535  1712        hs  w0  x3+a12    ;   stop count(internal)-1;
 2536  1714    i0: se  w0  0         ; exam stop:
 2537  1716        jl     (i3)       ;   if stop count(internal)=0
 2538  1718        bz  w1  x3+a13    ;   and state(internal)=wait stop
 2539  1720        so  w1  a105      ;   then
 2540  1722        jl     (i3)       ;   begin
 2541  1724        al  w1  x1+a106   ;   child state:=
 2542  1726        hs  w1  x3+a13    ;   state(internal):=wait start;
 2543  1728        rl  w2  x3+a40    ;   buf:=wait address(internal);
 2544  1730        rl  w3  x3+a34    ;   internal:=parent(internal);
 2545  1732        bz  w0  x3+a12    ;
 2546  1734        bs. w0  1         ;   stop count(internal):=
 2547  1736        hs  w0  x3+a12    ;   stop count(internal)-1;
 2548  1738        se  w1  a99       ;   if child state<>wait start parent
 2549  1740        jl      i0        ;   then goto exam stop;
 2550  1742  
 2550  1742  ; let the  driver claim the buffer, so that
 2551  1742  ; it may send the answer:
 2552  1742       rl  w1     b21    ;
 2553  1744       ac  w0  x1        ;    receiver(buf) := -cur; (i.e. claimed)
 2554  1746       rs  w0  x2+4      ;
 2555  1748       bz  w3  x1+a19    ;    decrease(bufclaim(cur));
 2556  1750       al  w3  x3-1      ;    (even if claims would be exceeded)
 2557  1752       hs  w3  x1+a19    ;
 2558  1754       rl  w1  x1+a17    ;    answer area := first addr(cur);
 2559  1756       al  w0     1      ;    result := 1;
 2560  1758       jd         1<11+22;    send answer;
 2561  1760       jd        (i3)    ;    return disabled;
 2562  1762    i2: 0                 ;
 2563  1764    i3: 0                 ;
 2564  1766  e.                      ; end
 2565  1766  
 2565  1766  ; procedure exam sender(sender stopped)
 2566  1766  ;     call:   return:
 2567  1766  ; w0          unchanged
 2568  1766  ; w1          unchanged
 2569  1766  ; w2          unchanged
 2570  1766  ; w3  link    link
 2571  1766  
 2571  1766  b.i24                   ; begin
 2572  1766  w.g34:rs  w3  i0        ;
 2573  1768        am     (b18)      ;
 2574  1770        rl  w3  6         ;   internal:=sender(buf);
 2575  1772        sh  w3  -1        ;
 2576  1774        jl     (i0)       ;   if internal<0
 2577  1776        bz  w3  x3+a13    ;
 2578  1778        sz  w3  a105      ;   or state(internal)=stopped
 2579  1780        jl     (i0)       ;   then goto sender stopped;
 2580  1782        rl  w3  i0        ;
 2581  1784        jl      x3+2      ;
 2582  1786    i0: 0                 ;
 2583  1788  e.                      ; end
 2584  1788  
 2584  1788  ; procedure check i-o transfer (document size, message);
 2585  1788  ;
 2586  1788  ;        call              return
 2587  1788  ;  w0    size of document  size of document
 2588  1788  ;  w1    -                 unchanged
 2589  1788  ;  w2    message           message
 2590  1788  ;  w3    link              destroyed
 2591  1788  ;
 2592  1788  
 2592  1788  g37:                   ; 
 2593  1788       jl.     (+2)      ; goto check i-o transfer;
 2594  1790                 d146    ;
 2595  1792  
 2595  1792  ; procedure follow chain(no. of slices,chain table index, slice)
 2596  1792  ; the return value is the chain table index of entry number <no.
 2597  1792  ; of slices> in the chain starting at <chain  table index>
 2598  1792  ;     call:   return:
 2599  1792  ; w0  n.o.s.  destroyed
 2600  1792  ; w1          unchanged
 2601  1792  ; w2  c.t.i.  slice
 2602  1792  ; w3  link    destroyed
 2603  1792  
 2603  1792  b.i8
 2604  1792  w.d74:rs  w3  i3        ; save return
 2605  1794        ac  w3 (0)        ;
 2606  1796        as  w3  1         ; count := -2 * no. of slices
 2607  1798        jl.     i2.       ; goto test; repeat:
 2608  1800    i0: sl  w3  -30       ; if count >= -30
 2609  1802        jl.     x3+i1.    ; then goto advance(-count)
 2610  1804        ba  w2  x2        ;
 2611  1806        r. 16             ;
 2612  1836    i1: al  w3  x3+32     ; count := count + 32
 2613  1838    i2: sh  w3  -2        ; test:  if count < 0
 2614  1840        jl.     i0.       ; then goto repeat
 2615  1842        jl     (i3)       ; return
 2616  1844    i3: 0                 ;
 2617  1846  e.                      ;
 2618  1846  
 2618  1846  
 2618  1846  
 2618  1846  ; procedure test users , reserver, and writeprotecters(intproc,extproc);
 2619  1846  ; reg    call        return
 2620  1846  ; w0                 undef
 2621  1846  ; w1     intproc     unchanged
 2622  1846  ; w2     extproc     unchanged
 2623  1846  ; w3     link        result
 2624  1846  
 2624  1846  ; the procedure set result = 2.000001  if intproc is user
 2625  1846  ;                          = 2.000011  if intproc is reserver (and user)
 2626  1846  ;                          = 2.000101  if intproc and other ip are users
 2627  1846  ;                          = 2.000100  if there only are other users
 2628  1846  ;                          = 2.001100  if another ip is reserver (and user)
 2629  1846  ;                          = 2.01----  if intproc has writeprotected
 2630  1846  ;                          = 2.10----  if other(s) has writeprotected
 2631  1846  ;                          = 2.11----  if intproc and other(s) has writeprotected
 2632  1846  ; writeprotection bit can only be set if the extprocess is an areaprocess.
 2633  1846  ; of extproc else result is set to zero
 2634  1846  
 2634  1846  b. i5,j5  w.
 2635  1846  d76: ds. w3     j1.    ;  save(link,extproc);
 2636  1848       rl  w0  x2+a52    ;  w0:=reserver.extproc;
 2637  1850       al  w3     2.10   ;
 2638  1852       sn  w0  (x1+a14)  ;  if intproc is reserver then
 2639  1854       jl.        i3.    ;  goto test other users;
 2640  1856       al  w3     0      ;
 2641  1858       se  w0     0      ;  if there is another reserver then
 2642  1860       al  w3    2.1000  ;  set other-reserver bit;
 2643  1862  i3:  ba  w2  x1+a14    ;  w2:=addr(bitpattern.intproc);
 2644  1864       bz  w0  x2        ;  w0:=  bitpattern.intproc;
 2645  1866       sz  w0  (x1+a14)  ;  if userbit.intproc is on then
 2646  1868       al  w3  x3+1      ;  w3:=w3+1 <* set intproc is user *> else
 2647  1870       al  w2   a402     ;
 2648  1872  i0:  am.       (j0.)   ;
 2649  1874       bz  w0 x2         ;  w0:=next pattern.userbittable;
 2650  1876       sn  w0     0      ;  if no users then
 2651  1878       jl.        i1.    ;  goto f1;
 2652  1880       hs  w2     0      ;  
 2653  1882       sn  w0  (x1+a14)  ;  if only intproc is user then 
 2654  1884       jl.        i1.    ;  goto f1 else
 2655  1886       al  w3  x3+4      ;  result:=result add 2.0100;
 2656  1888       jl.        i2.    ;  goto return;
 2657  1890  i1:  al  w2  x2+1      ;  w2:=next rel addr;
 2658  1892       se  w2 a402+a403  ;  if not end bittable then
 2659  1894       jl.        i0.    ;  goto f0;
 2660  1896  
 2660  1896  i2:  rl. w2     j0.    ;  if extproc=area then 
 2661  1898       rl  w0  x2+a10    ;  begin
 2662  1900       se  w0     4      ;
 2663  1902       jl.        i5.    ;
 2664  1904       rs. w3     j0.    ;    <* save result *>
 2665  1906       jl. w3   d114.    ;    check writeprotect(intproc, extproc);
 2666  1908       jl.        i4.    ;+0: none:
 2667  1910       am         -2 ; j3;+2: intproc:
 2668  1912       am         -2 ; j4;+4: other(s):
 2669  1914       rl. w0     j5.    ;+6: intproc + other(s):
 2670  1916       rl. w3     j0.    ;
 2671  1918       ea  w3      1     ;    <* add writeprotection bits *>
 2672  1920       sz                ;  end;
 2673  1922  i4:                    ;
 2674  1922       rl. w3     j0.    ;
 2675  1924  i5:  jl.       (j1.)   ;  return;
 2676  1926  
 2676  1926  j0:  0
 2677  1928  j1:  0
 2678  1930  j3: 2.010000           ; intproc
 2679  1932  j4: 2.100000           ; other(s)
 2680  1934  j5: 2.110000           ; intproc + other(s)
 2681  1936  e.
 2682  1936  
 2682  1936  
 2682  1936  
 2682  1936  
 2682  1936  ; procedure check writeprotect(internal, proc);
 2683  1936  ;      call           return
 2684  1936  ; w0    -            unchanged
 2685  1936  ; w1  internal       unchanged
 2686  1936  ; w2  proc           unchanged
 2687  1936  ; w3  link           unchanged
 2688  1936  ;
 2689  1936  ; return:  link + 0: no internal has writeprotected
 2690  1936  ;          link + 2: only named internal has writeprotected
 2691  1936  ;          link + 4: other than named internal has writeprotected
 2692  1936  ;          link + 6: internal + other has writeprotected
 2693  1936  ;
 2694  1936  
 2694  1936  b. i10, j10  w.
 2695  1936  d114:                  ; begin
 2696  1936       ds. w3      i3.   ;   save registers;
 2697  1938       ds. w1      i1.   ;
 2698  1940       zl  w0  x1+a14+1  ;   <* save internal.idbit mask *>
 2699  1942       rs. w0      i4.   ;
 2700  1944       ea  w2  x1+a14    ;
 2701  1946       al  w2  x2+a404   ;   <* save addr of id-bit element *>
 2702  1948       rs. w2      i5.   ;
 2703  1950       rl. w3      i2.   ;
 2704  1952       al  w2  x3+a405   ;   <* w2: first writeprotect bit element,
 2705  1954       al  w3  x3+a250   ;      w3: top of writeprotect bit array,
 2706  1956       al  w1       0    ;      w1: state = <no internal has writeprotected> *>
 2707  1958  j0:                    ;   repeat begin
 2708  1958       zl  w0  x2        ;     if element <> 0 then
 2709  1960       sn  w0       0    ;     begin
 2710  1962       jl.         j2.   ;
 2711  1964       sn. w2     (i5.)  ;       if element.addr = int.bitelement and
 2712  1966       so. w0     (i4.)  ;          element.bit(int.idbit) is on
 2713  1968       jl.         j1.   ;
 2714  1970       al  w1  x1+  2    ;       then state := state and <int has writeprot>;
 2715  1972       sn. w0     (i4.)  ;       if element.addr <> int.bitelement or 
 2716  1974       jl.         j2.   ;          other than int.idbit is on       
 2717  1976  j1:  sh  w1       2    ;       then state := state and <others has writeprot>;
 2718  1978       al  w1  x1+  4    ;     end;
 2719  1980  j2:                    ;   end until
 2720  1980       al  w2  x2+  1    ;   element = top element;
 2721  1982       se  w2  x3        ;
 2722  1984       jl.         j0.   ;
 2723  1986                         ;
 2724  1986       dl. w3      i3.   ;   <* restore registers and
 2725  1988       wa  w3       2    ;      modify return addr with state *>
 2726  1990       dl. w1      i1.   ;
 2727  1992       jl      x3        ; end;
 2728  1994                         ;
 2729  1994       0                 ; save w0:
 2730  1996  i1:  0                 ; save w1: int
 2731  1998  i2:  0                 ;  "   " : proc
 2732  2000  i3:  0                 ;  "   " : link
 2733  2002  i4:  0                 ; id bit of internal
 2734  2004  i5:  0                 ; writeprotect id bit element addr in proc
 2735  2006  
 2735  2006  
 2735  2006  
 2735  2006  e.
 2736  2006  
 2736  2006  
 2736  2006  ; procedure check user;
 2737  2006  ;
 2738  2006  ; call: w1=internal, w2=proc, w3=link
 2739  2006  ; exit: w0=undef,  w1, w2, w3=unchanged
 2740  2006  ; return address: link+2: cur was user
 2741  2006  ;                 link  : cur was not user
 2742  2006  
 2742  2006  d102:                   ; begin
 2743  2006       ba  w2  x1+a14     ;
 2744  2008       bz  w0  x2         ;   w0:=internal.userbit;
 2745  2010       bs  w2  x1+a14     ;   reset w2;
 2746  2012       sz  w0 (x1+a14)    ;   if internal is user then
 2747  2014       jl      x3+2       ;     return(link+2)    else
 2748  2016       jl      x3         ;   return(link);
 2749  2018                          ; end;
 2750  2018  
 2750  2018  
 2750  2018  
 2750  2018  ; procedure check any reserver;
 2751  2018  ;
 2752  2018  ; call: w1=internal, w2=proc, w3=link
 2753  2018  ; exit: w0=undef,  w1, w2, w3=unchanged
 2754  2018  ; return address: link  : other process is reserver
 2755  2018  ;                 link+2: internal is reserver
 2756  2018  ;                 link+4: not reserved by anyone
 2757  2018  
 2757  2018  d113:                   ; begin
 2758  2018       rl  w0  x2+a52     ;   if proc.reserver=0 then
 2759  2020       sn  w0     0       ;
 2760  2022       jl      x3+4       ;     return(link+4);
 2761  2024       se  w0 (x1+a14)    ;   if proc.reserver<>internal.idbit then
 2762  2026       jl      x3         ;     return(link+0); <* other reserver *>
 2763  2028       jl      x3+2       ;     return(link+2); <* internal reserver *>
 2764  2030                          ; end;
 2765  2030  
 2765  2030  ; procedure insert writeprotect(internal, proc)
 2766  2030  ;
 2767  2030  ; call w1=internal, w2=proc, w3=link
 2768  2030  ; exit w0=undef,  w1, w2, w3=unchanged
 2769  2030  ;
 2770  2030  
 2770  2030  d118:                   ; begin
 2771  2030       ea  w2  x1+a14     ;   element:=proc.userbit element;
 2772  2032       zl  w0  x2+a404    ;   w0:=proc.writeprotect element;
 2773  2034       lo  w0  x1+a14     ;   w0:=proc.writeprotect element or internal.idbit;
 2774  2036       hs  w0  x2+a404    ;   proc.writeprotect element:=updated writeprotect element;
 2775  2038       es  w2  x1+a14     ;
 2776  2040       jl      x3         ; end;
 2777  2042  
 2777  2042  
 2777  2042  ; procedure remove writeprotect(internal, proc);
 2778  2042  ;
 2779  2042  ; call: w1=internal, w2=proc, w3=link
 2780  2042  ; exit: w0=undef,  w1, w2, w3=unchanged
 2781  2042  ;
 2782  2042  
 2782  2042  d119:                   ; begin
 2783  2042       ea  w2  x1+a14     ;
 2784  2044       zl  w0  x2+a404    ;   element:=proc.userbitelement - displacement;
 2785  2046       sz  w0 (x1+a14)    ;   if element.bit(intproc.idbit) is on then
 2786  2048       lx  w0  x1+a14     ;      element.bit(intproc.idbit):=0;
 2787  2050       hs  w0  x2+a404    ;
 2788  2052       es  w2  x1+a14     ;
 2789  2054       jl      x3         ; end;
 2790  2056  
 2790  2056  
 2790  2056  
 2790  2056  ; ******  indirect addressed monitor routines ******
 2791  2056  
 2791  2056  ; procedure conditional reschedule    (eq d20)
 2792  2056  ; procedure unconditional reschedule  (eq d21)
 2793  2056  ; conditional: if 'no fo free pu' = 0 the internal is rescheduled.
 2794  2056  ;         call           return
 2795  2056  ; w0      -              destroyed
 2796  2056  ; w1      internal       internal
 2797  2056  ; w2      -              destroyed
 2798  2056  ; w3      link           destroyed
 2799  2056  ;
 2800  2056  
 2800  2056  b. i10 w.
 2801  2056  
 2801  2056  d40:  rl  w2    (b59)    ; conditional reschedule:
 2802  2058        rl  w2  x2         ; begin
 2803  2060        se  w2     0       ;   if no of free pu > 0 then
 2804  2062        jl      x3         ;   return;
 2805  2064                           ;
 2806  2064  d41:  rs. w3     i3.     ; unconditional reschedule:
 2807  2066        al  w0     a95     ;
 2808  2068        jl  w3     d9      ;   deactivate process(internal, waiting for cpu);
 2809  2070        sn  w0     a95     ;   if not internal.stopped then
 2810  2072        jl  w3     d10     ;   link internal(internal);
 2811  2074        jl.       (i3.)    ;
 2812  2076                           ;
 2813  2076  i3:   0                  ;
 2814  2078  e.                       ; end;
 2815  2078  
 2815  2078  
 2815  2078  
 2815  2078  ; procedure check and search name (=d17+d11 -> d67+d44) (eq d101)
 2816  2078  ;
 2817  2078  ; call: w1=cur, save w3(cur)=name, w3=link
 2818  2078  ; exit: w0, w1=unchanged, w2=name, w3=entry
 2819  2078  ; return address: link: entry not found
 2820  2078  ;                 link+2: entry found
 2821  2078  ;                 c29 : name area outside current process
 2822  2078  b. i25 w.
 2823  2078  
 2823  2078  d43:                   ;
 2824  2078       ds. w1     i1.    ;    save(w0, cur);
 2825  2080       rl  w2  x1+a31    ;    name:=save w3(cur);
 2826  2082       al  w0  x2+6      ;    
 2827  2084       sh  w0     0      ;    if overflow or
 2828  2086       jl         c29    ;
 2829  2088       sl  w2 (x1+a17)   ;      name<first addr(cur) or
 2830  2090       sl  w0 (x1+a18)   ;      name+6>=top addr(cur) then
 2831  2092       jl         c29    ;    goto internal 3;
 2832  2094       dl  w1  x1+a43    ;    w0w1:=catbase(cur);
 2833  2096       jl.        i14.   ;    goto search name(name, entry, base);
 2834  2098  
 2834  2098  ; the following procedures searches the name table for a given entry and delivers its entry in
 2835  2098  ; the name table. if name is undefined, the entry is name table end.
 2836  2098  
 2836  2098  ; procedure search name(name, entry); (eq d11)
 2837  2098  ; call: w2=name, w3=link
 2838  2098  ; exit: w0, w1, w2=unchanged, w3=entry
 2839  2098  ; return address: link  : name not found, w3=(b7)
 2840  2098  ;                 link+2: name found
 2841  2098  
 2841  2098  d44: ds. w1     i1.    ;    save(w0, w1);
 2842  2100       am        (b1)    ;
 2843  2102       dl  w1    +a43    ;    base:=catbase(cur);
 2844  2104  i14: al  w3  x3+1      ;    link := link + 1; i.e. destinguish between normal and error return;
 2845  2106  
 2845  2106  ; procedure search name(name, entry, base); (eq d71)
 2846  2106  ; call: w0, w1=base, w2=name, w3=link
 2847  2106  ; exit: w0, w1=undef, w2=unchanged, w3=entry
 2848  2106  ; return address: link  : name not found, w3=(b7)
 2849  2106  ;                 link  : name found, w3 <> (b7)
 2850  2106  
 2850  2106  d45: ds. w3     i3.    ;    save (name, return);
 2851  2108       ds. w1     i20.   ;    save search base;
 2852  2110  i4:  al  w1  x1-1;used ;
 2853  2112       bs. w0     i4.+1  ;
 2854  2114       ds. w1     i6.    ;    base:=base+(1, -1);
 2855  2116       dl  w1     d73    ;
 2856  2118       ds. w1     i8.    ;    min base:=extreme;
 2857  2120       rl  w1     b7     ;
 2858  2122       rs. w1     i9.    ;    found:=name table end;
 2859  2124       rl  w1     b1     ;    get physical name address
 2860  2126  b. h1 w.               ;    if mp then
 2861  2126       am        (b9)    ;
 2862  2128  h0=k
 2863  2128       jl.       0       ;    begin
 2864  2130       gg  w1     b104   ;      get cur register;
 2865  2132  c.(:h0+a8-k-1:)
 2866  2132       am  0, r.(: h0+a8+2-k :)>1 ;  fill up
 2867  2132  z.
 2868  2132  e.                     ;    end mp
 2869  2132       wa  w2  x1+a182   ;
 2870  2134       dl  w1  x2+6      ;
 2871  2136       ds. w1     i13.   ;    move name to last name in name table;
 2872  2138       dl  w1  x2+2      ;    
 2873  2140       sn  w0     0      ;    if name(0)<>0 then
 2874  2142       jl.        i18.   ;
 2875  2144       ds. w1     i11.   ;
 2876  2146       rl  w3     b3     ;      for entry:=name table start
 2877  2148       jl.        i17.   ;
 2878  2150  i15: dl. w1     i11.   ;
 2879  2152  i16: al  w3  x3+2      ;        step 2 until name table end do
 2880  2154  i17: rl  w2  x3        ;
 2881  2156       sn  w1 (x2+a11+2) ;      begin
 2882  2158       se  w0 (x2+a11+0) ;        proc:=name table(entry);
 2883  2160       jl.        i16.   ;
 2884  2162       dl. w1     i13.   ;
 2885  2164       sn  w0 (x2+a11+4) ;
 2886  2166       se  w1 (x2+a11+6) ;        if name.proc=name and
 2887  2168       jl.        i15.   ;
 2888  2170       sn. w2    (i21.)  ;
 2889  2172       jl.        i18.   ;
 2890  2174       dl  w1  x2+a49    ;
 2891  2176       sl. w0    (i7.)   ;          lower.proc>=lower.min and
 2892  2178       sl. w0    (i5.)   ;          lower.proc<=lower.base and
 2893  2180       jl.        i15.   ;
 2894  2182       sh. w1    (i8.)   ;          upper.proc<=upper.min and
 2895  2184       sh. w1    (i6.)   ;          upper.proc>=upper base then
 2896  2186       jl.        i15.   ;          begin
 2897  2188       ds. w1     i8.    ;              min:=interval.proc;
 2898  2190       rs. w3     i9.    ;              found:=entry;
 2899  2192       sn. w0    (i19.)  ;              if base.proc = search base 
 2900  2194       se. w1    (i20.)  ;              then goto found;
 2901  2196       jl.        i15.   ;          end;
 2902  2198  i18:                   ;      end;
 2903  2198       dl. w0     i0.    ;      restore(w0, w1, w2);
 2904  2200       dl. w2     i2.    ;      w3:=found;
 2905  2202       sn  w3    (b7)    ;      if w3=name table end then
 2906  2204       jl.       (i3.)   ;      return to link
 2907  2206       am.       (i3.)   ;    else
 2908  2208       jl        +1      ;      return to link+1;
 2909  2210  
 2909  2210  i9: 0                  ;i0-2: found (i.e. current best entry, or (b7))
 2910  2212  i0: 0                  ;i1-2: saved w0
 2911  2214  i1: 0                  ;i2-2: saved w1
 2912  2216  i2: 0                  ;i3-2: saved w2
 2913  2218  i3: 0                  ;      saved return
 2914  2220  i5: 0                  ;i6-2: lower base+1 for search
 2915  2222  i6: 0                  ;      upper base-1 for search
 2916  2224  i7: 0                  ;i8-2: lower minimum
 2917  2226  i8: 0                  ;      upper minimum
 2918  2228  
 2918  2228  ; the last entry in name table must point here:
 2919  2228  c98 = k-a11
 2920  2228  i10: 0                 ; name to search for
 2921  2230  i11: 0                 ;
 2922  2232  i12: 0                 ;
 2923  2234  i13: 0                 ;
 2924  2236  i19: 0                 ; search base
 2925  2238  i20: 0                 ; 
 2926  2240  i21: c98               ;
 2927  2242  e.
 2928  2242  ;
 2929  2242  
 2929  2242  ; procedure remove user(internal, proc);      <* eq  d123 *>
 2930  2242  ; procedure remove reserver(internal, proc);  <* eq  d124 *>
 2931  2242  ;
 2932  2242  ; removes the id-bit of the internal from the reserver and/or user fields.
 2933  2242  ;
 2934  2242  ;        call           return
 2935  2242  ;  w0    -              destroyed
 2936  2242  ;  w1    internal       internal
 2937  2242  ;  w2    proc           proc
 2938  2242  ;  w3    link           link
 2939  2242  ;
 2940  2242  
 2940  2242  d53:                   ; remove user
 2941  2242       ba  w2  x1+a14    ; begin
 2942  2244       zl  w0  x2        ;   if proc.userbits(internal.id-bit) is on then
 2943  2246       sz  w0 (x1+a14)   ;      proc.userbits(internal.id-bit) := 0;
 2944  2248       bs  w0  x1+a14+1  ;
 2945  2250       hs  w0  x2        ;
 2946  2252       bs  w2  x1+a14    ;   if proc.reserver = internal then remove reserver;
 2947  2254                         ; end;
 2948  2254                         ;
 2949  2254  d54:                   ; remove reserver
 2950  2254       rl  w0  x2+a52    ; begin
 2951  2256       sn  w0 (x1+a14)   ;   if proc.reserver = internal then
 2952  2258       al  w0     0      ;      proc.reserver := 0;
 2953  2260       rs  w0  x2+a52    ;
 2954  2262       jl      x3        ; end;
 2955  2264  
 2955  2264  
 2955  2264  ; procedure insert reserver(internal, proc);  <* eq d125 *>
 2956  2264  ; procedure insert user(internal, proc);      <* eq d126 *>
 2957  2264  ; adds the id-bit of the internal to reserver-/user-fields of proc.
 2958  2264  ;
 2959  2264  ;          call           return
 2960  2264  ;  w0      -              destroyed
 2961  2264  ;  w1      internal       internal
 2962  2264  ;  w2      proc           proc
 2963  2264  ;  w3      link           link
 2964  2264  ;
 2965  2264  
 2965  2264  d55:                   ; insert reserver
 2966  2264       rl  w0  x1+a14    ; begin
 2967  2266       rs  w0  x2+a52    ;   proc.reserver := internal.id;
 2968  2268                         ;   goto insert user;
 2969  2268                         ; end;
 2970  2268                         ;
 2971  2268  d56:                   ; insert user
 2972  2268       ba  w2  x1+a14    ; begin
 2973  2270       zl  w0  x2        ;
 2974  2272       lo  w0  x1+a14    ;   proc.idbit(internal.id) := 1;
 2975  2274       hs  w0  x2        ;
 2976  2276       bs  w2  x1+a14    ;
 2977  2278       jl      x3        ; end;
 2978  2280  
 2978  2280  
 2978  2280  ; procedure claim buffer(cur, buffer);  <* eq d108 *>
 2979  2280  ; 
 2980  2280  ;        call            return
 2981  2280  ;  w0    -               destroyed
 2982  2280  ;  w1    cur             cur
 2983  2280  ;  w2    buffer          buffer
 2984  2280  ;  w3    link            link
 2985  2280  ;
 2986  2280  
 2986  2280  b.  i0  w.
 2987  2280  
 2987  2280  d58:                   ; claim buffer
 2988  2280       zl  w0  x1+a19    ; begin
 2989  2282       sn  w0     0      ;   if cur.bufferclaim <> 0 then
 2990  2284       jl.        i0.    ;   begin
 2991  2286       bs. w0     1      ;     cur.bufferclaim := cur.bufferclaim - 1;
 2992  2288       hs  w0  x1+a19    ;
 2993  2290       ac  w0 (x2+a141)  ;     buffer.receiver := -buffer.receiver;
 2994  2292       rs  w0  x2+a141   ;
 2995  2294       jl      x3        ;     <* ok return *>
 2996  2296                         ;   end
 2997  2296  i0:                    ;   else
 2998  2296       rs  w0  x1+a30    ;   begin  cur.saved w2 := 0;
 2999  2298       jl         c99    ;     goto return from interrupt;
 3000  2300                         ;   end;
 3001  2300  e.                     ; end;
 3002  2300  
 3002  2300  ; procedure regretted message(buffer);  <* eq d75 *>
 3003  2300  ; simulates the release of a messge buffer, as in wait answer. the bufferclaim
 3004  2300  ; of the sender is increased. the buffer is removed and released (unless in
 3005  2300  ; state = received).
 3006  2300  ;
 3007  2300  ;        call             return
 3008  2300  ;  w0    -                unchanged
 3009  2300  ;  w1    -                unchanged
 3010  2300  ;  w2    buffer           buffer
 3011  2300  ;  w3    link             destroyed
 3012  2300  ;
 3013  2300  
 3013  2300  b.  i10, j10  w.
 3014  2300  
 3014  2300  d65:                   ; regretted message
 3015  2300       rs. w3     i3.    ; begin
 3016  2302       ds. w1     i1.    ;
 3017  2304       rl  w1  x2+a142   ;
 3018  2306       sh  w1     0      ;   if message.sender < 0 then exit; <* buffer already regretted *>
 3019  2308       jl.        j6.    ;
 3020  2310       ac  w0  x1        ;   message.sender := -message.sender; <* indicates message regretted *>
 3021  2312       rs  w0  x2+a142   ;
 3022  2314       rl  w0  x1+a10    ;   if sender.kind = pseudo proc or
 3023  2316       se  w0     64     ;      sender.kind = csp_terminal then
 3024  2318       sn  w0     q8     ;      sender:= sender.main;
 3025  2320       rl  w1  x1+a50    ;
 3026  2322       sz  w0    -1-64   ;   if sender.kind<>internal and sender.kind<>pseudo then
 3027  2324       rl  w1  x1+a250   ;      sender := sender.driverproc;
 3028  2326                         ;
 3029  2326       zl  w3  x1+a19    ;   sender.bufferclaim := sender.bufferclaim + 1;
 3030  2328       al  w3  x3+1      ;
 3031  2330       hs  w3  x1+a19    ;
 3032  2332                         ;
 3033  2332       rl  w1  x2+a141   ;   receiver := abs(message.receiver);
 3034  2334       sh  w1     0      ;
 3035  2336       ac  w1  x1        ;   if receiver < 5 then
 3036  2338       sh  w1     5      ;      goto remove and release;
 3037  2340       jl.        j5.    ;      <* message contains an answer *>
 3038  2342                         ;
 3039  2342       rl  w0  x1+a10    ;   if receiver.kind <> internal and
 3040  2344       rl  w3  x1+a250   ;      receiver.kind <> pseudo and
 3041  2346       se  w0     0      ;      receiver.driverproc < 0 then
 3042  2348       sn  w0     64     ;   begin
 3043  2350       sz                ;     <* ida/ifp process - receiver driven by monitor *>
 3044  2352       sl  w3     0      ;
 3045  2354       jl.        j2.    ;
 3046  2356                         ;
 3047  2356  j0:  sn  w0     q20    ;     proc := receiver;
 3048  2358       jl.        j1.    ;
 3049  2360       sn  w0     q26    ;
 3050  2362       jl.        j1.    ;     while proc.kind <> main do
 3051  2364       rl  w1  x1+a50    ;     proc := proc.main;
 3052  2366       rl  w0  x1+a10    ;
 3053  2368       jl.        j0.    ;
 3054  2370                         ;
 3055  2370  j1:  al  w3     2.1000 ;     if message.state = stopped then
 3056  2372       zl  w0  x2+a138+1 ;        return
 3057  2374       sz  w0  x3        ;     else
 3058  2376       jl.        j6.    ;        message.state := stopped;
 3059  2378       lo  w0     6      ;
 3060  2380       hs  w0  x2+a138+1 ;
 3061  2382                         ;
 3062  2382       sn  w2 (x1+a81)   ;     if message = main.waiting_queue.first then
 3063  2384       jl.        j6.    ;        return;
 3064  2386       jl  w3     d5     ;     unlink(message);
 3065  2388       al  w0     1      ;
 3066  2390       jl.        d142.  ;     test ready and setup(message,force));
 3067  2392                         ;     <* it will exit with return from interrupt - the
 3068  2392                         ;        setup procedure of the receiver will take care
 3069  2392                         ;        of a proper action on the regretted message *>
 3070  2392                         ;   end;
 3071  2392  j2:                    ;   <* receiver is not an subprocess *>
 3072  2392       rl  w1  x2+a141   ;   if message.claimed then
 3073  2394       sl  w1     0      ;   begin
 3074  2396       jl.        j3.    ;
 3075  2398       se  w0     q20    ;
 3076  2400       sn  w0     q26    ;     if receiver.kind = main then
 3077  2402       sz                ;
 3078  2404       jl.        j6.    ;     begin
 3079  2406       al  w3     2.1000 ;
 3080  2408       zl  w0  x2+a138+1 ;       if message.state = stopped then
 3081  2410       sz  w0  x3        ;       return;  <already stopped>
 3082  2412       jl.        j6.    ;
 3083  2414       lo  w0     6      ;       message.state := stopped;
 3084  2416       hs  w0  x2+a138+1 ;
 3085  2418       ac  w1  x1        ;       if message = main.waiting_queue.first or
 3086  2420       se  w2 (x1+a81)   ;          not message.in_queue then
 3087  2422       sn  w2 (x2+a140)  ;          return
 3088  2424       jl.        j6.    ;       else begin
 3089  2426       jl  w3     d5     ;         unlink(message);
 3090  2428       al  w0     1      ;
 3091  2430       jl.        d142.  ;         test ready and setup(message,force);
 3092  2432                         ;       end;
 3093  2432                         ;     end
 3094  2432                         ;     else return;
 3095  2432                         ;   end;
 3096  2432  j3:                    ;   <* the message is neither answer nor claimed *>
 3097  2432       se  w0     0      ;   if receiver.kind = internal or
 3098  2434       sn  w0     64     ;      receiver.kind = pseudo then
 3099  2436       jl.        j5.    ;      goto remove and release;
 3100  2438       se  w0     4      ;   if receiver.kind = area then
 3101  2440       jl.        j4.    ;
 3102  2442       rl  w1  x1+a50    ;      receiver := receiver.main.main; <* physical disc proc *>
 3103  2444       rl  w1  x1+a50    ;
 3104  2446  j4:  se  w2 (x1+a54)   ;   if receiver.event_q.first = message then
 3105  2448       jl.        j5.    ;   begin
 3106  2450       al  w0    -1      ;
 3107  2452       wa  w0  x1+a56    ;     if receiver.interrupt_addr is even then
 3108  2454       sz  w0     2.1    ;        receiver.interrupt_addr:=receiver.intterupt_addr-1;
 3109  2456       rs  w0  x1+a56    ;   end;
 3110  2458                         ;
 3111  2458  j5: jl  w3      d106   ;   remove and release(message);
 3112  2460                         ;
 3113  2460  j6: dl. w1      i1.    ; exit:
 3114  2462      jl.        (i3.)   ;   return;
 3115  2464                         ;
 3116  2464  i0:  0                 ; saved registers
 3117  2466  i1:  0                 ;
 3118  2468  i3:  0                 ;
 3119  2470                         ;
 3120  2470  e.                     ; end;
 3121  2470  
 3121  2470  
 3121  2470  ; procedure move message(from, to);  <* eq d14 *>
 3122  2470  ; moves 8 words (message or answer) from a given storage address to another.
 3123  2470  ;
 3124  2470  ;       call          return
 3125  2470  ;  w0   -             destroyed
 3126  2470  ;  w1   from          from
 3127  2470  ;  w2   to            to
 3128  2470  ;  w3   link          destroyed
 3129  2470  ;
 3130  2470  
 3130  2470  b.  i0  w.
 3131  2470  
 3131  2470  d64:                   ; move message
 3132  2470       rs. w3     i0.    ; begin
 3133  2472       dl  w0  x1+2      ;
 3134  2474       ds  w0  x2+2      ;   <* move the words *>
 3135  2476       dl  w0  x1+6      ;
 3136  2478       ds  w0  x2+6      ;
 3137  2480       dl  w0  x1+10     ;
 3138  2482       ds  w0  x2+10     ;
 3139  2484       dl  w0  x1+14     ;
 3140  2486       ds  w0  x2+14     ;
 3141  2488       jl.       (i0.)   ;
 3142  2490                         ;
 3143  2490  i0:  0                 ;
 3144  2492                         ;
 3145  2492  e.                     ; end;
 3146  2492  
 3146  2492  ; procedure check mess area and name (save w3) area;
 3147  2492  ; procedure check name (save w3) area;
 3148  2492  ; procedure check name (save w2) area;
 3149  2492  ;      call         return
 3150  2492  ;  w0  -            destroyed
 3151  2492  ;  w1  cur          cur
 3152  2492  
 3152  2492  ;  w2  -            name
 3153  2492  ;  w3  link         link
 3154  2492  
 3154  2492  d66:                    ; check message area and name area:
 3155  2492       rl  w2  x1+a29     ; begin
 3156  2494       al  w0  x2+14      ;   mess := cur.save w1;
 3157  2496       sh  w0     0       ;   if overflow or
 3158  2498       jl         c29     ;      mess < cur.first address or
 3159  2500       sl  w2 (x1+a17)    ;      mess >= cur.top address  then
 3160  2502       sl  w0 (x1+a18)    ;      goto internal 3;
 3161  2504       jl         c29     ;
 3162  2506  d67:                    ; check name (save w3) area:
 3163  2506       am         a31-a30 ;
 3164  2508  d115:                   ; check name (save w2) area:
 3165  2508       rl  w2  x1+a30     ;
 3166  2510       al  w0  x2+6       ;  
 3167  2512                          ; continue with d116!
 3168  2512  
 3168  2512  ; procedure check within (first, last);
 3169  2512  ; checks taht the specified area is within the process
 3170  2512  ;     call          return
 3171  2512  ; w0  last          last
 3172  2512  ; w1  cur           cur
 3173  2512  ; w2  first         first
 3174  2512  ; w3  link          link
 3175  2512  ; return: link: within process
 3176  2512  ;         c29 : not within
 3177  2512  
 3177  2512  d116:                   ; check within:
 3178  2512       sh  w0     0       ;   if overflow or
 3179  2514       jl         c29     ;      first < cur.first address or
 3180  2516       sl  w2 (x1+a17)    ;      last >= cur.top address  then
 3181  2518       sl  w0 (x1+a18)    ;      goto internal 3;
 3182  2520       jl         c29     ;
 3183  2522       jl      x3         ; end;
 3184  2524  
 3184  2524  ; procedure check message area and buf 
 3185  2524  ;      call           return
 3186  2524  ;  w0  -              destroyed
 3187  2524  ;  w1  cur            cur
 3188  2524  ;  w2  -              buf
 3189  2524  ;  w3  link           link
 3190  2524  ;  return: link: ok
 3191  2524  ;          c29 : mess area outside cur
 3192  2524  ;          c29 : buf not message buf
 3193  2524  
 3193  2524  d117:                   ; check message area and buf:
 3194  2524       rl  w2  x1+a29     ; begin
 3195  2526       al  w0  x2+14      ;   mess := cur.save w1;
 3196  2528       sh  w0     0       ;   if overflow or
 3197  2530       jl         c29     ;      mess < cur.first address or
 3198  2532       sl  w2 (x1+a17)    ;      mess+14 >= cur.top address then
 3199  2534       sl  w0 (x1+a18)    ;      goto internal 3;
 3200  2536       jl         c29     ;
 3201  2538                          ; continue with check message buf
 3202  2538  
 3202  2538  ; procedure check message buf;
 3203  2538  ; checks whether the save w2 of the internal process is a mess buf addr.
 3204  2538  ;       call            return
 3205  2538  ;  w0   -               destroyed
 3206  2538  ;  w1   internal        cur
 3207  2538  ;  w2   -               buf
 3208  2538  ;  w3   link            link
 3209  2538  ;  return: link: buffer ok
 3210  2538  ;          c29 : save w2 not mess buf
 3211  2538  b. i0  w.
 3212  2538  
 3212  2538  d68:                     ; check message buf:
 3213  2538       rl  w2  x1+a30      ;   buf := internal.sawe w2;
 3214  2540       sl  w2    (b8+4)    ;   if buf < mess buf pool start or
 3215  2542       sl  w2    (b8+6)    ;      buf >=mess buf pool top then
 3216  2544       jl         c29      ;      goto internal 3;
 3217  2546       al  w1  x2          ;
 3218  2548       ws  w1     b8+4     ;   if (buf-poolstart-4) modulo size of message <> 0
 3219  2550       al  w1  x1-a7       ;   then goto internal 3;
 3220  2552       al  w0     0        ;
 3221  2554       wd  w1     b8+8     ;
 3222  2556       rl  w1     b1       ;   w1 :=  cur
 3223  2558       sn  w0     0        ;
 3224  2560       jl      x3          ; return
 3225  2562       jl         c29      ;
 3226  2564  e.                       ; end;
 3227  2564  
 3227  2564  ; procedure check event (proc, buf);
 3228  2564  ; checks that buf is the address of an operation in the event queue of the internal process
 3229  2564  ;        call           return
 3230  2564  ;  w0    -              destroyed
 3231  2564  ;  w1    proc           proc
 3232  2564  ;  w2    buf            buf
 3233  2564  ;  w3    link           link
 3234  2564  ;  return: link: buffer address ok
 3235  2564  ;          c29 : buf is not in the queue
 3236  2564  
 3236  2564  b. i0 w.
 3237  2564  d69:                     ; check event:
 3238  2564       al  w0  x2          ; begin
 3239  2566       al  w2  x1+a15      ;   oper := proc.next;
 3240  2568  i0:  rl  w2  x2+0        ; next: oper := oper.next;
 3241  2570       sn  w2  x1+a15      ;   if oper = proc.eventq then
 3242  2572       jl         c29      ;      goto internal 3; <*not in queue*>
 3243  2574       se  w0  x2          ;   if buf <> oper then goto next;
 3244  2576       jl.        i0.      ;
 3245  2578       jl      x3          ;   return;
 3246  2580  e.                       ; end;
 3247  2580  
 3247  2580  ; external interrupt entry:
 3248  2580  ;
 3249  2580  ; when an external interrupt occurs, or when 'user exception first'
 3250  2580  ;    or 'user escape first' are zero, the cpu will save all registers
 3251  2580  ;    in the current process descrition.
 3252  2580  ; exit is made to here with:
 3253  2580  ;    w2 = 2 * interrupt number
 3254  2580  ;    ex = 0
 3255  2580  b. i3 w.
 3256  2580  c1:  al  w1  x2        ; interruptstat(intno) :=
 3257  2582       ls  w1     1      ; interruptstat(intno) + 1;
 3258  2584       wa  w1     b79    ;
 3259  2586       rl  w0  x1+2      ;
 3260  2588       ba. w0    +1      ;
 3261  2590       rs  w0  x1+2      ;
 3262  2592       se  w0     0      ;
 3263  2594       jl.        i3.    ;
 3264  2596       rl  w0  x1+0      ; <* count in double words *>
 3265  2598       ba. w0    +1      ;
 3266  2600       rs  w0  x1+0      ;
 3267  2602  i3:                    ;
 3268  2602       wa  w2     b0     ; 
 3269  2604       rl  w1     b51    ; w1 := current process
 3270  2606       sh  w1     0      ; if cur defined then
 3271  2608       jl.        c3.    ; begin
 3272  2610       rs  w1     b1     ;    process in monitor := cur;
 3273  2612       al  w0     1      ;    if rescedule count.cpuno > max then
 3274  2614       al  w3     0      ;       rescedule process
 3275  2616  b. h1 w.               ;
 3276  2616       am        (b9)    ;
 3277  2618  h0=k                   ;
 3278  2618       jl.        0      ;
 3279  2620       gg  w3     b108   ;
 3280  2622  c. (:h0+a8-k-1:)       ;
 3281  2622       am 0, r.(:h0+a8+2-k:)>1;
 3282  2622  z.
 3283  2622  e.                     ;
 3284  2622       ds. w2     i2.    ;
 3285  2624       wa  w0  x3+b83    ;    if reschedule count > max or 
 3286  2626       rs  w0  x3+b83    ;       internal.state <> running 
 3287  2628       zl  w3  x1+a13    ;    then
 3288  2630       sh  w0     a83    ;       unconditional reschedule
 3289  2632       se  w3     a94    ;    else
 3290  2634       am         d21-d20;       conditional reschedule;
 3291  2636       jl  w3     d20    ;
 3292  2638       dl. w2     i2.    ;
 3293  2640       jl.        c3.    ;    switch out through interrupt-table;
 3294  2642  
 3294  2642  i1:  0                 ; saved proc 
 3295  2644  i2:  0                 ; saved intno
 3296  2646  e.
 3297  2646  
 3297  2646  ; monitor call entry:
 3298  2646  ;
 3299  2646  ; if the current process executes a montor call, the cpu will
 3300  2646  ;    save all the registers in the current process description.
 3301  2646  ; exit is made to here with:
 3302  2646  ;    w1 = top register dump
 3303  2646  ;    w2 = monitor function
 3304  2646  ;    ex = 0
 3305  2646  c0:  rl  w1     b51    ;
 3306  2648       rs  w1     b1     ;   process in monitor := cur;
 3307  2650       zl  w0  x1+a13    ;  if internal.state =waiting for stop then
 3308  2652       so  w0     a105   ;  begin
 3309  2654       jl.        c7.    ;
 3310  2656       jl  w3     d9     ;     deactivate process
 3311  2658       rl  w2  x1+a33    ;     internal.ic := internal.ic - 2
 3312  2660       al  w2  x2-2      ;
 3313  2662       rs  w2  x1+a33    ;     (repeat monitor call later if started)
 3314  2664       jl         c99    ;
 3315  2666  c7:  al  w3  x2        ;     moncalltable(call no) :=
 3316  2668       ls  w3    -1      ;     moncalltable(call no) + 1;
 3317  2670       ls  w3    +2      ;     <* make odd calls even *>
 3318  2672       wa  w3     b81    ;
 3319  2674       rl  w0  x3+2      ;
 3320  2676       ba. w0    +1      ;
 3321  2678       rs  w0  x3+2      ;
 3322  2680       se  w0     0      ;
 3323  2682       jl.        c3.    ;
 3324  2684       rl  w0  x3+0      ;
 3325  2686       ba. w0    +1      ;     <* count in double words *>
 3326  2688       rs  w0  x3+0      ;
 3327  2690  
 3327  2690  c3:  am.       (+4)    ;    switch out through monitor procedure entry table;
 3328  2692       jl     (x2+0)     ;
 3329  2694                  b16    ;    <*address of monitor entry table*>
 3330  2696  
 3330  2696  ; second level external interrupt entry:
 3331  2696  ;
 3332  2696  ; exit is made to here with:
 3333  2696  ;   w1 = top register dump
 3334  2696  ;   w2 = 2 * interrupt number
 3335  2696  c8:
 3336  2696       sn  w2     2*7   ; if clock interrupt then
 3337  2698       ri         a179  ;  exit to monitor;
 3338  2700  
 3338  2700       sn  w2     2*6    ;   if cause = powerfail then
 3339  2702       jl.        c6.    ;      goto power fail routine;
 3340  2704       jl        -3<1    ;    halt;
 3341  2706  
 3341  2706  ; program errors in the current process are transferred to here,
 3342  2706  ;    (as external interrupts):
 3343  2706  ;
 3344  2706  ; w1 = cur
 3345  2706  c2:                    ; internal interrupts, overflow, spill, escape errors:
 3346  2706                         ; monitor bugs (i.e. exception- or escape-addresses
 3347  2706                         ;               outside write-limits of process)
 3348  2706  c4:                    ; bus error in operand transfer:  (no strategy yet)
 3349  2706  c5:                    ; bus error in instruction fetch: (-     -      - )
 3350  2706       jl  w2    (b31)   ; call errorlog
 3351  2708       al  w0     a96    ;    state := running after error;
 3352  2710       al  w3     c99    ;
 3353  2712       zl  w2  x1+a13    ; if process active then
 3354  2714       se  w2     a95    ;   deactvate process (and return)
 3355  2716       jl         d9     ;
 3356  2718       hs  w0  x1+a13    ;   else begin                           
 3357  2720       al  w2  x1+a16    ;    process.state := running after error; 
 3358  2722       al  w3     c99    ;    unlink proc from active queue         
 3359  2724       jl         d5     ;   end; return
 3360  2726  
 3360  2726  
 3360  2726  ; power failure:
 3361  2726  ;
 3362  2726  ; may occur at any level
 3363  2726  ;
 3364  2726  ; save the current interrupt stack entry address, unless
 3365  2726  ;    already saved
 3366  2726  ; (this should prevent powerfail-cascades from disturbing the system)
 3367  2726  
 3367  2726  b. h10, i10 w.         ;
 3368  2726  c6:  gg  w2     b91    ;    w2 := current stack element;
 3369  2728       rl. w3     h0.    ;    w3 := previous power up element;
 3370  2730       sn  w3     0      ;    if previous element is free then
 3371  2732       rs. w2     h0.    ;      power up element := current stack element;
 3372  2734       al  w2     0      ;    ilevc := 0;
 3373  2736       gp  w2     b90    ;    (i.e. the following will provoke a systemfault)
 3374  2738       jl        -1<1    ;    halt;
 3375  2740  
 3375  2740  h0:  b49               ; power up element: initially monitor element
 3376  2742  
 3376  2742  ; power up:
 3377  2742  ;
 3378  2742  ; initialize: montop (i.e. max monitor function)
 3379  2742  ;             size   (i.e. core size)
 3380  2742  ;             inf    (i.e. power up element)
 3381  2742  ;
 3382  2742  ; initialize pu information table and if the pu is a mp then start all remaining cpus.
 3383  2742  ; clear any pending interrupt bits, because they may be irrellevant
 3384  2742  ;
 3385  2742  ; entry conditions:
 3386  2742  ;    inf register = 1
 3387  2742  ;    totally disabled
 3388  2742  
 3388  2742  c25: al  w3    -1<11   ;    montop := 1 < 11
 3389  2744       ac  w3  x3+b17    ;      - top monitor function number;
 3390  2746       gp  w3     b93    ;
 3391  2748       rl  w2     b59    ;    pu inf table.montop := montop;
 3392  2750       rs  w3  x2+a352   ;
 3393  2752  
 3393  2752       rl  w3     b12    ;    size := number of storage bytes;
 3394  2754       gp  w3     b92    ;
 3395  2756       rs  w3  x2+a353   ;    pu inf table.size := size;
 3396  2758       am        +12     ;
 3397  2760       al  w3     b49    ;
 3398  2762       rs  w3  x2+a351   ;    pu inf table.inf  := inf;
 3399  2764       rl  w3     b9     ;
 3400  2766       sn  w3     a8     ;    if pu kind = mp then
 3401  2768       jl.        i3.    ;    begin
 3402  2770       rl  w3  x2+a350   ;      iopu.pu tabel register := pu inf table.pu tabel;
 3403  2772       gp  w3     b105   ;
 3404  2774       rl  w3  x2+a354   ;      iopu.exofs register := pu inf table.exception offset;
 3405  2776       gp  w3     b106   ;
 3406  2778       rl  w3  x2+a355   ;      iopu.dmofs register := pu inf table.dump offset;
 3407  2780       gp  w3     b107   ;
 3408  2782                         ;
 3409  2782  ; start all remaining cpus
 3410  2782       al  w0     1      ;      no of cpues := 1;
 3411  2784       rs  w0     b82    ;
 3412  2786       al  w0     a194   ;      interruptlevel := 8; <*start pu*>
 3413  2788       rl  w1     b67    ;      for i := 1 step 1 until max dev do
 3414  2790  i5:  al  w1  x1+a314   ;      if controllertabel(i).chpadr = pu inf tabel then
 3415  2792       sl  w1    (b68)   ;      begin  <*pu-element*>
 3416  2794       jl.        i2.    ;
 3417  2796       rl  w3  x1+a310   ;
 3418  2798       se  w3    (b59)   ;
 3419  2800       jl.        i5.    ;        puaddr := (controllertabel(i) -
 3420  2802       rl  w3     b82    ;
 3421  2804       al  w2  x1        ;                   controllertabel(0)) * 8 and (1 shift 23);
 3422  2806       ws  w2     b67    ;
 3423  2808       lo  w2     g49    ;
 3424  2810       do  w0  x2        ;        start pu(puaddr, interruptlevel);
 3425  2812       sx       2.111    ;        if pu is started then
 3426  2814       sz                ;
 3427  2816       ba. w3     1      ;        no of cpues := no of cpues + 1;
 3428  2818       rs  w3     b82    ;
 3429  2820       jl.        i5.    ;      end;
 3430  2822                         ;   end;
 3431  2822  i3:                    ;   else
 3432  2822       al  w0     0      ;      set free pu := 0
 3433  2824       rs  w0 (x2)       ;  (* always rescedule when external interrupt *)
 3434  2826  i2:                    ;    
 3435  2826  c.(:a90>0 a.1:)-1
 3436  2826       al. w3       i1. ;     dump core via fpa
 3437  2828       jl.         (2)  ;
 3438  2830                  d140  ;
 3439  2832  i1:                   ;
 3440  2832  z.
 3441  2832  
 3441  2832  
 3441  2832       al  w3     6      ;    ilevc := 0 < 12 + 6;
 3442  2834       gp  w3     b90    ;    i.e. enable for powerfail;
 3443  2836       rl. w3     h0.    ;    w3 := power up element;
 3444  2838       sn  w3     0      ;    if power up element = 0 then
 3445  2840       jl        -2<1    ;      halt;  i.e. power fail was not serviced;
 3446  2842       rs  w3     b75    ;    after powerfail := true;
 3447  2844                         ;    (should be tested by clockdriver)
 3448  2844  
 3448  2844       rl  w2     b73    ;    intno := max external interrupt number;
 3449  2846  i0:  gp  w2     b95    ; rep: clear (intno) in cpu;
 3450  2848       al  w2  x2-1      ;    intno := intno - 1;
 3451  2850       sl  w2     6+1    ;    if intno > powerfail then
 3452  2852       jl.        i0.    ;      goto rep;
 3453  2854       al  w1     0      ;    (prepare a new h0...)
 3454  2856  
 3454  2856       je.        +2     ;    (if any power fail during this start up,
 3455  2858       jd.        +2     ;      it will be 'serviced' now, i.e. systemfault)
 3456  2860  
 3456  2860  ; the following sequence of instructions have to be executed
 3457  2860  ; without any disturbance, else the system won't work
 3458  2860       rs. w1     h0.    ;    clear previous power up element;
 3459  2862                         ;    (i.e. prevent two consecutive powerups)
 3460  2862       gp  w3     b91    ;    inf := power up element;
 3461  2864       ri         a179   ;    return interrupt;
 3462  2866                         ;    (the limit-copies must be initialized)
 3463  2866  e.                     ; end of power fail/restart
 3464  2866  
 3464  2866  
 3464  2866  ; parameter errors in monitor call:
 3465  2866  ;
 3466  2866  ; all monitor procedures check that the parameters are
 3467  2866  ;    within certain limits.
 3468  2866  ; if the parameters are wrong, the calling process is break'ed.
 3469  2866  ;
 3470  2866  ; (all regs irrellevant)
 3471  2866  
 3471  2866  b. j10 w.              ;
 3472  2866  ; definitin of exception regdump:
 3473  2866  j0 = a29 - a28         ; w0, w1
 3474  2866  j1 = a31 - a28         ; w2, w3
 3475  2866  j2 = a33 - a28         ; status, ic
 3476  2866  j3 = a177- a28         ; cause, sb
 3477  2866  a180 = j3 + 2          ; top of exception regdump = new rel ic
 3478  2866  j4:  c2                ;
 3479  2868  
 3479  2868  c28 :                  ; internal 3:
 3480  2868       rl  w1     b1     ;
 3481  2870       rs  w3  x1+a339   ;    make footprint!
 3482  2872       al  w3     6      ;
 3483  2874       rs  w3  x1+a176   ;    cause (cur) := 6; i.e. monitor call break;
 3484  2876  
 3484  2876       rl  w2  x1+a27    ;    w2 := exception address (cur);
 3485  2878       sn  w2     0      ;    if exception address = 0 then
 3486  2880       jl.        (j4.)  ;      goto internal interrupt;
 3487  2882       al  w3    x2      ; save w2 and
 3488  2884       jl  w2    (b31)   ; call errorlog
 3489  2886       al  w2    x3      ; restore w2
 3490  2888  
 3490  2888       wa  w2  x1+a182   ;    w2 := abs exception address;
 3491  2890  
 3491  2890       dl  w0  x1+a29    ;    move:  save w0
 3492  2892       ds  w0  x2+j0     ;           save w1
 3493  2894       dl  w0  x1+a31    ;           save w2
 3494  2896       ds  w0  x2+j1     ;           save w3
 3495  2898       dl  w0  x1+a33    ;           save status
 3496  2900       ds  w0  x2+j2     ;           save ic
 3497  2902  ;    rs  w0  x1+a28    ;    save w0 := save ic;
 3498  2902  ;    al  w0     14<2+0 ;
 3499  2902  ;    rs  w0  x1+a29    ;    save w1 := 'jd'-instruction;
 3500  2902       dl  w0  x1+a177   ;           save cause (= 6)
 3501  2904       ds  w0  x2+j3     ;           save sb   to user exception addres;
 3502  2906  ;    rs  w0  x1+a30    ;    save w2 := save sb;
 3503  2906  ;    rs  w3  x2+a31    ;    save w3 := save cause (= 6);
 3504  2906       ws  w2  x1+a182   ;    w2 := logic user exception address;
 3505  2908       al  w2  x2+a180   ;
 3506  2910       rs  w2  x1+a33    ;    save ic := exception address + no of regdump bytes
 3507  2912       jl         c99    ;  goto interrupt return
 3508  2914  e.                     ;
 3509  2914  
 3509  2914  
 3509  2914  
 3509  2914  ; answer device operation
 3510  2914  ;
 3511  2914  ; the controller has delivered an answer to a 'device operation' 
 3512  2914  ; message. prepare the RC8000/RC9000 answer
 3513  2914  ;
 3514  2914  ;        call
 3515  2914  ;  w0    result
 3516  2914  ;  w1    main
 3517  2914  ;  w2    -
 3518  2914  ;  w3    function < 1
 3519  2914  
 3519  2914  b.   i10, j30  w.         ; answer device operation
 3520  2914  c47:                      ; begin
 3521  2914       ds. w1     i1.       ;
 3522  2916       al  w0  x3           ;
 3523  2918       jl. w3     d156.     ;   decrease no_of_outstanding;
 3524  2920       rl  w2  x1+a501      ;   message := main.message_buffer;
 3525  2922       rl. w3     i6.       ;
 3526  2924       sl  w3     5         ;   if result >= 5 then
 3527  2926       jl        -1         ;      panic;
 3528  2928       rl. w0     i6.       ;
 3529  2930       ls  w0     9         ;   message.state.result:=
 3530  2932       lo  w0  x2+a138      ;   message.state.result or last_result;
 3531  2934       hs  w0  x2+a138+1    ;
 3532  2936       ls  w3    +1         ;   case result of
 3533  2938       jl.    (x3+j5.)      ; 
 3534  2940                            ;
 3535  2940  j5:            -1         ; 0 ; -
 3536  2942           j6               ; 1 ; ok
 3537  2944                 -1         ; 2 ; -
 3538  2946           j15              ; 3 ; unintelligible
 3539  2948           j15              ; 4 ; malfunction
 3540  2950                            ;
 3541  2950  j6:                       ;   ok:
 3542  2950                            ;   -----
 3543  2950       zl  w0  x2+a138+1    ;   begin
 3544  2952       al  w3     2.0100000 ;
 3545  2954       sz  w0  x3           ;     if message.state.answer = 0 then
 3546  2956       jl.        j7.       ;     begin
 3547  2958                            ;
 3548  2958       lo  w0     6         ;       message.state := message.state or answer;
 3549  2960       hs  w0  x2+a138+1    ;
 3550  2962       dl  w0  x1+a520+a151 ;       <* move answer from main.mess_0 - mess_7
 3551  2964       ds  w0  x2+a151      ;          to message.mess_0 - mess_7 *>
 3552  2966       dl  w0  x1+a520+a153 ;
 3553  2968       ds  w0  x2+a153      ;
 3554  2970       dl  w0  x1+a520+a155 ;
 3555  2972       ds  w0  x2+a155      ;
 3556  2974       dl  w0  x1+a520+a157 ;
 3557  2976       ds  w0  x2+a157      ;
 3558  2978                            ;
 3559  2978       jl.        j9.       ;     end
 3560  2980  j7:                       ;     else
 3561  2980                            ;     begin
 3562  2980       rl  w3  x1+a520+a150 ;       if not statuserror then
 3563  2982       sn  w3     0         ;       begin
 3564  2984       sz  w0     -1024     ;         if result=1 then
 3565  2986       jl.        j4.       ;         begin
 3566  2988       rl  w0  x1+a520+a152 ;
 3567  2990       wa  w0  x2+a152      ;           message.octet_count :=
 3568  2992       rs  w0  x2+a152      ;           message.octet_count + main.mess_2;
 3569  2994  j4:                       ;         end;
 3570  2994                            ;       end;
 3571  2994       rl  w0  x2+a150      ;       <* w3 = new status *>
 3572  2996       sn  w0     0         ;       if old statuserror then
 3573  2998       rs  w3  x2+a150      ;       skip new status;
 3574  3000       rl  w0     b219      ;
 3575  3002       la  w0  x1+a500      ;       check := main.gen_info.check;
 3576  3004       sn  w0     0         ;       if check then
 3577  3006       jl.        j8.       ;       begin
 3578  3008                            ;
 3579  3008       rl  w0  x1+a520+a150 ;         <* move mess_0, mess_3 - mess_7 to
 3580  3010       rs  w0  x2+a150      ;            message *>
 3581  3012       dl  w0  x1+a520+a154 ;
 3582  3014       ds  w0  x2+a154      ;
 3583  3016       dl  w0  x1+a520+a156 ;
 3584  3018       ds  w0  x2+a156      ;
 3585  3020       rl  w0  x1+a520+a157 ;
 3586  3022       rs  w0  x2+a157      ;
 3587  3024  j8:                       ;       end <* check = 0 *>
 3588  3024  j9:                       ;     end
 3589  3024       jl.        j18.      ;
 3590  3026                            ;   end <* ok *>
 3591  3026                            ;
 3592  3026  j15:                      ;   unintelligible:
 3593  3026                            ;   malfunction:
 3594  3026                            ;   ---------------
 3595  3026       al  w0     2.0100000 ;   begin
 3596  3028       lo  w0  x2+a138      ;
 3597  3030       hs  w0  x2+a138+1    ;     message.state := message.state or answer;
 3598  3032                            ;
 3599  3032  ;    al  w0     0         ;     message.octet_count := 0;
 3600  3032  ;    rs  w0  x2+a152      ;
 3601  3032                            ;
 3602  3032       jl.        j18.      ;   end <* unintelligible, malfunction *>
 3603  3034                            ;
 3604  3034                            ;
 3605  3034  j18:                      ;   common:
 3606  3034                            ;   -------
 3607  3034                            ;   begin
 3608  3034                            ; ------> 8000 special <------
 3609  3034       rl  w3  x1+a235      ;     
 3610  3036       rl  w0  x1+a10       ;     device_address := main.device_address;
 3611  3038       al  w1     2         ;
 3612  3040       se  w0     q26       ;     if main.kind <> ifp then
 3613  3042       am         2.11<1    ;        answer_device(normal)
 3614  3044       do  w1  x3+0         ;     else
 3615  3046       rl. w1     i1.       ;        answer_device(ifp);
 3616  3048                            ; ------> end 8000 special <------
 3617  3048       zl  w0  x2+a138+0    ;     <* don't use com_area any more *>
 3618  3050       bs. w0     1         ;
 3619  3052       hs  w0  x2+a138+0    ;     message.count := message.count - 1;
 3620  3054                            ;
 3621  3054       al  w3     2.0000100 ;
 3622  3056       la  w3  x2+a138      ;     if message.count = 0 and
 3623  3058       sn  w0     0         ;        message.state = transfer_completed then
 3624  3060       sn  w3     0         ;     begin
 3625  3062       jl.        j25.      ;
 3626  3064                            ;
 3627  3064       rl  w3  x2+a141      ;       if message.receiver <> 2 then
 3628  3066       sn  w3     2         ;       begin 
 3629  3068       jl.        j20.      ;         <* if message was sent to an area which is
 3630  3070       sh  w3     0         ;            removed during the operation a result 2
 3631  3072       ac  w3  x3           ;            is inserted in the message *>
 3632  3074       se  w3 (x3+a50)      ;         if receiver.main = receiver then
 3633  3076       jl.        j19.      ;         begin   <* receiver is a mainprocess *>
 3634  3078       rl  w3     b21       ;           driverproc := receiver.driverproc;
 3635  3080       zl  w0  x3+a19       ;           driverproc.buffer_claim :=
 3636  3082       ba. w0     1         ;           driverproc.buffer_claim + 1;
 3637  3084       hs  w0  x3+a19       ;        end;
 3638  3086  j19:                      ;
 3639  3086       se  w2 (x1+a200)     ;         if message = main.prepare_dump_message then
 3640  3088       jl.        j20.      ;         begin
 3641  3090       rl  w2  x1+a201      ;
 3642  3092       rl  w1     b21       ;
 3643  3094       jl  w3     d124      ;           remove_reserver(driverproc, main.dump_device);
 3644  3096       al  w0     0         ;
 3645  3098       rl. w1     i1.       ;
 3646  3100       rs  w0  x1+a200      ;           main.prepare_dump_message := 0;
 3647  3102       rs  w0  x1+a201      ;           main.dump_device := 0;
 3648  3104                            ;         end;
 3649  3104                            ;       end;
 3650  3104  j20:                      ;
 3651  3104       zl  w0  x2+a138+1    ;       if message.state.io then
 3652  3106       so  w0     2.0000001 ;       begin
 3653  3108       jl.        j22.      ;
 3654  3110       jl  w3     d132      ;         decrease_stopcount(message);
 3655  3112       rl. w1     i1.       ;
 3656  3114       rl  w2  x1+a501      ;
 3657  3116                            ;
 3658  3116       dl  w0  x2+a152      ;
 3659  3118       se  w0     0         ;       
 3660  3120       se  w3     0         ;
 3661  3122       jl.        j22.      ;
 3662  3124       es. w0     1         ;         if message.hw_transfered = 0 and
 3663  3126       wd  w0     g48       ;            message.bytecount <> 0 then
 3664  3128       ea. w0     1         ;            mess.hw :=(((mess.bytes-1)/3)+1)*2
 3665  3130       ls  w0     1         ;
 3666  3132       rs  w0  x2+a151      ;       end;
 3667  3134  j22:                      ;
 3668  3134  ;    rl. w0     i6.       ;
 3669  3134       zl  w0  x2+a138+1    ;
 3670  3136       sh  w0     8.1777    ;       if result=ok then
 3671  3138       jl.        j23.      ;         goto result1
 3672  3140       sz  w0     -2048     ;       if intervention then
 3673  3142       am         1         ;         result:=4;
 3674  3144       am         2         ;         else result:=3;
 3675  3146  j23: al  w0     1         ; result1: result:=1;
 3676  3148       jl. w3     d15.      ;       deliver_answer(message);
 3677  3150                            ;     end;
 3678  3150  j25:                      ;
 3679  3150       jl.        j30.      ;   end;
 3680  3152                            ;
 3681  3152  i6:  0                    ;-2: result
 3682  3154  i1:  0                    ; 0: save main
 3683  3156  
 3683  3156                            ; end; 
 3684  3156  
 3684  3156  ; deliver interrupt to itc-main
 3685  3156  ; sets io result = 0 and continues with deliver interrupt
 3686  3156  
 3686  3156  c48:
 3687  3156  
 3687  3156  c.l53  b.  f4  w.         ; ****** test 41 ******
 3688  3156       rs. w3     f1.       ;
 3689  3158       al  w1  x2-a241      ; 
 3690  3160       rs. w1     f0.       ;
 3691  3162       jl. w3    (f3.)      ;
 3692  3164       41                   ;
 3693  3166  f0:  0                    ; main
 3694  3168  f1:  0                    ;
 3695  3170       jl.        f2.       ;
 3696  3172       al  w0  x1+a500      ; dump main.communication area
 3697  3174       al  w1  x1+a517      ;
 3698  3176       jl. w3    (f4.)      ;
 3699  3178       jl.        f2.       ;
 3700  3180  f3:  d150                 ;
 3701  3182  f4:  d151                 ;
 3702  3184  f2:                       ;
 3703  3184  e.z.                      ; ****** end test 47 ******
 3704  3184  
 3704  3184       al  w2  x1+a242      ;
 3705  3186       se  w2  (x2)         ; if in queue then
 3706  3188       jl  w3     d5        ;   remove from queue
 3707  3190       al  w0     0        ; io result 0
 3708  3192       al  w3     c99      ;
 3709  3194       jl         d121     ; got to deliver interrupt and goto reutrn from interrupt
 3710  3196  
 3710  3196  
 3710  3196  j30: rl. w1     i1.      ;
 3711  3198       rl  w0  x1+a78      ;
 3712  3200       so  w0     2.010000 ; if not busy then
 3713  3202       jl         c42      ; continue with check main queue
 3714  3204       jl         c99      ; else goto return from interrupt;
 3715  3206  e.
 3716  3206  \f


 3716  3206  
 3716  3206  m.
 3716  3206                  monprocs - monitor procedures 17.0 beta

 3717  3206  ;--------------------------------------------------------------------------
 3718  3206  ;                      REVISION HISTORY 
 3719  3206  ;--------------------------------------------------------------------------
 3720  3206  ; DATE      TIME OR            DESCRIPTION
 3721  3206  ;           RELEASE
 3722  3206  ;--------------------------------------------------------------------------
 3723  3206  ;88.03.24 14.1A HSI  start of description
 3724  3206  ;                      remove double definition of l30-l46
 3725  3206  ;                      insert csp-printer in driver and reserver table
 3726  3206  ;                      error in reserve table (no reserve check for kind >18
 3727  3206  ;                      error causing overwriting of procfunc code 
 3728  3206  ;                      new operation to csp-terminal: 6<12+1 : write 'unknown'
 3729  3206  ;                      ifp-operation answer disconnect set mess buf = 0
 3730  3206  ;88.03.24 16.14 HSI    new monitorcall: set number of processors
 3731  3206  ;88.04.11 13.07 HSI     -- " --  " --   if number of processers > 1 
 3732  3206  ;                        then addr 66 = -1000
 3733  3206  ;88.04.19 15.0  TSH    Alle device drivers replaced by RC8500 device drivers,
 3734  3206  ;                      and the procedures d140 - d154 updated/added to
 3735  3206  ;                      reflect the new protocol.
 3736  3206  ;                      monitor procedures reserve/release process have been
 3737  3206  ;                      updated.
 3738  3206  ;88.04.24 14.27 HSI    count max. number of processors in monitor call 34
 3739  3206  ;88.05.24 07.50 kak    change of cpa and address base included
 3740  3206  ;88.06.08       TSH    update of drivers due to changed protocol
 3741  3206  ;                      update of monitor procedure start_controller (force
 3742  3206  ;                      parameter).
 3743  3206  ;88.06.20 10.15 TSH    sspmain included
 3744  3206  ;88 07 05 10.57 HSI    release process: if not reserved then no mess to
 3745  3206  ;                      controller
 3746  3206  ;88 07 31 10.07 kak    new value of source in set_up (d153)
 3747  3206  ;88 08 08 15.23 kak    sense operation to ifpmain inserted
 3748  3206  ;88 08 16 13.36 hsi    insert timeout-check on operaions to main
 3749  3206  ;88 09 05 12.35 hsi    d30: insert driverproc as receiver if link is removed
 3750  3206  ;88 09 11 15.31        REINSERT corrections to d155 and d156 (second time)
 3751  3206  ;88 09 21 13.42        regret (d154) increase number of outstanding operations
 3752  3206  ;88 09 25 12.15 hsi    reserve/release: - - - " - - - " - - - " - - - " - - -
 3753  3206  ;88 09 26 08.59 hsi    set no. of proc.: (e17) skip call if not mp
 3754  3206  ;88 11 25 12.53 kak    error in generel copy corrected
 3755  3206  ;89 01 12 14.48  kak   error in reset main correctet
 3756  3206  ;89 02 22 09.36 kak    set w2 unchanged at return from d155 (increase no of outstanding)
 3757  3206  ;                      the correction just mentioned (890112) may then be cancelled
 3758  3206  ;                      test_ready_and_set_up :the condition before the call of clean_after_buserror corrected
 3759  3206  ;89 03 15 15.53 kak    no lock unlock in driverproc
 3760  3206  ;                      driverproc is only locked the very first time it is started
 3761  3206  ;89 03 26 10.17 kak  call of procfunc changed: area claim is checked before call of prepare bs
 3762  3206  ;89 04 07 14.35 HSI error in errorlog!. regret is answered with break 6
 3763  3206  ;--------------------------------------------------------------------------
 3764  3206  ;89 04 07 15.31            START OF RELEASE 16.0
 3765  3206  ;89 04 07 15.31 hsi  logical volumes: 
 3766  3206  ;89 04 19 13.02 hsi  (insert correction from 15.1: lock/unlock)
 3767  3206  ;89 04 27 14.53 hsi  answer createlink with result <> 0: no linkproces in mess.
 3768  3206  ;89 05 01 14.57 hsi  (correct check above) (r 15.1)
 3769  3206  ;89 05 25 14.14 kak call of deliver answer changed: result must not be set in receiver field, but kept in w0
 3770  3206  ;                   count of outstanding message for area processes introducted: increased in deliver message
 3771  3206  ;                   and decreased in deliver answer
 3772  3206  ;89 11 21 15 17 kak  new footprint included at break 6 (jl w3 c29)
 3773  3206  ;--------------------------------------------------------------------------
 3774  3206  ;90 05 29 15.28            START OF RELEASE 17.0
 3775  3206  ;90 05 29 15.29 kak errorlog prepared for errors from ioc and lan
 3776  3206  ;90 06 22 11.50 kak an error in errorlog corrected: add base before copy to ip addr
 3777  3206  ;90 07 05 09.52 kak contr. slave and main inserted in errorlog buffer
 3778  3206  ;90 08 30 10.00 kak an error in errorlog (move words) corrected
 3779  3206  ;90 09 06 14.39 kak the exam queue call in errorlog is replaced with a local procedure
 3780  3206  ;91 01 08 09.35 kak an error in errorlog corrected: status,ic,cause,sb was not dumped
 3781  3206  ;91 01 10 13.00 kak an error in errorlog corrected: wrong offset to g20 when called from driverproc 
 3782  3206  ;91 01 16 11.59 hsi driverproc: if interrupt in queue then take it before mess.
 3783  3206  ;91 01 22 11.00 hsi allow reading from reserved processes if function bit 9 & 10
 3784  3206  ;					equals 01. (d141)
 3785  3206  ;91 02 13 10.26 kak je-jd removed from clock driver code
 3786  3206  ;91 05 02 09.06 kak check op=input when allowing reading from reserved processes
 3787  3206  b.i30 w.
 3788  3206  i0=91 05 02
 3789  3206  i1=09 06 00 
 3790  3206  
 3790  3206  ; if newtime (i0,i1) > oldtime (a133,a134) then oldtime:=newtime;
 3791  3206  c.i0-a133
 3792  3206    c.i0-a133-1, a133=i0, a134=i1, z.
 3793  3206    c.i1-a134-1,          a134=i1, z.
 3794  3206  z.
 3795  3206  
 3795  3206  i10=i0, i20=i1
 3796  3206  
 3796  3206  i15=i10/100000 , i10=i10-i15*100000 , i25=i20/100000 , i20=i20-i25*100000 
 3797  3206  i14=i10/10000  , i10=i10-i14*10000  , i24=i20/10000  , i20=i20-i24*10000 
 3798  3206  i13=i10/1000   , i10=i10-i13*1000   , i23=i20/1000   , i20=i20-i23*1000
 3799  3206  i12=i10/100    , i10=i10-i12*100    , i22=i20/100    , i20=i20-i22*100
 3800  3206  i11=i10/10     , i10=i10-i11*10     , i21=i20/10     , i20=i20-i21*10
 3801  3206  
 3801  3206  i2:  <:                              date  :>
 3802  3230       (:i15+48:)<16+(:i14+48:)<8+46
 3803  3232       (:i13+48:)<16+(:i12+48:)<8+46
 3804  3234       (:i11+48:)<16+(:i10+48:)<8+32
 3805  3236  
 3805  3236       (:i25+48:)<16+(:i24+48:)<8+46
 3806  3238       (:i23+48:)<16+(:i22+48:)<8+46
 3807  3240       (:i21+48:)<16+(:i20+48:)<8+ 0
 3808  3242  
 3808  3242  i3:  al. w0  i2.       ; write date:
 3809  3244       rs  w0  x2+0      ;   first free:=start(text);
 3810  3246       al  w2  0         ;
 3811  3248       jl      x3        ;   return to slang(status ok);
 3812  3250  
 3812  3250       jl.     i3.       ;
 3813  3252  e.
 3814  3252  j.
 3814  3206                                date  91.05.02 09.06.00

 3815  3206  b. h30 w.
 3816  3206  \f


 3816  3206  
 3816  3206  ; list of monitor procedures:
 3817  3206  b16:      ; start:
 3818  3206  
 3818  3206  e0        ;   0 : set interrupt
 3819  3208  e1        ;   2 : reset, priv
 3820  3210  e2        ;   4 : process description  5 : own process description;
 3821  3212  e3        ;   6 : initialise process
 3822  3214  e4        ;   8 : reserve process
 3823  3216  e5        ;  10 : release process
 3824  3218  e6        ;  12 : include user
 3825  3220  e7        ;  14 : exclude user
 3826  3222  e8        ;  16 : send message
 3827  3224  e9        ;  18 : wait answer
 3828  3226  e10       ;  20 : wait message
 3829  3228  e11       ;  22 : send answer
 3830  3230  e12       ;  24 : wait event
 3831  3232  e13       ;  26 : get event
 3832  3234  e14       ;  28 : test users , reserver, and writeprotection
 3833  3236  e15       ;  30 : set writeprotect
 3834  3238  e16       ;  32 : remove writeprotect
 3835  3240  e17       ;  34 : set number of processors
 3836  3242  e18       ;  36 : get clock
 3837  3244  e19       ;  38 : set clock
 3838  3246  e20       ;  40 : create entry
 3839  3248  e21       ;  42 : lookup entry
 3840  3250  e22       ;  44 : change entry
 3841  3252  e23       ;  46 : rename entry
 3842  3254  e24       ;  48 : remove entry
 3843  3256  e25       ;  50 : permanent entry
 3844  3258  e26       ;  52 : create area process
 3845  3260  e27       ;  54 : create peripheral process
 3846  3262  e28       ;  56 : create internal process
 3847  3264  e29       ;  58 : start internal process
 3848  3266  e30       ;  60 : stop internal process
 3849  3268  e31       ;  62 : modify internal process
 3850  3270  e32       ;  64 : remove process
 3851  3272  e33       ;  66 : test event
 3852  3274  e34       ;  68 : generate name
 3853  3276  e35       ;  70 : copy
 3854  3278  e36       ;  72 : set catalog base
 3855  3280  e37       ;  74 : set entry base
 3856  3282  e38       ;  76 : lookup head and tail
 3857  3284  e39       ;  78 : set backing storage claims
 3858  3286  e40       ;  80 : create pseudo process
 3859  3288  e41       ;  82 : regret message
 3860  3290  e42       ;  84 : general copy
 3861  3292  e43       ;  86 : lookup aux entry
 3862  3294  e44       ;  88 : clear statistics in entry
 3863  3296  e45       ;  90 : permanent entry in aux catalog
 3864  3298  e46       ;  92 : create entry lock process
 3865  3300  e47       ;  94 : set priority
 3866  3302  e48       ;  96 : relocate process
 3867  3304  e49       ;  98 : set address base
 3868  3306  e50       ; 100 : start io
 3869  3308  e51       ; 102 : prepare backing storage
 3870  3310  e52       ; 104 : insert entry
 3871  3312  e53       ; 106 : insert backing storage
 3872  3314  e54       ; 108 : delete backing storage
 3873  3316  e55       ; 110 : delete entries
 3874  3318  e56       ; 112 : connect main catalog
 3875  3320  e57       ; 114 : remove main catalog
 3876  3322  c29       ; 116 : not used
 3877  3324  e59       ; 118 : lookup bs claims
 3878  3326  e60       ; 120 : create aux entry and area process
 3879  3328  e61       ; 122 : remove aux entry
 3880  3330  e62       ; 124 : send pseudo message
 3881  3332  e63       ; 126 : set cpa
 3882  3334  e64       ; 128 : start controller
 3883  3336  e65       ; 130 : stop message
 3884  3338  c29       ; 132 :not used
 3885  3340  e67       ; 134 :  emergency stop
 3886  3342  
 3886  3342  b17=k-b16 ; max monitor call number
 3887  3342  
 3887  3342  b80: 0, r.(:b17+2:)    ; monitor call count table
 3888  3618  \f


 3888  3618  
 3888  3618  ; ********** driver block ************
 3889  3618  ;
 3890  3618  
 3890  3618  ; ***** controller device driver entry table *****
 3891  3618  
 3891  3618  b55:      ; 
 3892  3618            ; start of first part of device driver entry tabel
 3893  3618            ;
 3894  3618  -1        ;   0 ; undef.
 3895  3620  -1        ;   2 ; undef.
 3896  3622  h4        ;   4 ; area driver
 3897  3624  h6        ;   6 ; disc driver
 3898  3626  h8        ;   8 ; csp_terminal
 3899  3628  -1        ;  10 ; undef.
 3900  3630  -1        ;  12 ; undef.
 3901  3632  h14       ;  14 ; printer
 3902  3634  -1        ;  16 ; undef.
 3903  3636  h18       ;  18 ; magnetic tape driver
 3904  3638  -1        ;  20 ; undef. (ioc mainprocess: 1st part executed in driverproc)
 3905  3640  -1        ;  22 ; undef.
 3906  3642  -1        ;  24 ; undef.
 3907  3644  -1        ;  26 ; undef. (dlc mainprocess: 1st part executed in driverproc)
 3908  3646  h28       ;  28 ; ifp general sequential device (gsd)
 3909  3648                  ;
 3910  3648  
 3910  3648  
 3910  3648  ; ***** controller device driver entry table: setup part *****
 3911  3648  
 3911  3648  b56:      ; start of second part of device driver entry table
 3912  3648            ;
 3913  3648  h1        ;   0 ; special (reserve/release process)
 3914  3650  -1        ;   2 ; undef.
 3915  3652  h5        ;   4 ; area driver setup
 3916  3654  h7        ;   6 ; disc driver setup
 3917  3656  h9        ;   8 ; csp_terminal
 3918  3658  -1        ;  10 ; undef.
 3919  3660  -1        ;  12 ; undef.
 3920  3662  h15       ;  14 ; printer
 3921  3664  -1        ;  16 ; undef.
 3922  3666  h19       ;  18 ; magnetic tape driver setup
 3923  3668  h21       ;  20 ; ioc mainprocess driver setup
 3924  3670  -1        ;  22 ; undef.
 3925  3672  -1        ;  24 ; undef.
 3926  3674  h27       ;  26 ; dlc mainprocess driver setup
 3927  3676  h29       ;  28 ; gsd driver setup
 3928  3678  
 3928  3678  
 3928  3678  ; ***** controller device driver: reservation requirements *****
 3929  3678  b57:
 3930  3678  0                                ;   0 ;
 3931  3680  0                                ;     ;
 3932  3682  0                                ;   2 ;
 3933  3684  0                                ;     ;
 3934  3686  a0>5 + a0>18                     ;   4 ; area: output + security erase 
 3935  3688  0                                ;     ;
 3936  3690  a0>5+a0>6+a0>10+a0>12+a0>16+a0>18+a0>21;   6 ; disc: output,format,power up,remove logical volume, power down
 3937  3692                                         ;       security erase,write data and ecc
 3938  3692  a0>(:29-24:)                     ;     ;       write defect list
 3939  3694  0                                ;   8 ; 
 3940  3696  0                                ;     ;
 3941  3698  0                                ;  10 ;
 3942  3700  0                                ;     ;
 3943  3702  0                                ;  12 ;
 3944  3704  0                                ;     ;
 3945  3706  -1                               ;  14 ; printer: reservation always needed
 3946  3708  -1                               ;     ;
 3947  3710  0                                ;  16 ;
 3948  3712  0                                ;     ;
 3949  3714  -1                               ;  18 ; tape: reservation always needed
 3950  3716  -1                               ;     ;
 3951  3718  0                                ;  20 ;
 3952  3720  0                                ;     ;
 3953  3722  0                                ;  22 ;
 3954  3724  0                                ;     ;
 3955  3726  0                                ;  24 ;
 3956  3728  0                                ;     ;
 3957  3730  0                                ;  26 ;
 3958  3732  0                                ;     ;
 3959  3734  -1                               ;  28 ; gsd: reservation always needed
 3960  3736  -1                               ;     ;
 3961  3738  
 3961  3738  
 3961  3738  ; ***** definition of states for processes *****
 3962  3738  ;
 3963  3738  
 3963  3738  l36 = 0            ; 0 = free
 3964  3738  l37 = 1            ; 1 = during connect
 3965  3738  l38 = 2            ; 2 = connected
 3966  3738  l39 = 3            ; 3 = during disconnect
 3967  3738  l40 = 4            ; 4 = intervention
 3968  3738  
 3968  3738  
 3968  3738  ; ***** definiton of states for magnetic tape *****
 3969  3738  ;
 3970  3738  
 3970  3738  l45 = 1            ;  no document mounted
 3971  3738  l46 = 2            ;  unidentified document mounted
 3972  3738  l47 = 0            ;  identified document mounted
 3973  3738  
 3973  3738  \f


 3973  3738  
 3973  3738  ; *************************************************************************
 3974  3738  ;
 3975  3738  ; common procedures used by device drivers for devices connected through
 3976  3738  ; IOC/DLC controllers.
 3977  3738  ;
 3978  3738  ; *************************************************************************
 3979  3738  
 3979  3738  ;
 3980  3738  ; procedure check operation(message);
 3981  3738  ; -----------------------------------
 3982  3738  ;
 3983  3738  ; the user or reserver requirements of the receiver of the specified message
 3984  3738  ; is checked in accordance with the operation and the device kind of the 
 3985  3738  ; receiver.
 3986  3738  ;
 3987  3738  ; note: the message must not be claimed.
 3988  3738  ;
 3989  3738  ;          call                 return
 3990  3738  ;
 3991  3738  ; w0        -                   unchanged
 3992  3738  ; w1        -                   unchanged
 3993  3738  ; w2      message               message
 3994  3738  ; w3      link                  destroyed
 3995  3738  ;
 3996  3738  ; return:  link + 0: error, message.sender not user or reserver of
 3997  3738  ;                           message.receiver as required.
 3998  3738  ;          link + 2: ok.
 3999  3738  ;
 4000  3738  
 4000  3738  b. i5, j5  w.
 4001  3738  
 4001  3738  d141:                  ; check operation (message);
 4002  3738       ds. w1     i1.    ; begin
 4003  3740       ds. w3     i3.    ;
 4004  3742       rl  w1  x2+a142   ;
 4005  3744       rl  w2  x2+a141   ;
 4006  3746       rl  w3  x2+a10    ;    w3:=kind
 4007  3748       se  w3     q8     ;    if not csp terminal then
 4008  3750       jl.        j0.    ;    goto test user,reserver
 4009  3752       rl  w1     (b6)   ;    else exclude proc func
 4010  3754       jl  w3     d123   ;
 4011  3756       rl. w1     i2.    ;    w1:=saved w2
 4012  3758       rl  w1  x1+a142   ;    w1:=receiver
 4013  3760       jl  w3     d126   ;    include intproc (maybe procfunc !) as user
 4014  3762  j0:
 4015  3762       jl  w3     d113   ;   check reserver(sender, receiver);
 4016  3764       jl.        j4.    ;+0: other reserver: check function mask;
 4017  3766       jl.        j1.    ;+2: internal: ok return;
 4018  3768                         ;+4: no reserver: check requirements;
 4019  3768       rs. w1     i5.    ;
 4020  3770       rl  w3  x2+a10    ;    reserve_mask :=
 4021  3772       ls  w3     1      ;    if message.operation < 24 then
 4022  3774       am.       (i2.)   ;       reservation(receiver.kind)
 4023  3776       zl  w1    +a150   ;    else
 4024  3778       sh  w1     23     ;       reservation(receiver.kind + 2);
 4025  3780       jl.        j3.    ;
 4026  3782       al  w3  x3+2      ;
 4027  3784       al  w1  x1-24     ;
 4028  3786  j3:  rl. w0  x3+b57.   ;    if reserve_mask shift message.operation then
 4029  3788       ls  w0  x1        ;
 4030  3790       sh  w0    -1      ;      error return;
 4031  3792       jl.        j2.    ;
 4032  3794                         ;
 4033  3794  j5:  rl. w1     i5.    ;
 4034  3796       jl  w3     d102   ;   check user(sender, receiver);
 4035  3798       jl.        j2.    ;+0: not user: error return;
 4036  3800                         ;+2: user: ok return;
 4037  3800  j1:  dl. w3     i3.    ;   ok-return:
 4038  3802       al  w3  x3+2      ;
 4039  3804       sz                ;
 4040  3806  j2:  dl. w3     i3.    ;   error-return:
 4041  3808       dl. w1     i1.    ;
 4042  3810       jl      x3        ; 
 4043  3812                         ;
 4044  3812  j4:                    ; reserved by another: check op=input and  function bit 9,10:
 4045  3812       am.        (i2.)  ;
 4046  3814       zl  w0     +a150  ;
 4047  3816       se  w0     3      ; if op<>input then
 4048  3818       jl.        j2.    ; error return;
 4049  3820       zl  w0  x1+a22    ; check function bit 9,10:
 4050  3822       so  w0     2.100  ; if internal.function_mask(9) = 0 and
 4051  3824       so  w0     2.010  ; internal.function_mask(10) = 1 then
 4052  3826       jl.        j2.    ;     continue   
 4053  3828       jl.        j5.    ;   else error return.
 4054  3830  
 4054  3830       0                 ; save w0
 4055  3832  i1:  0                 ; save w1
 4056  3834  i2:  0                 ; save w2
 4057  3836  i3:  0                 ; save w3
 4058  3838  i4:  24                ; first operation in word 2 of b57
 4059  3840  i5:  0                 ; saved sender
 4060  3842  e.                     ; end;
 4061  3842  \f


 4061  3842  
 4061  3842  
 4061  3842  ; procedure test_ready_and_setup(force, message/proc);
 4062  3842  ; ----------------------------------------------------
 4063  3842  ;
 4064  3842  ; the state of the main-process for the proc or receiver specified in the
 4065  3842  ; message, is tested. if the state is 'ready' and the number of free
 4066  3842  ; buffers is above a certain low water mark the control is transfered
 4067  3842  ; to the setup procedure of the driver or the reserve/release setup-part.
 4068  3842  ; if the state of the main-process is 'communicating' or the number of
 4069  3842  ; free buffers is below the low water mark, the message/proc is linked
 4070  3842  ; to the waiting queue of the main process, and the control is transfered
 4071  3842  ; to the 'return from interrupt' procedure of the monitor.
 4072  3842  ; the linked message/proc will be transfered at a later time when a 'operation
 4073  3842  ; received' interrupt is received from the ioc/dlc controller and the
 4074  3842  ; number of free buffers is above the low water mark.
 4075  3842  ; if the state of the main-process is 'after error' then the specified
 4076  3842  ; message is answered with result 4 (receiver malfunction).
 4077  3842  ;
 4078  3842  ; the parameter 'force' will set the low water mark:
 4079  3842  ;     =  0 : the low water mark will reserve 2 buffers
 4080  3842  ;     <> 0 : the low water mark will be zero and no buffers is reserved.
 4081  3842  ; force should only be set in connection with regret and dump function/
 4082  3842  ; operations.
 4083  3842  ; if force = 2 the driver will be started independent of main.state
 4084  3842  ; (only to be used in reset operation)
 4085  3842  ; note on message:
 4086  3842  ;       at entry the message must have been claimed and it must not be in
 4087  3842  ;       any queue.
 4088  3842  ;
 4089  3842  ; note on proc:
 4090  3842  ;       at entry w2 must point at proc + a81 (done due to d149)
 4091  3842  ;
 4092  3842  ;          call
 4093  3842  ;
 4094  3842  ; w0      force
 4095  3842  ; w1        -
 4096  3842  ; w2      message/proc + a81
 4097  3842  ; w3        -
 4098  3842  ;
 4099  3842  
 4099  3842  b. i5, j10 w.
 4100  3842  
 4100  3842  d142:                  ; procedure test ready(force, message/proc);
 4101  3842       rs. w0     i4.    ; begin
 4102  3844       sl  w2    (b8+4)  ;
 4103  3846       sl  w2    (b8+6)  ;   if message then
 4104  3848       jl.        j4.    ;   begin
 4105  3850       sn  w0     0      ;
 4106  3852       jl.        j0.    ;
 4107  3854       al  w0  2.1000000 ;     if force then
 4108  3856       lo  w0  x2+a138   ;     begin
 4109  3858       hs  w0  x2+a138+1 ;       message.state := message.state or force;
 4110  3860       al  w0     0      ;       low_water := 0;
 4111  3862       sz                ;     end
 4112  3864  j0:  al  w0     2      ;       low_water := 2;
 4113  3866       rs. w0     i0.    ;     <* reserve a few for regret and dump *>
 4114  3868                         ;     <* element := message; *>
 4115  3868       rl  w1  x2+a141   ;
 4116  3870       sh  w1     0      ;
 4117  3872       ac  w1  x1        ;     proc := message.receiver;
 4118  3874       rl  w3  x1+a10    ;     driver_kind := message.receiver.kind;
 4119  3876                         ;
 4120  3876       jl.        j1.    ;   end
 4121  3878  j4:                    ;   else begin <* proc *>
 4122  3878       sn  w0     0      ;     low_water :=
 4123  3880       am         2      ;     if force then 0
 4124  3882       al  w0     0      ;              else 2;
 4125  3884       rs. w0     i0.    ;
 4126  3886       al  w3     0      ;     driver_kind := special; 
 4127  3888       al  w1  x2-a81    ;     <* element := proc *>
 4128  3890                         ;   end;
 4129  3890  ;
 4130  3890  j1:  rl  w0  x1+a10    ;   while proc.kind <> main_kind do
 4131  3892       se  w0     q20    ;     proc := proc.main;
 4132  3894       sn  w0     q26    ;
 4133  3896       jl.        j2.    ;
 4134  3898       rl  w1  x1+a50    ;
 4135  3900       jl.        j1.    ;
 4136  3902                         ;
 4137  3902  j2:  rl. w0     i4.    ;
 4138  3904       sl  w0     2      ;
 4139  3906       jl.        j6.    ;   if force = strong or
 4140  3908       rl  w0  x1+a78    ;
 4141  3910       sz  w0  2.110000  ;     (proc.state = ready and
 4142  3912       jl.        j3.    ;      proc.free_buffers > low_water) then
 4143  3914       ls  w0    -12     ;      goto setup_procedure(driver_kind);
 4144  3916       sh. w0     (i0.)  ;
 4145  3918       jl.        j3.    ;
 4146  3920  j6:  jl.    (x3+b56.)  ;
 4147  3922  j3:                    ;   else
 4148  3922       rl  w0  x1+a78    ;   if ok then
 4149  3924       sz  w0  2.100000  ;
 4150  3926       jl.        j5.    ;   begin
 4151  3928                         ;
 4152  3928       rl  w0  x1+a216   ;     ***** statistics *****
 4153  3930       ba. w0     1      ;     increment no of times controller was not ready
 4154  3932       rs  w0  x1+a216   ;     ***** statistics *****
 4155  3934       rl. w0     i0.    ;
 4156  3936       se  w0     0      ;     if force = no and
 4157  3938       sn  w2 (x2+a140)  ;        element.in_queue then
 4158  3940       sz                ;        return_from_interrupt
 4159  3942       jl         c99    ;     else
 4160  3944                         ;     begin
 4161  3944       jl  w3     d5     ;       unlink(element);
 4162  3946       al  w1  x1+a81    ;       <* if force then link in front of queue *>
 4163  3948       sn  w0     0      ;       head := if force then main.waiting_q.first
 4164  3950       rl  w1  x1+a140   ;               else main.waiting_q;
 4165  3952       jl  w3     d6     ;       link(head, element);
 4166  3954       jl         c99    ;       return_from_interrupt;
 4167  3956                         ;     end;
 4168  3956  j5:                    ;   end else
 4169  3956                         ;   begin
 4170  3956                         ;     <* state = after error or after reset *>
 4171  3956       sl  w2    (b8+4)  ;
 4172  3958       sl  w2    (b8+6)  ;     if element = message then
 4173  3960       sz                ;
 4174  3962       jl. w3     d152.  ;     clean after buserror(message);
 4175  3964       jl         c99    ;     goto return from interrupt;
 4176  3966                         ;   end;
 4177  3966                         ;
 4178  3966  i0:  0                 ; low_water
 4179  3968  i4:  0                 ; saved force;
 4180  3970  e.                     ; end;
 4181  3970  \f


 4181  3970  
 4181  3970  ; procedure prepare consecutive transfer(area, message, first logical segment);
 4182  3970  ; -----------------------------------------------------------------------------
 4183  3970  ; 
 4184  3970  ; the specified message is changed so it specifies an io transfer of
 4185  3970  ; as meny as possible consecutively placed segments.
 4186  3970  ; below is the used and changed fields of the message buffer specified:
 4187  3970  ;
 4188  3970  ; Note: message (w2) might be a pointer to a message-like structure
 4189  3970  ;       in the communication area of the main process.
 4190  3970  ;
 4191  3970  ;        + 0: 
 4192  3970  ;        + 2: 
 4193  3970  ; (a152) + 4: no of bytes (set)
 4194  3970  ; (a153) + 6: first segment on  physical disc (set)
 4195  3970  ; (a154) + 8: remaining segments (updated)
 4196  3970  ;        +10: 
 4197  3970  ;
 4198  3970  ;
 4199  3970  ;      call                    return
 4200  3970  ;
 4201  3970  ; w0   first logical segment   next logical segment
 4202  3970  ; w1   area process            area process
 4203  3970  ; w2   message buffer          message buffer
 4204  3970  ; w3   link                    remaining segments
 4205  3970  ;
 4206  3970  b. i10, j10 w.
 4207  3970   
 4207  3970  d143:                  ; procedure prepare consecutive transfer(area, message, first logical segment);
 4208  3970       ds. w3     i3.    ; begin
 4209  3972       ds. w1     i1.    ; 
 4210  3974       rl  w1  x1+a50    ;   save area.logical disc;
 4211  3976       rs. w1     i8.    ;
 4212  3978                         ;
 4213  3978       al  w3     0      ;
 4214  3980       wd  w0  x1+a72    ;   save first logical segment modulo slicelength;
 4215  3982       rs. w3     i5.    ;
 4216  3984       ws  w3  x1+a72    ;
 4217  3986       ac  w3  x3        ;   no_of_segm :=
 4218  3988       sl  w3 (x2+a154)  ;   if message.remaining segments < remaining in slice
 4219  3990       rl  w3  x2+a154   ;      then message.reamining segments 
 4220  3992       rs. w3     i4.    ;      else remaining in slice;
 4221  3994                         ;
 4222  3994                         ;   <* w0: logical slice no for slice which contains first segment *>
 4223  3994       rl. w3     i1.    ;
 4224  3996       rl  w2  x1+a71    ;
 4225  3998       wa  w2  x3+a60    ;
 4226  4000       jl  w3     d74    ;   follow chain(no of slices, first slice);
 4227  4002                         ;
 4228  4002       al  w0  x2        ;   message.first segment :=
 4229  4004       ws  w0  x1+a71    ;   slice number * slice length +
 4230  4006       wm  w0  x1+a72    ;   
 4231  4008       wa  w0  x1+a73    ;   logical disc.first segment +
 4232  4010       wa. w0     i5.    ;   first logical segment modulo slicelength;
 4233  4012       rl. w3     i2.    ;
 4234  4014       rs  w0  x3+a153   ;
 4235  4016                         ;   <* optimize transfer according to track size *>
 4236  4016       al  w3     0      ;   segm_on_track := message.first_segment mod
 4237  4018       wd  w0  x1+a75    ;                    disk.segments_pr_track;
 4238  4020       sn  w3     0      ;   if segm_on_track <> 0 then
 4239  4022       jl.        j0.    ;   begin
 4240  4024       ac  w3  x3        ;     max_transfer :=
 4241  4026       wa  w3  x1+a75    ;     disk.segments_pr_track - segm_on_track;
 4242  4028       sz                ;   end
 4243  4030  j0:  rl  w3  x1+a86    ;   else max_transfer := disk.max_transfer;
 4244  4032       rs. w3     i7.    ;
 4245  4034       rl. w3     i2.    ;
 4246  4036                         ;
 4247  4036       rl  w0  x3+a154   ;   remaining := message.remaining;
 4248  4038       rs. w0     i6.    ;
 4249  4040       rl. w3     i4.    ;   possible := no of segments; <* remaining in slice 
 4250  4042                         ;                                  or message.remaining *>
 4251  4042  j1:  zl  w0  x2+0      ;   while (slice) = 1 and
 4252  4044       sn  w0     1      ;
 4253  4046       sl. w3    (i6.)   ;   remaining > possible and
 4254  4048       jl.        j2.    ;
 4255  4050       sl. w3    (i7.)   ;   possible < max transfer do
 4256  4052       jl.        j2.    ;   begin
 4257  4054       wa  w3  x1+a72    ;     possible := possible + slicelength;
 4258  4056       al  w2  x2+1      ;     slice := slice + 1;
 4259  4058       jl.        j1.    ;   end;
 4260  4060                         ;
 4261  4060  j2:  sl. w3    (i6.)   ;   if possible > remaining then
 4262  4062       rl. w3     i6.    ;      possible := remaining;
 4263  4064       sn  w0     0      ;   if (slice) = 0 then
 4264  4066       rs. w3     i6.    ;      remaining := possible;
 4265  4068       sl. w3    (i7.)   ;   if possible > max transfer then
 4266  4070       rl. w3     i7.    ;      possible := max transfer;
 4267  4072                         ;
 4268  4072       rl. w2     i2.    ;
 4269  4074       al  w1  x3        ;   message.remaining segments :=
 4270  4076       ws. w3     i6.    ;           remaining - possible;
 4271  4078       ac  w3  x3        ;
 4272  4080       rs  w3  x2+a154   ;
 4273  4082                         ;
 4274  4082       rl. w0     i0.    ;   next logical segment :=
 4275  4084       wa  w0     2      ;   first logical segment + possible;
 4276  4086       rs. w0     i0.    ;
 4277  4088                         ;
 4278  4088       wm  w1     g48    ;   message.no of bytes :=
 4279  4090       ls  w1     8      ;   possible * 768;
 4280  4092       rs  w1  x2+a152   ;
 4281  4094                         ;
 4282  4094       dl. w1     i1.    ;
 4283  4096       jl.       (i3.)   ; return;
 4284  4098                         ;
 4285  4098  i0:  0                 ; save w0: first logical segment
 4286  4100  i1:  0                 ; save w1: area process
 4287  4102  i2:  0                 ; save w2: message buffer
 4288  4104  i3:  0                 ; save w3: link
 4289  4106  i4:  0                 ; no of segments
 4290  4108  i5:  0                 ; segment modulo slicelength
 4291  4110  i6:  0                 ; remaining segments
 4292  4112  i7:  0                 ; max transfer (rem. in track or disk.max_transfer)
 4293  4114  i8:  0                 ; logical/physical disk
 4294  4116                         ;
 4295  4116  e.                     ; end;
 4296  4116  \f


 4296  4116  
 4296  4116  ; procedure start_controller(main process);
 4297  4116  ; ----------------------------------------------------
 4298  4116  ;
 4299  4116  ; the controller represented by the specified main process is started.
 4300  4116  ; 
 4301  4116  ;          call                 return
 4302  4116  ;
 4303  4116  ; w0       -                    -
 4304  4116  ; w1       main process         main process
 4305  4116  ; w2       -                    unchanged
 4306  4116  ; w3       link                 link
 4307  4116  ;
 4308  4116  ; return: link + 0: rc8000 bus error, controller not started.
 4309  4116  ;         link + 2: controller started.
 4310  4116  ;
 4311  4116   
 4311  4116  b. i10, j10 w.
 4312  4116   
 4312  4116  d144:                  ; procedure start_controller(main process);
 4313  4116                         ; begin
 4314  4116  c.l53  b. f2  w.       ; ***** test 46 *****
 4315  4116       rs. w3     f1.    ;
 4316  4118       rs. w1     f0.    ;
 4317  4120       jl. w3     d150.  ;
 4318  4122       46                ;
 4319  4124  f0:  0                 ; < main process >
 4320  4126  f1:  0                 ;
 4321  4128       jl.        f2.    ;
 4322  4130       al  w0  x1+a550   ; < dump rc8000 to comm area >
 4323  4132       al  w1  x1+a567   ;
 4324  4134       jl. w3     d151.  ;
 4325  4136  f2:                    ;
 4326  4136  e.z.                   ; ***** end test 46 *****
 4327  4136       ds. w3     i3.    ;
 4328  4138       rl  w3  x1+a235   ;   <w3: device address>
 4329  4140       rl  w0  x1+a10    ;   if main.kind <> ifpmain then
 4330  4142       al  w2     1      ;      start controller(device addr + 'start')
 4331  4144       se  w0     q26    ;   else
 4332  4146       am         2.10<1 ;      start controller(device addr, ifp-start);
 4333  4148       do  w2  x3+0      ;
 4334  4150       sx      2.111     ;   if no exception then
 4335  4152       jl.        j1.    ;   begin
 4336  4154                         ;
 4337  4154       al  w3   2.010000 ;     mainproc.state :=
 4338  4156       lo  w3  x1+a78    ;     mainproc.state or busy;
 4339  4158       hs  w3  x1+a78+1  ;
 4340  4160       ls  w3    -12     ;     if not mainproc.geninfo.answer then
 4341  4162       al  w3  x3-1      ;        mainproc.free_buffers :=
 4342  4164       hl  w0  x1+a550+0 ;        mainproc.free_buffers - 1;
 4343  4166       so  w0   2.010000 ;
 4344  4168       hs  w3  x1+a78+0  ;
 4345  4170                         ;     ***** statistics *****
 4346  4170       dl  w0  x1+a217   ;
 4347  4172       ba. w0     1      ;     mainproc.no of operations :=
 4348  4174       sx         2.001  ;     mainproc.no of operations + 1;
 4349  4176       jl.        j4.    ;
 4350  4178       rs  w0  x1+a217   ;
 4351  4180       jl.        j3.    ;
 4352  4182  j4:  ba. w3     1      ;
 4353  4184       al  w0     0      ;
 4354  4186       ds  w0  x1+a217   ;
 4355  4188  j3:                    ;
 4356  4188       zl  w0  x1+a78+1  ;     if mainproc.state = in_chain then
 4357  4190       so  w0    2.001000;        mainproc.no of chained opr := 
 4358  4192       jl.        j2.    ;        mainproc.no of chained opr + 1;
 4359  4194       rl  w0  x1+a218   ;
 4360  4196       se  w0    -1      ;     <* stop counting when counter is full *>
 4361  4198       ba. w0     1      ;
 4362  4200       rs  w0  x1+a218   ;
 4363  4202  j2:                    ;     ***** statistics end *****
 4364  4202       dl. w3     i3.    ;
 4365  4204       jl      x3+2      ;     ok_return;
 4366  4206                         ;   end else
 4367  4206  j1:  al  w0    2.100000;   begin
 4368  4208       lo  w0  x1+a78    ;     mainproc.state := 
 4369  4210       hs  w0  x1+a78+1  ;     mainproc.state or not_ok; 
 4370  4212       dl. w3     i3.    ;
 4371  4214       jl      x3        ;     error_return;
 4372  4216                         ;   end;
 4373  4216                         ;
 4374  4216  i2:  0                 ; saved w2
 4375  4218  i3:  0                 ; saved w3
 4376  4220  e.                     ; end;
 4377  4220  \f


 4377  4220  
 4377  4220  ;
 4378  4220  ; procedure set_no_of_segments(message);
 4379  4220  ; ------------------------------------------
 4380  4220  ;
 4381  4220  ; the largest no of segments which the core area, specified by first and last
 4382  4220  ; storage address, may contain is computed and placed in message word +8.
 4383  4220  ;
 4384  4220  ;          call                return
 4385  4220  ;
 4386  4220  ; w0        -                  unchanged
 4387  4220  ; w1        -                  unchanged
 4388  4220  ; w2       message             message
 4389  4220  ; w3       link                destroyed
 4390  4220  ;
 4391  4220  
 4391  4220  b. i1, j1 w.
 4392  4220  
 4392  4220  d145:                  ; procedure set_no_of_segments(message);
 4393  4220       rs. w3     i0.    ; begin
 4394  4222       rl  w3  x2+a152   ;   message.no of segments :=
 4395  4224       al  w3  x3+2      ;   (last address - first address + 2)//512;
 4396  4226       ws  w3  x2+a151   ;
 4397  4228       ls  w3    -9      ;
 4398  4230       rs  w3  x2+a154   ;
 4399  4232       jl.       (i0.)   ;
 4400  4234                         ;
 4401  4234  i0:  0                 ; saved link
 4402  4236  e.                     ; end;
 4403  4236  \f


 4403  4236  
 4403  4236  ; procedure check_i-o_transfer(document size, message);
 4404  4236  ; -----------------------------------------------------
 4405  4236  ;
 4406  4236  ; the i-o transfer specified by message.first segment and message.no of segments
 4407  4236  ; is compared to the specified document size. if the i-o transfer goes beyond
 4408  4236  ; the upper limit of the document, the size of the transfer (no of segments)
 4409  4236  ; is decreased to fit the limit of the document.
 4410  4236  ;
 4411  4236  ;          call                   return
 4412  4236  ;
 4413  4236  ; w0       size of document       size of document
 4414  4236  ; w1       -                      unchanged
 4415  4236  ; w2       message                message
 4416  4236  ; w3       link                   destroyed
 4417  4236  ;
 4418  4236  
 4418  4236  b. i1, j1 w.
 4419  4236  
 4419  4236  d146:                  ; procedure check_i-o_transfer(size_of_doc, message);
 4420  4236       rs. w3     i0.    ; begin
 4421  4238       rl  w3  x2+a154   ;   if message.first segment +
 4422  4240       wa  w3  x2+a153   ;      message.no of segments >
 4423  4242       ws  w3     0      ;      size of document then
 4424  4244       sh  w3     0      ;
 4425  4246       jl.       (i0.)   ;      message.no of segments :=
 4426  4248       ac  w3  x3        ;      message.no of segments -
 4427  4250       wa  w3  x2+a154   ;      message.first segment - size of document;
 4428  4252       rs  w3  x2+a154   ;
 4429  4254       jl.       (i0.)   ;
 4430  4256                         ;
 4431  4256  i0:  0                 ; saved link
 4432  4258  e.                     ; end;
 4433  4258  \f


 4433  4258  
 4433  4258  ; procedure deliver_status(status, message);
 4434  4258  ; ------------------------------------------
 4435  4258  ;
 4436  4258  ; the specified status is placed in the message, the rest of the buffer is
 4437  4258  ; cleared and it is returned to the sender with ok-result.
 4438  4258  ; the control is transfered to the monitor procedure 'return_from_interrupt'.
 4439  4258  ;
 4440  4258  ;         call               
 4441  4258  ;
 4442  4258  ; w0      status
 4443  4258  ; w1      -
 4444  4258  ; w2      message
 4445  4258  ; w3      -
 4446  4258  ;
 4447  4258   
 4447  4258  b. i1, j1 w.
 4448  4258  
 4448  4258  d147:                  ; procedure deliver_status(status, message);
 4449  4258       rs  w0  x2+a150   ; begin
 4450  4260       ld  w0    -48     ;
 4451  4262       rs  w0  x2+a151   ;   clear answer;
 4452  4264       ds  w0  x2+a151+4 ;
 4453  4266       ds  w0  x2+a151+8 ;
 4454  4268       ds  w0  x2+a151+12;
 4455  4270       al  w0     1      ;   message.status := status;
 4456  4272       al  w3     c99    ;
 4457  4274       jl.        d15.   ;   deliver answer(message,result); goto return_from_interrupt;
 4458  4276                         ;
 4459  4276  e.                     ; end;
 4460  4276  \f


 4460  4276  
 4460  4276  ; procedure test_legal_operation(message, operation mask);
 4461  4276  ; --------------------------------------------------------
 4462  4276  ;
 4463  4276  ; if the specified message contains an operation which is not specified in 
 4464  4276  ; the operation mask as a valid operation, a result 3 is returned.
 4465  4276  ; if bit number I in the mask is one, operation number I is a valid ope-
 4466  4276  ; ration.
 4467  4276  ;
 4468  4276  ;        call              return
 4469  4276  ;
 4470  4276  ; w0     operation mask    destroyed
 4471  4276  ; w1     -                 unchanged
 4472  4276  ; w2     message           message
 4473  4276  ; w3     link              destroyed
 4474  4276  ;
 4475  4276  
 4475  4276  b. i1, j1  w.
 4476  4276  
 4476  4276  d148:                  ; procedure test_legal_operation(message, operation mask)
 4477  4276       rs. w3     i0.    ; begin
 4478  4278       zl  w3  x2+a150   ;
 4479  4280       ls  w0  x3        ;   if opertion_mask.bit(message.operation)=1 then
 4480  4282       sh  w0    -1      ;      ok_return;
 4481  4284       jl.       (i0.)   ;
 4482  4286                         ;
 4483  4286       al  w0     3      ;   message.result := 3; <* unintelligible *>
 4484  4288       al  w3     c99    ;
 4485  4290       jl.        d15.   ;   deliver answer(message,result); goto return_from_interrupt;
 4486  4292                         ;
 4487  4292  i0:  0                 ;
 4488  4294  e.                     ; end;
 4489  4294  \f


 4489  4294  
 4489  4294  ; procedure stop_message(queue process, main process, message);
 4490  4294  ; -----------------------------------------------------------------------
 4491  4294  ;
 4492  4294  ; the specified message will be stopped depending on its 'state'.
 4493  4294  ; the state of the message is encoded in the state field of the message:
 4494  4294  ; bit 22: during transfer
 4495  4294  ; bit 21: transfer completed
 4496  4294  ;
 4497  4294  ;     not transfered:      2.xxxx00x
 4498  4294  ;     during transfer:     2.xxxx01x
 4499  4294  ;     transfer completed:  2.xxxx10x
 4500  4294  ;
 4501  4294  ; not transfered: the message is returned to sender. the waiting queue of
 4502  4294  ;                 the mainprocess is examined: if empty the monitor is left,
 4503  4294  ;                 else test_ready_and_setup is called with the first element. 
 4504  4294  ;
 4505  4294  ; during transfer: this state is only possible for messages which cause
 4506  4294  ;                 chained operations to be send to the controller. it will
 4507  4294  ;                 be in this state when a part of the chain has been
 4508  4294  ;                 send to the controller but before it is completed.
 4509  4294  ;                 no of bytes will be set to zero in the message.
 4510  4294  ;
 4511  4294  ; transfer completed: the message has been transfered to the controller
 4512  4294  ;                 (if the message caused a chained operation to be send,
 4513  4294  ;                 the chain has been completed).
 4514  4294  ;
 4515  4294  ; note: there might be a process linked to the waiting_queue of main
 4516  4294  ;       it will be linked in proc+a81.
 4517  4294  ;
 4518  4294  ;         call                 return
 4519  4294  ;
 4520  4294  ; w0      queue process        destroyed
 4521  4294  ; w1      main process         main process
 4522  4294  ; w2      message              message
 4523  4294  ; w3      link                 destroyed
 4524  4294  ;
 4525  4294  ; return: 
 4526  4294  ;         link + 0: during transfer
 4527  4294  ;         link + 2: transfer completed
 4528  4294  ;
 4529  4294  
 4529  4294  b.  i10, j10  w.
 4530  4294  
 4530  4294  d149:                      ; stop_message(queue process, mainprocess, message)
 4531  4294       ds. w1     i1.        ; begin
 4532  4296       ds. w3     i3.        ;
 4533  4298       zl  w0  x2+a138+1     ;   if message.state = not transfered then
 4534  4300       sz  w0     2.0000110  ;   begin
 4535  4302       jl.        j2.        ;
 4536  4304                             ;
 4537  4304       sz  w0     2.0000001  ;     if message.state.io then
 4538  4306       jl  w3     d132       ;        decrease_stopcount(message);
 4539  4308       al  w0     0          ;
 4540  4310       rs  w0  x2+a150       ;     message.status := ok;
 4541  4312       rs  w0  x2+a151       ;     message.halfwords := message.bytes := 0;
 4542  4314       rs  w0  x2+a152       ;
 4543  4316       rl. w2     i2.        ;
 4544  4318       al  w0     1          ;     
 4545  4320       jl. w3     d15.       ;     deliver answer(message,result);
 4546  4322                             ;
 4547  4322       dl. w1     i1.        ;
 4548  4324       rl  w2  x1+a81        ;     element := mainprocess.waiting queue.first;
 4549  4326       sn  w2  x1+a81        ;     if element = none then
 4550  4328       jl         c99        ;        return_from_interrupt;
 4551  4330                             ;
 4552  4330       al  w0     0          ;     force :=
 4553  4332       sl  w2    (b4)        ;     if element = message then
 4554  4334       sl  w2    (b5)        ;        message.state.force
 4555  4336       al  w0     2.1000000  ;     else no;
 4556  4338       la  w0  x2+a138       ;     <* a bit dirty if element = proc ! *>
 4557  4340       jl.        d142.      ;     test_ready_and_setup(force, element);
 4558  4342                             ;   end
 4559  4342  j2:                        ;   else
 4560  4342       so  w0     2.0000010  ;   if message.state = during transfer then
 4561  4344       jl.        j3.        ;   begin
 4562  4346       al  w0     0          ;
 4563  4348       rs  w0  x2+a152       ;     message.no of bytes := 0;
 4564  4350       jl  w3     d5         ;     unlink(message);
 4565  4352       rl. w1     i0.        ;
 4566  4354       al  w1  x1+a54        ;
 4567  4356       jl  w3     d6         ;     link(queue process.event queue, message);
 4568  4358       rl. w1     i1.        ;
 4569  4360       jl.       (i3.)       ;   end
 4570  4362  j3:                        ;   else
 4571  4362       jl  w3     d5         ;   begin  <* message transfered completely *>
 4572  4364       rl. w1     i0.        ;     unlink(message);
 4573  4366       al  w1  x1+a54        ;
 4574  4368       jl  w3     d6         ;     link(queue process.event queue, message);
 4575  4370       rl. w1     i1.        ;
 4576  4372       rl. w3     i3.        ;
 4577  4374       jl      x3+2          ;   end;
 4578  4376                             ;
 4579  4376  i0:  0                     ;  save w0
 4580  4378  i1:  0                     ;  save w1
 4581  4380  i2:  0                     ;  save w2
 4582  4382  i3:  0                     ;  save w3
 4583  4384                             ;
 4584  4384  e.                         ; end;
 4585  4384  \f


 4585  4384  
 4585  4384  ; procedure clean_after_buserror(message);
 4586  4384  ; ----------------------------------------
 4587  4384  ;
 4588  4384  ; called when an communication error with the controller is observed.
 4589  4384  ; the specified message will be returned with result 4 (receiver malfunction),
 4590  4384  ; stopcount of sender decreased (if necessary) and, if message was send to
 4591  4384  ; a main process, buffer claim of driverproc increased (it will be decreased
 4592  4384  ; when the message is answered).
 4593  4384  ;
 4594  4384  ;     call                    return
 4595  4384  ; w0  -                       destroyed
 4596  4384  ; w1  -                       unchanged
 4597  4384  ; w2  message                 destroyed
 4598  4384  ; w3  link                    destroyed
 4599  4384  ;
 4600  4384  
 4600  4384  b.  i5,  j5  w.
 4601  4384  
 4601  4384  d152:                     ; procedure clean_after_buserror(message);
 4602  4384       ds. w2     i2.       ; begin
 4603  4386       rs. w3     i3.       ;
 4604  4388       jl  w3     d5        ;   unlink(message);
 4605  4390       zl  w0  x2+a138+1    ;
 4606  4392       sz  w0     2.0000001 ;   if message.operation = io then
 4607  4394       jl  w3     d132      ;      decrease stopcount(message);
 4608  4396       rl. w2     i2.       ;
 4609  4398       ac  w1 (x2+a141)     ;
 4610  4400       rl  w0  x1+a10       ;   if message.receiver.kind = main_kinds then
 4611  4402       se  w0     q20       ;   begin
 4612  4404       sn  w0     q26       ;     <* message was send to a mainprocess and
 4613  4406       sz                   ;        claimed by driverproc *>
 4614  4408       jl.        j1.       ;
 4615  4410       rl  w0     b218      ;
 4616  4412       la  w0  x1+a550      ;    w0 := function
 4617  4414       ls  w0     -15       ;
 4618  4416       jl. w3     d156.     ;     decrease number of outstanding
 4619  4418       rl  w1     b21       ;
 4620  4420       zl  w3  x1+a19       ;     driverproc.bufferclaim :=
 4621  4422       al  w3  x3+1         ;     driverproc.bufferclaim + 1;
 4622  4424       hs  w3  x1+a19       ;
 4623  4426  j1:                       ;   end;
 4624  4426       al  w0     4         ;
 4625  4428       jl. w3     d15.      ;   deliver answer(message,result);
 4626  4430       rl. w1     i1.       ;
 4627  4432       jl.       (i3.)      ;   return;
 4628  4434                            ;
 4629  4434  i1:  0                    ; saved w1
 4630  4436  i2:  0                    ; saved w2
 4631  4438  i3:  0                    ; saved w3
 4632  4440                            ; 
 4633  4440  e.                        ; end;
 4634  4440  \f


 4634  4440  
 4634  4440  b. f12  w.            ; block including log and test facilities for drivers.
 4635  4440  
 4635  4440  ; format of test record: (identical to the test record format of the fpa)
 4636  4440  ;
 4637  4440  ;  + 0: type, length of record
 4638  4440  ;  + 2: time1
 4639  4440  ;  + 4: time2
 4640  4440  ;  + 6: test information
 4641  4440  ;  + 8: ...
 4642  4440  ;
 4643  4440  ;
 4644  4440  ; the call of the test facility is performed like this:
 4645  4440  ;
 4646  4440  ; b. f2 w.               ;
 4647  4440  ;      rs. w3     f1.    ; save w3;
 4648  4440  ;      rs. <w_>   f0.    ; save device process;
 4649  4440  ;      jl. w3     d150.  ; check condition(type, deviceproc, on/off);
 4650  4440  ;      <type>            ; type of testpoint ( 1 - 47 )
 4651  4440  ; f0:  <device proc> ; any device process (main, disc, mt, area or gsd)
 4652  4440  ; f1:  <saved w3>        ; saved w3
 4653  4440  ;      jl.        f2.    ;+6: test off: w0 - w2: unchanged, w3: saved w3
 4654  4440  ;                        ;+8: test on:
 4655  4440  ;      ...               ; pack test information;
 4656  4440  ;      al  w0     <first>; first := test_area.first address;
 4657  4440  ;      al  w1     <last> ; last  := test_area.last address;
 4658  4440  ;      jl. w3     d151.  ; create test record;
 4659  4440  ; f2:                    ; 
 4660  4440  ; e.                     ;
 4661  4440  ;
 4662  4440  ; unlike the fpa test facilities it is not possible to stop the creation
 4663  4440  ; of test records after a specified number of records.
 4664  4440  ;
 4665  4440  ; working locations:
 4666  4440  ;
 4667  4440  ; saved w-registers:
 4668  4440  
 4668  4440  f0:  0                   ; w0
 4669  4442  f1:  0                   ; w1
 4670  4444  f2:  0                   ; w2
 4671  4446  f3:  0                   ; w3
 4672  4448  
 4672  4448  ; parameters:
 4673  4448  
 4673  4448  f7:  0                   ; proc (main process)
 4674  4450  f9:  0                   ; type, length
 4675  4452  \f


 4675  4452  
 4675  4452  
 4675  4452  ;
 4676  4452  ; check condition(type, device process, on/off);
 4677  4452  ; --------------------------------------------------
 4678  4452  ;
 4679  4452  ; checks the type of the test point stored in link against the test mask
 4680  4452  ; of the mainprocess.
 4681  4452  ; if test is off then the procedure returns to link+6.
 4682  4452  ; test on implies that the test record is initiated, the registers are
 4683  4452  ; saved and return is made to link+8.
 4684  4452  ;
 4685  4452  ;       call          return
 4686  4452  ;  w0   -             unchanged
 4687  4452  ;  w1   -             unchanged
 4688  4452  ;  w2   -             unchanged
 4689  4452  ;  w3   link          saved w3 (off)
 4690  4452  ;
 4691  4452  
 4691  4452  b. i0, j2  w.
 4692  4452  
 4692  4452  d150:                  ; check condition
 4693  4452       ds. w1     f1.    ; begin
 4694  4454       rs. w2     f2.    ;
 4695  4456       rs. w3     i0.    ;   save all registers
 4696  4458       rl  w0  x3+4      ;   save saved w3;
 4697  4460       rs. w0     f3.    ;
 4698  4462       rl  w1  x3+2      ;   proc := device;
 4699  4464  j1:  rl  w0  x1+a10    ;   while proc.kind <> main process do
 4700  4466       se  w0     q20    ;   proc := proc.main;
 4701  4468       sn  w0     q26    ;
 4702  4470       jl.        j2.    ;
 4703  4472       rl  w1  x1+a50    ;
 4704  4474       jl.        j1.    ;
 4705  4476                         ;
 4706  4476  j2:  rs. w1     f7.    ;
 4707  4478       rl  w3  x3        ;   <* type *>
 4708  4480       dl  w1  x1+a75    ;   mask := proc.mask;
 4709  4482       ld  w1  x3        ;   shift := type;
 4710  4484       sl  w0     0      ;   if mask shifted shift>=0 then
 4711  4486       jl.        j0.    ;      goto exit2;
 4712  4488       hs. w3     f9.    ;   type := type of test point;
 4713  4490       dl. w1     f1.    ;   <* restore w0 - w3 *>
 4714  4492       dl. w3     f3.    ;
 4715  4494       am.       (i0.)   ;
 4716  4496       jl        +8      ; exit1: return to link+8;
 4717  4498                         ;
 4718  4498  j0:  dl. w1     f1.    ; exit2:
 4719  4500       dl. w3     f3.    ;   <* restore w0 - w3 *>
 4720  4502       am.       (i0.)   ;
 4721  4504       jl        +6      ;   return to link+6;
 4722  4506                         ;
 4723  4506  i0:  0                 ; saved link;
 4724  4508                         ;
 4725  4508  e.                     ; end;
 4726  4508  \f


 4726  4508  
 4726  4508  ;
 4727  4508  ; create test record
 4728  4508  ; ------------------
 4729  4508  ;
 4730  4508  ; creates a test record with the format shown above.
 4731  4508  ;
 4732  4508  ;           call             return
 4733  4508  ;  w0       first            saved w0
 4734  4508  ;  w1       last             saved w1
 4735  4508  ;  w2       -                saved w2
 4736  4508  ;  w3       link             saved w3
 4737  4508  ;
 4738  4508  
 4738  4508  b. i6, j5  w.
 4739  4508  
 4739  4508  d151:                   ; create test record
 4740  4508       al  w1  x1+2       ; begin
 4741  4510       ds. w1     i1.     ;   top := last + 2;
 4742  4512       ds. w3     i3.     ;
 4743  4514       rl. w1     f7.     ;   proc := mainprocess;
 4744  4516                          ;
 4745  4516  j0:  rl. w2     i1.     ; start:
 4746  4518       ws. w2     i0.     ;   record.length :=
 4747  4520       al  w2  x2+6       ;   top - first + 6;
 4748  4522       hs. w2     f9.+1   ;
 4749  4524       wa  w2  x1+a70     ;   next_record.start :=
 4750  4526       sh  w2 (x1+a71)    ;   next_record.start + length;
 4751  4528       jl.        j2.     ;   if next_record.start > test_buffer.top then
 4752  4530                          ;   goto insert;
 4753  4530  j1:  rl  w2  x1+a71     ;   <* insert dummy end record *>
 4754  4532       ws  w2  x1+a70     ;   dummy_record.length := test_buffer.top -
 4755  4534       sl  w2     1       ;   next_record.start;
 4756  4536       rs  w2 (x1+a70)    ;   if dummy_record.length>0 then dummy_record:=0,length;
 4757  4538                          ;
 4758  4538  j5:  al  w0     0       ;
 4759  4540       rs  w0  x1+a70     ;   next_record.start := 0;
 4760  4542       dl  w0  x1+a73     ;
 4761  4544       ds  w0  x1+a71     ;
 4762  4546       jl.     j0.        ;   goto start;
 4763  4548                          ;
 4764  4548  j2:  rx  w2  x1+a70     ; insert:
 4765  4550       rl. w0     f9.     ;
 4766  4552       rs  w0  x2         ;   <* type, length *>
 4767  4554       al  w1  x2         ;   <* save pointer *>
 4768  4556       jl  w3     d7      ;   update time;
 4769  4558       dl  w0     b13+2   ;
 4770  4560       ds  w0  x1+4       ;   <* time *>
 4771  4562       al  w2  x1+4+2     ;
 4772  4564       rl. w3     i0.     ;
 4773  4566  j3:  sl. w3    (i1.)    ;   transfer test information;
 4774  4568       jl.        j4.     ;
 4775  4570       rl  w0  x3         ;
 4776  4572       rs  w0  x2         ;
 4777  4574       al  w2  x2+2       ;
 4778  4576       al  w3  x3+2       ;
 4779  4578       jl.        j3.     ;
 4780  4580                          ;
 4781  4580  j4:  dl. w1     f1.     ;   restore w0 - w3
 4782  4582       dl. w3     f3.     ;
 4783  4584       jl.       (i3.)    ;   return;
 4784  4586                          ;
 4785  4586  i0:  0                  ; first
 4786  4588  i1:  0                  ; last
 4787  4590  i2:  0                  ;
 4788  4592  i3:  0                  ; link
 4789  4594                          ;
 4790  4594  e.                      ; end;
 4791  4594  
 4791  4594  e.                      ; end block including test facilities
 4792  4594  
 4792  4594  ; ***** stepping stone *****
 4793  4594  
 4793  4594       jl.     (+2),     d142,   d142=k-4
 4794  4598  
 4794  4598  \f


 4794  4598  
 4794  4598  ; procedure setup(param, main, message);
 4795  4598  ; --------------------------------------
 4796  4598  ;
 4797  4598  ; the communication area of the specified main process is 
 4798  4598  ; initialized according to the parameters.
 4799  4598  ;
 4800  4598  ; param (w0) has the following format:
 4801  4598  ;     +0 : function code (to be stored in a550)
 4802  4598  ;     +2 : source of data
 4803  4598  ;     +4 : receiver of the function (process address)
 4804  4598  ;
 4805  4598  ; source of data can take the following values:
 4806  4598  ;     0  : from message pointed out by w2
 4807  4598  ;     1  : from communication area i.e. don't initialize -
 4808  4598  ;          already done (only possible in a chain)
 4809  4598  ;     2  : re-establish communication area from the save area 
 4810  4598  ;          (only possible after a 'broken' chain - broken by
 4811  4598  ;          regret/dump functions).
 4812  4598  ;     3  : no message; initialize a550 - a553 only.
 4813  4598  ;     4  : as 0 but no increment of counter
 4814  4598  ;
 4815  4598  ; in case 0 - 2 the count field of message (a138 bit 0 -11) will be increased.
 4816  4598  ;
 4817  4598  ;          call              return
 4818  4598  ;  w0      param             -
 4819  4598  ;  w1      main              main
 4820  4598  ;  w2      message           message
 4821  4598  ;  w3      link              -
 4822  4598  ;
 4823  4598  
 4823  4598  b.  i10,  j10  w.
 4824  4598  
 4824  4598  d153:                      ; procedure setup
 4825  4598       rs. w1     i1.        ; begin
 4826  4600       ds. w3     i3.        ;
 4827  4602       rl  w3     0          ;
 4828  4604       rl  w0  x3+2          ;   if param.source = message then
 4829  4606       se  w0     0          ;   begin
 4830  4608       sn  w0     4          ;
 4831  4610       sz                    ;
 4832  4612       jl.        j2.        ;
 4833  4614       rs. w0     i4.        ;     save(source);
 4834  4616       rl  w0  x3+0          ;     main.function := param.function;
 4835  4618       rs  w0  x1+a550       ;
 4836  4620       rs  w2  x1+a551       ;     main.message  := message;
 4837  4622       rl  w3  x3+4          ;
 4838  4624       rl  w0  x3+a76        ;     main.device_id :=
 4839  4626       rs  w0  x1+a552       ;     receiver.device_id;
 4840  4628       rl  w0  x3+a77        ;     main.proc_id :=
 4841  4630       rs  w0  x1+a553       ;     receiver.proc_id;
 4842  4632       zl  w0  x2+a150       ;
 4843  4634       ls  w0    +16         ;     main.mess_0 :=
 4844  4636       hl  w0  x2+a150+1     ;     message.operation shift 16 +
 4845  4638       rs  w0  x1+a560       ;     message.mode;
 4846  4640                             ;
 4847  4640       dl  w0  x2+a152       ;     <* copy the rest of message *>
 4848  4642       ds  w0  x1+a562       ;
 4849  4644       dl  w0  x2+a154       ;
 4850  4646       ds  w0  x1+a564       ;
 4851  4648       dl  w0  x2+a156       ;
 4852  4650       ds  w0  x1+a566       ;
 4853  4652       rl  w0  x2+a157       ;
 4854  4654       rs  w0  x1+a567       ;
 4855  4656                             ;
 4856  4656       rl. w0     i4.        ;
 4857  4658       sn  w0     4          ;     if source=no count then
 4858  4660       jl.        j9.        ;       goto no increment;
 4859  4662       jl.        j8.        ;   end
 4860  4664  j2:                        ;   else
 4861  4664       se  w0     1          ;   if source = com_area then
 4862  4666       jl.        j3.        ;   begin
 4863  4668                             ;     <* do nothing *>
 4864  4668       jl.        j8.        ;   end
 4865  4670  j3:                        ;   else
 4866  4670       se  w0     2          ;   if source = com_save then
 4867  4672       jl.        j4.        ;   begin
 4868  4674       dl  w0  x1+a580+2     ;     <* re-establish the communication area 
 4869  4676       ds  w0  x1+a550+2     ;        from the save area *>
 4870  4678       dl  w0  x1+a580+6     ;
 4871  4680       ds  w0  x1+a550+6     ;
 4872  4682       dl  w0  x1+a580+10    ;
 4873  4684       ds  w0  x1+a550+10    ;
 4874  4686       dl  w0  x1+a580+14    ;
 4875  4688       ds  w0  x1+a550+14    ;
 4876  4690       dl  w0  x1+a580+18    ;
 4877  4692       ds  w0  x1+a550+18    ;
 4878  4694       dl  w0  x1+a580+22    ;
 4879  4696       ds  w0  x1+a550+22    ;
 4880  4698                             ;
 4881  4698       ac  w0     2.0010000+1;
 4882  4700       la  w0  x2+a138       ;     message.state := 
 4883  4702       hs  w0  x2+a138+1     ;     message.state and not com_save;
 4884  4704       jl.        j8.        ;   end
 4885  4706  j4:                        ;   else
 4886  4706       se  w0     3          ;   if source = no_message then
 4887  4708       jl        -1          ;   begin
 4888  4710       rl  w0  x3+0          ;
 4889  4712       rs  w0  x1+a550       ;     main.function := param.function;
 4890  4714       rl  w3  x3+4          ;
 4891  4716       rl  w0  x3+a76        ;     main.contorller_index :=
 4892  4718       rs  w0  x1+a552       ;     param.receiver.controller_index;
 4893  4720       rl  w0  x3+a77        ;     main.rc8000_address :=
 4894  4722       rs  w0  x1+a553       ;     param.receiver.rc8000_address;
 4895  4724       rs  w2  x1+a551       ;     main.message := message; <* might be dummy *>
 4896  4726       jl.        j9.        ;     goto no_increment;
 4897  4728                             ;   end
 4898  4728                             ;   else panic; <* unknown source *>
 4899  4728  j8:                        ;
 4900  4728       zl  w0  x2+a138+0     ;
 4901  4730       ba. w0     1          ;   message.count :=
 4902  4732       hs  w0  x2+a138+0     ;   message.count + 1;
 4903  4734                             ;
 4904  4734  j9:                        ; no_increment:
 4905  4734       jl.       (i3.)       ;
 4906  4736                             ;
 4907  4736  i1:  0                     ; save w1
 4908  4738  i2:  0                     ; save w2
 4909  4740  i3:  0                     ; save w3
 4910  4742  i4:  0                     ; source
 4911  4744  e.                         ; end;
 4912  4744  \f


 4912  4744  
 4912  4744  
 4912  4744  ; procedure regret(receiver, main, message);
 4913  4744  ; ------------------------------------------
 4914  4744  ;
 4915  4744  ; a regret function for the specified message is sent 
 4916  4744  ; 
 4917  4744  ; if the state of the communication area indicates that this 
 4918  4744  ; regret interrupts a 'chain', the communication area is saved
 4919  4744  ; before the regret is sent. in this case this is marked in 
 4920  4744  ; the state of the message which caused the chained operation
 4921  4744  ; (message.state bit 19).
 4922  4744  ;
 4923  4744  ; this procedure will not return but leaves the monitor.
 4924  4744  ;
 4925  4744  ;            call
 4926  4744  ;   w0       receiver of message
 4927  4744  ;   w1       main
 4928  4744  ;   w2       message
 4929  4744  ;   w3       -
 4930  4744  ;
 4931  4744  
 4931  4744  b.   i10, j10  w.          ; <* data for regret *>
 4932  4744                             ;
 4933  4744  i0:  5<17                  ; param: function (always regret)
 4934  4746       4                     ;    +2: source   (always message,no count)
 4935  4748       0                     ;    +4: receiver 
 4936  4750  i6:  0                     ; saved register (message)
 4937  4752                             ;
 4938  4752  d154:                      ; procedure regret
 4939  4752       rs. w0     i0.+4      ; begin
 4940  4754       zl  w0  x1+a78+1      ;   param.receiver := receiver_of_message;
 4941  4756       so  w0     2.001000   ;   if main.com_state = in_chain then
 4942  4758       jl.        j2.        ;   begin
 4943  4760       rl  w3  x1+a551       ;
 4944  4762       al  w0     2.0010000  ;     main.message.state :=
 4945  4764       lo  w0  x3+a138       ;     main.message.state or com_save;
 4946  4766       hs  w0  x3+a138+1     ;
 4947  4768                             ;
 4948  4768       ac  w0     2.001000+1 ;     main.com_state :=
 4949  4770       la  w0  x1+a78        ;     main.com_state and not in_chain;
 4950  4772       hs  w0  x1+a78+1      ;
 4951  4774                             ;
 4952  4774       dl  w0  x1+a550+2     ;     <* save the communication area *>
 4953  4776       ds  w0  x1+a580+2     ;
 4954  4778       dl  w0  x1+a550+6     ;
 4955  4780       ds  w0  x1+a580+6     ;
 4956  4782       dl  w0  x1+a550+10    ;
 4957  4784       ds  w0  x1+a580+10    ;
 4958  4786       dl  w0  x1+a550+14    ;
 4959  4788       ds  w0  x1+a580+14    ;
 4960  4790       dl  w0  x1+a550+18    ;
 4961  4792       ds  w0  x1+a580+18    ;
 4962  4794       dl  w0  x1+a550+22    ;
 4963  4796       ds  w0  x1+a580+22    ;
 4964  4798                             ;   end;
 4965  4798  j2:                        ;
 4966  4798       al. w0     i0.        ;
 4967  4800       jl. w3     d153.      ;   setup(param, main, message);
 4968  4802       jl. w3     d155.      ;   increase no_of_outstanding(main)
 4969  4804       jl. w3     d144.      ;   start_controller(main);
 4970  4806       jl. w3     d152.      ;+0: clean_after_buserror(message);
 4971  4808       jl         c99        ;+2: ok: return_from_interrupt;
 4972  4810                             ;
 4973  4810  e.                         ; end <* regret *>
 4974  4810  \f


 4974  4810  
 4974  4810  
 4974  4810  
 4974  4810  ; procedure increase no_of_outstanding(main);
 4975  4810  ; ------------------------------------------
 4976  4810  ;
 4977  4810  ; Increase the number of outstanding buffers for the specified mainprocess,
 4978  4810  ; when a message is sent.
 4979  4810  ; if timeout supervision is enabled (timeout <>0) and the answer bit in the
 4980  4810  ; function word is zero, the mainprocess is inserted in the timeout queue
 4981  4810  ;
 4982  4810  ;            call      return
 4983  4810  ;   w0       -         destroyed
 4984  4810  ;   w1       main      unchanged
 4985  4810  ;   w2       -         unchanged
 4986  4810  ;   w3       -         destroyed
 4987  4810  ;
 4988  4810  
 4988  4810  b.   i3, j2  w.          ; 
 4989  4810  
 4989  4810  d155:
 4990  4810  c.l53  b.  f4  w.         ; ****** test 44 ******
 4991  4810       rs. w3     f1.       ;
 4992  4812       rs. w1     f0.       ;
 4993  4814       jl. w3    (f3.)      ;
 4994  4816       44                   ;
 4995  4818  f0:  0                    ; main
 4996  4820  f1:  0                    ;
 4997  4822       jl.        f2.       ;
 4998  4824       al  w0  x1+a86       ; dump main.communication area
 4999  4826       al  w1  x1+a86       ;
 5000  4828       jl. w3    (f4.)      ;
 5001  4830       jl.        f2.       ;
 5002  4832  f3:  d150                 ;
 5003  4834  f4:  d151                 ;
 5004  4836  f2:                       ;
 5005  4836  e.z.                      ; ****** end test 44 ******
 5006  4836       rs. w3     i3.      ; no_of_outstanding := +1
 5007  4838       ds. w2     i2.      ;
 5008  4840       rl  w0     b227     ; 
 5009  4842       la  w0  x1+a550     ; if no answer bit then
 5010  4844       se  w0     0        ; begin
 5011  4846       jl.        j0.      ;
 5012  4848       dl  w0  x1 +a87     ;
 5013  4850       wa  w3     b201     ;
 5014  4852       rs  w3  x1+a86      ;
 5015  4854       sn  w3     0        ;   if no outstanding
 5016  4856       jl.        j0.      ;   then return
 5017  4858       rs  w0  x1+a244     ;
 5018  4860       al  w2  x1+a242     ;   if main.timeout <> 0 and 
 5019  4862       al  w1     b69      ;      not in timeout queue  then
 5020  4864       se  w0     0        ;        link(main, timeout_queue)
 5021  4866       se  w2     (x2)     ;
 5022  4868       sz                  ;
 5023  4870       jl  w3     d6       ;
 5024  4872  j0:  dl. w2     i2.      ; end;
 5025  4874       jl.        (i3.)    ;
 5026  4876  
 5026  4876  i1:  0                   ; saved w1
 5027  4878  i2:  0                   ; saved w2
 5028  4880  i3:  0                   ;   -   w3
 5029  4882  
 5029  4882  e.
 5030  4882  
 5030  4882  \f


 5030  4882  
 5030  4882  ; procedure decrease no_of_outstanding(main);
 5031  4882  ; ------------------------------------------
 5032  4882  ;
 5033  4882  ; Decreases the number of outstanding buffers for the specified mainprocess.
 5034  4882  ; if an answer is received the number of outstanding buffers is decreased.
 5035  4882  ; if timeout supervision is enabled and more messages is outstanding,
 5036  4882  ;  the mainprocess is  reinserted in the timeout queue with the total 
 5037  4882  ;  timeout value.
 5038  4882  ;
 5039  4882  ;            call      return
 5040  4882  ;   w0       function  unchanged
 5041  4882  ;   w1       main      unchanged
 5042  4882  ;   w2       -         unchanged
 5043  4882  ;   w3       -         unchanged
 5044  4882  ;
 5045  4882  
 5045  4882  b.   i3, j2  w.          ; 
 5046  4882  
 5046  4882  d156:
 5047  4882  c.l53  b.  f4  w.         ; ****** test 44 ******
 5048  4882       rs. w3     f1.       ;
 5049  4884       rs. w1     f0.       ;
 5050  4886       jl. w3    (f3.)      ;
 5051  4888       44                   ;
 5052  4890  f0:  0                    ; main
 5053  4892  f1:  0                    ;
 5054  4894       jl.        f2.       ;
 5055  4896       al  w0  x1+a86       ; dump main.communication area
 5056  4898       al  w1  x1+a86+2     ;
 5057  4900       jl. w3    (f4.)      ;
 5058  4902       jl.        f2.       ;
 5059  4904  f3:  d150                 ;
 5060  4906  f4:  d151                 ;
 5061  4908  f2:                       ;
 5062  4908  e.z.                      ; ****** end test 44 ******
 5063  4908       ds. w1     i1.      ;
 5064  4910       ds. w3     i3.      ; main.no_of_outstanding := -1
 5065  4912       ls  w0     -1       ; 
 5066  4914       so  w0      1       ; if answer bit and 
 5067  4916       jl.        j0.      ; (function <> take operation or
 5068  4918       rl  w2  x1+a503     ;  receiver = main) then
 5069  4920       sn  w0      3       ; 
 5070  4922       sn  w2  x1          ;
 5071  4924       sz                  ;
 5072  4926       jl.         j0.     ; begin
 5073  4928       al  w2  x1+a242     ;   if in timeout queue then
 5074  4930       se  w2     (x2)     ;     unlink(main, timeout_queue)
 5075  4932       jl  w3     d5       ;
 5076  4934       dl  w0  x1 +a87     ;
 5077  4936       ws  w3     b201     ;
 5078  4938       rs  w3  x1+a86      ;
 5079  4940  sh w3 -1
 5080  4942  jl -9
 5081  4944       se  w3     0        ;   if main.timeout <> 0 and
 5082  4946       sn  w0     0        ;      main.no_of_outstanding <> 0 then
 5083  4948       jl.        j0.      ;
 5084  4950       rs  w0  x1+a244     ;   begin
 5085  4952       al  w2  x1+a242     ; 
 5086  4954       al  w1     b69      ;     link(main, timeout_queue)
 5087  4956       sn  w2     (x2)     ;   end
 5088  4958       jl  w3     d6       ;
 5089  4960  j0:  dl. w3     i3.      ; end;
 5090  4962       dl. w1     i1.      ;
 5091  4964       jl         x3       ;
 5092  4966  
 5092  4966       0                   ; -2: saved w0
 5093  4968  i1:  0                   ;  0: saved w1
 5094  4970       0                   ; -2: saved w2
 5095  4972  i3:  0                   ;  0:   -   w3
 5096  4974  
 5096  4974  e.
 5097  4974  
 5097  4974  \f


 5097  4974  b.  i24  w.
 5098  4974  
 5098  4974  i0:  0                 ; saved w0
 5099  4976  i1:  0                 ; saved w1
 5100  4978  i2:  0                 ; saved w2
 5101  4980  i3:  0                 ; saved w3
 5102  4982  i7:  0                 ; cur process (sender of answer - if any)
 5103  4984  i8:  0                 ; internal
 5104  4986  i23: 0                 ; result
 5105  4988  
 5105  4988  ; procedure deliver answer;
 5106  4988  ; comment: delivers an answer from a receiver to a sender. if the sender is waiting for the 
 5107  4988  ;          answer, it will be started. if the message is regretted (or sender removed), the
 5108  4988  ;          buffer is returned to the mess buf pool.
 5109  4988  ; call: w0=result, w2=buf, w3=link
 5110  4988  ; exit: w0, w1=unchanged, w2, w3=undef
 5111  4988  ; return address: link
 5112  4988  d30:                   ; deliver answer - called from send answer
 5113  4988       ds. w1     i1.    ;
 5114  4990       rs. w3     i3.    ;    save registers;
 5115  4992       rs. w0     i23.   ;    save result;
 5116  4994       rl  w0     b1     ;
 5117  4996       rs. w0     i7.    ;    cur process := cur process in monitor;
 5118  4998       jl.        i9.    ;
 5119  5000  
 5119  5000  d15: ds. w1     i1.    ;    save registers;
 5120  5002       rs. w3     i3.    ;
 5121  5004       rs. w0     i23.   ;    save result;
 5122  5006  i20: al  w0     1      ;    cur process := undefined;
 5123  5008       rs. w0     i7.    ;    <* not called from send answer *>
 5124  5010  
 5124  5010  i9:  
 5125  5010       rl  w3     x2+a141;
 5126  5012       sh  w3     0      ;
 5127  5014       ac  w3  x3        ;
 5128  5016       rl  w0  x3+a10    ;
 5129  5018       se  w0     q4     ;    if proc = area then
 5130  5020       jl.        i22.   ;    begin
 5131  5022       zl  w1  x3+a57    ;
 5132  5024       al  w1  x1-1      ;       number of outstanding message:=
 5133  5026       hs  w1  x3+a57    ;       number of outstanding message-1;
 5134  5028       sn  w0     0      ;       if number of outstanding messages=0 and
 5135  5030       se  w0  (x3+a11)  ;          area process removed then
 5136  5032       sz
 5137  5034       rs  w1  x3+a50    ;         clear main address;
 5138  5036  i22:                   ;    end;
 5139  5036       rl. w0     i23.   ;
 5140  5038       rs  w0  x2+a141   ;    insert result;
 5141  5040       dl  w1  x2+a142   ;    internal:=sender(buf);  (w0 := receiver(buf))
 5142  5042       sh  w1    -1      ;    if internal<0 then
 5143  5044       jl.        i12.   ;      goto regretted;
 5144  5046  
 5144  5046       rl  w3  x1+a10    ;
 5145  5048       se  w3     q8     ;    if kind = csp_terminal or
 5146  5050       sn  w3     64     ;    kind(sender)=pseudo process then
 5147  5052       rl  w1  x1+a50    ;      internal:=mainproc(sender);
 5148  5054       sz  w3    -1-64   ;    if kind(sender) is neither internal nor pseudo process then
 5149  5056       rl  w1     b21    ;      internal:=driverproc; (there is only one)
 5150  5058       rs. w1     i8.    ;    save(internal);
 5151  5060       rl  w3     (b6)   ;     w3:=pda of 1. internal
 5152  5062       al  w3  x3-1      ;
 5153  5064       sl  w3  x1        ;     if not internal then
 5154  5066       jl         -100   ;
 5155  5068  
 5155  5068       bz  w3  x1+a13    ;    w3:=state(internal);
 5156  5070       sn  w3     a103   ;    if state<>wait answer or
 5157  5072       se  w2 (x1+a30)   ;      save w2(internal)<>buf then
 5158  5074       jl.        i13.   ;    goto event;
 5159  5076  
 5159  5076       rs  w0  x1+a28    ;    save w0(internal) := result := receiver(buf);
 5160  5078       jl  w3     d109   ;    increase buf claim, remove release buf(internal, buf);
 5161  5080  
 5161  5080       rl. w3     i8.    ;    restore(internal);
 5162  5082       al  w1  x2+8      ;    from:=buf+8;
 5163  5084       rl  w2  x3+a29    ;    answer:=save w1(internal);
 5164  5086       wa  w2  x3+a182   ; get physical address of answer area
 5165  5088       jl  w3     d14    ;    move mess(from, answer);
 5166  5090  i10: rl. w1     i8.    ;
 5167  5092       jl  w3     d10    ;    link internal(internal);
 5168  5094       rl. w1     i7.    ;
 5169  5096       se  w1    (b1)    ;    if cur in monitor = sender of answer 
 5170  5098       jl.        i11.   ;       <*called from send answer*>
 5171  5100       rl. w3     i8.    ;    and
 5172  5102       rl  w0  x3+a301   ;       buf.sender.priority > cur process.priority 
 5173  5104       sl  w0 (x1+a301)  ;    then
 5174  5106       jl.        i11.   ;    begin
 5175  5108       jl  w3     d20    ;      conditional reschedule(cur);
 5176  5110                         ;    end;
 5177  5110  i11: dl. w1     i1.    ; exit: restore(w0, w1);
 5178  5112       jl.       (i3.)   ;    return;
 5179  5114  
 5179  5114  i12: al. w3     i11.   ; regretted: remove release buf;
 5180  5116       jl         d106   ;    goto exit;
 5181  5118  
 5181  5118  i13: jl  w3     d5     ; event:
 5182  5120       al  w1  x1+a15    ;    remove(buf);
 5183  5122       jl  w3     d6     ;    link(event q(internal), buf);
 5184  5124       bz  w0  x1-a15+a13;
 5185  5126       se  w0     a104   ;    if state<>wait event then
 5186  5128       jl.        i11.   ;      goto exit;
 5187  5130       al  w0     1      ;    result:=1; (i.e. answer);
 5188  5132       rs  w0  x1-a15+a28;    save w0(internal) := result;
 5189  5134       rs  w2  x1-a15+a30;    save w2(internal):=buf;
 5190  5136       jl.        i10.   ;    goto set result;
 5191  5138  
 5191  5138  ; procedure deliver message;
 5192  5138  ; comment: delivers the message to an internal process, and starts it if it is waiting for a message;
 5193  5138  ; call: w2=buf, w3=link
 5194  5138  ; exit: w0, w1=unchanged, w2, w3=undef
 5195  5138  ; return address: link
 5196  5138  
 5196  5138  d16: ds. w1     i1.    ;    save registers;
 5197  5140       ds. w3     i3.    ;
 5198  5142       zl  w0  x2+a150   ;
 5199  5144       la  w0     b201    ;
 5200  5146       rs  w0  x2+a138   ;    message.state:=if even op then 0 else 1
 5201  5148       rl  w1  x2+a141   ;    internal:=receiver(buf);
 5202  5150       rl  w0  x1+a10    ;
 5203  5152       jl. w3     i21.   ;    test and count area process;
 5204  5154       sn  w0     64     ;    if kind(internal)=pseudo process then
 5205  5156       rl  w1  x1+a50    ;      internal:=mainproc(internal);
 5206  5158       sz  w0    -1-64   ;    if kind(internal) is neither internal process nor pseudo process then
 5207  5160       rl  w1  x1+a250   ;      internal:=driverproc(internal);
 5208  5162       sn  w1     0      ;    if internal not defined then
 5209  5164       jl.        i16.   ;      goto unknown;
 5210  5166       sh  w1     0      ;    if not receiver=internal then
 5211  5168       jl.        i18.   ;       deliver special;
 5212  5170       rs. w1     i8.    ;    save(internal);
 5213  5172  
 5213  5172       bz  w0  x1+a13    ;    w0:=state(internal);
 5214  5174       se  w0     a102   ;    if state<>wait message then
 5215  5176       jl.        i15.   ;      goto event;
 5216  5178  
 5216  5178       rl  w2  x2+6      ;
 5217  5180       rs  w2  x1+a28    ;    save w0(internal):=sender(buf);
 5218  5182       rl  w3  x1+a31    ;    name:=save w3(internal);
 5219  5184       wa  w3  x1+a182   ; get phys. addr.
 5220  5186       dl  w1  x2+a11+2  ;    move 4 words process name;
 5221  5188       ds  w1  x3+2      ;  
 5222  5190       dl  w1  x2+a11+6  ;
 5223  5192       ds  w1  x3+6      ;
 5224  5194  
 5224  5194       rl. w1     i8.    ;
 5225  5196       rl  w2  x1+a29    ;    mess := save w1(internal);
 5226  5198       wa  w2  x1+a182   ; get phys. addr.
 5227  5200       rl. w1     i2.    ;    restore(buf);
 5228  5202       al  w1  x1+8      ;
 5229  5204       jl  w3     d14    ;    move mess(buf+8, mess);
 5230  5206  
 5230  5206  i14: rl. w1     i8.    ; start driver:
 5231  5208       jl  w3     d10    ;    link internal(internal);
 5232  5210       rl  w1     b1     ;    if receiver.priority > sender.priority then
 5233  5212       rl. w3     i8.    ;    begin
 5234  5214       rl  w0  x3+a301   ;
 5235  5216       sl  w0 (x1+a301)  ;
 5236  5218       jl.        i17.   ;
 5237  5220       jl  w3     d20    ;      conditional reschedule(sender);
 5238  5222                         ;    end;
 5239  5222  i17: rl. w1     i8.    ;
 5240  5224       rl. w2     i2.    ;
 5241  5226       jl  w3     d108   ;    claim buffer (internal, buf); notice: error exit if exceeded
 5242  5228       rs  w2  x1+a30    ;    save w2(internal) := buf;
 5243  5230       dl. w1     i1.    ;    restore(w0, w1);
 5244  5232       jl.       (i3.)   ;    return;
 5245  5234  
 5245  5234  i15: al  w1  x1+a15    ; event:
 5246  5236       jl  w3     d6     ;    link(event q(internal), buf);
 5247  5238       se  w0     a104   ;    if state<>wait event then
 5248  5240       jl.        i11.   ;      goto exit;
 5249  5242       zl  w0  x1-a15+a19;    if internal.bufclaim = 0 then
 5250  5244       sn  w0       0    ;
 5251  5246       jl.          i11. ;      goto exit;
 5252  5248       al  w0     0      ;    result:=0; (i.e. message);
 5253  5250       rs  w0  x1-a15+a28;    save w0(internal) := result;
 5254  5252       jl.        i14.   ;    goto start driver;
 5255  5254  
 5255  5254  i16: al  w0     5      ; unknown:
 5256  5256       rs. w0     i23.   ;    result := 5;
 5257  5258       jl.        i20.   ;    goto deliver answer;
 5258  5260  
 5258  5260  ; deliver special
 5259  5260  ; used for messages send to an external process representing devices on
 5260  5260  ; intelligent controllers (ida, ifp  etc.).
 5261  5260  ;
 5262  5260  ; w0: kind of receiver
 5263  5260  ; w1: -
 5264  5260  ; w2: message buffer
 5265  5260  ; w3: -
 5266  5260  ;
 5267  5260  
 5267  5260  i18: 
 5268  5260       zl  w0  x2+a150  ; deliver special
 5269  5262       so  w0     1     ;    if message.operation=input-output then
 5270  5264       jl.        i19.  ;    begin
 5271  5266       dl  w0  x2+a152  ;      <* make message.first,last even *>;
 5272  5268       la  w3     g50   ;
 5273  5270       la  w0     g50   ;
 5274  5272       rl  w1     b1    ;
 5275  5274       sl  w3 (x1+a17)  ;      if message.first < sender.low limit or
 5276  5276       sl  w0 (x1+a18)  ;         message.last  > sender.high limit then
 5277  5278       jl.        i5.   ;         return result(3);
 5278  5280       sh  w0  x3-2     ;      if message.last<message.first then
 5279  5282       jl.        i5.   ;         return result(3);
 5280  5284       wa  w0  x1+a182  ;      message.first:=physical_address(message.first);
 5281  5286       wa  w3  x1+a182  ;      message.last :=physical_address(message.last);
 5282  5288       ds  w0  x2+a152  ;
 5283  5290                        ;    end;
 5284  5290  i19: jl. w3     d141. ;    check operation(message);
 5285  5292       jl.        i4.   ;+0: error: return result(2); 
 5286  5294                        ;+2: ok:
 5287  5294       rl  w1  x2+a141  ;    claim(message);
 5288  5296       ac  w0  x1       ;
 5289  5298       rs  w0  x2+a141  ;
 5290  5300                        ;
 5291  5300       rl  w3  x1+a10   ;    goto driver(receiver.kind);
 5292  5302       jl.    (x3+b55.) ;
 5293  5304                        ;
 5294  5304  i5:  am         1     ; return result(3):
 5295  5306  i4:  al  w0     2     ; return result(2):
 5296  5308       rs. w0     i23.  ;    set result;
 5297  5310       jl.        i20.  ;    goto deliver answer;
 5298  5312                        ;
 5299  5312  
 5299  5312  
 5299  5312  ; test and count area process;
 5300  5312  ;  reg   call      return
 5301  5312  ;  w0    kind      unchanged
 5302  5312  ;  w1    receiver      -
 5303  5312  ;  w2    buff          -
 5304  5312  ;  w3    link      undef
 5305  5312  ;
 5306  5312  i21:                  ; procedure test and count area process;
 5307  5312       se  w0     q4    ;    if proc = area then begin
 5308  5314       jl      x3       ;    begin
 5309  5316       rs. w3     i24.  ;
 5310  5318       zl  w3  x1+a57   ;
 5311  5320       al  w3  x3+1     ;       number of outstanding message:=  
 5312  5322       hs  w3  x1+a57   ;       number of outstanding message+1; 
 5313  5324       jl.        (i24.);
 5314  5326  i24: 0                ; saved rerurn
 5315  5328  
 5315  5328  
 5315  5328  e.
 5316  5328  c.(:a90>0 a.1:)-1
 5317  5328  
 5317  5328  ; coredump.
 5318  5328  ; only used in connection with power up. the dump is executed
 5319  5328  ; using the fpa with io device number 2.
 5320  5328  ;         call:          return:
 5321  5328  ; w0                     destroyed
 5322  5328  ; w1                     destroyed
 5323  5328  ; w2                     destroyed
 5324  5328  ; w3      link           destroyed
 5325  5328  
 5325  5328  b. c10, d40, i50, r20 w.
 5326  5328  
 5326  5328  d140: rs. w3     d32.    ; coredump:
 5327  5330  
 5327  5330  ; start of coredump:
 5328  5330  ;   change eventually contents of devicebase, unless already done.
 5329  5330  
 5329  5330  i0:  al. w0     d11.   ;   device base := local base;
 5330  5332       rx  w0     b65    ;
 5331  5334       se  w0    (b65)   ;   if device base <> old base then
 5332  5336       rx. w0     d30.   ;     save(old device base);
 5333  5338       sn  w0     0      ;   if saved old device base = 0 then
 5334  5340       jl.        i40.   ;     goto end coredump;
 5335  5342  
 5335  5342  ; restart coredump:
 5336  5342  ; the coredump starts from coreaddress zero
 5337  5342  
 5337  5342  i10: al  w1    -512    ;   coreaddr := -512;
 5338  5344       rs. w1     d21.   ;
 5339  5346  
 5339  5346  ; next coreblock:
 5340  5346  
 5340  5346  i11: rl. w1     d21.   ;   addr := coreaddr + 512;
 5341  5348       al  w1  x1+512    ;
 5342  5350       di  w0  x1+8      ;   if addr = top core then
 5343  5352       sx         2.111  ;
 5344  5354       al  w1    -1      ;     endblock := true
 5345  5356       se  w1    -1      ;   else
 5346  5358       rs. w1     d21.   ;     coreaddr := addr;
 5347  5360       rs. w1     d22.   ;
 5348  5362  
 5348  5362       al  w0     0      ;   retries := 0;
 5349  5364       rs. w0     d31.   ;
 5350  5366  
 5350  5366  ; send coreblock:
 5351  5366  ;   initialize transfer-variables
 5352  5366  ;   start the device and wait for interrupt
 5353  5366  
 5353  5366  i15: al  w0     0      ;
 5354  5368       rs. w0     d13.   ;   interrupt := false;
 5355  5370       rs. w0     d23.   ;   received command := illegal;
 5356  5372       do. w0    (d10.)  ;   start device(irrell register);
 5357  5374       rl. w1     d0.    ;   (get loopcount)
 5358  5376  i16:                   ;
 5359  5376       se. w0    (d13.)  ;   wait until interrupt
 5360  5378       jl.        i30.   ;     or timeout;
 5361  5380       al  w1  x1-1      ;
 5362  5382       se  w1     0      ;   if interrupt then
 5363  5384       jl.        i16.   ;     goto after interrupt;
 5364  5386  
 5364  5386  ; the transfer did not terminate within a certain time:
 5365  5386  ;   reset the device, and wait some time
 5366  5386  
 5366  5386  i17: am.       (d10.)  ;
 5367  5388       do  w0    +2      ;   reset device(irrell register);
 5368  5390  ;    sx         2.010  ;   if disconnected then
 5369  5390  ;    jl.        i40.   ;     goto end coredump;
 5370  5390       rl. w1     d1.    ;   (get loop count)
 5371  5392  i18:                   ;
 5372  5392       al  w1  x1-1      ;   wait some time;
 5373  5394       se  w1     0      ;
 5374  5396       jl.        i18.   ;
 5375  5398  
 5375  5398  ; prepare repeat of transfer:
 5376  5398  ;   increase retries
 5377  5398  ;   if too many then halt
 5378  5398  ;   goto send coreblock
 5379  5398  
 5379  5398  i20: rl. w1     d31.   ;
 5380  5400       al  w1  x1+1      ;   increase(retries);
 5381  5402       rs. w1     d31.   ;
 5382  5404       sh  w1     100    ;   if retries < max then
 5383  5406       jl.        i15.   ;     goto send coreblock;
 5384  5408  
 5384  5408       jl        -1      ;   halt;
 5385  5410  
 5385  5410  ; definition of dumpdevice:
 5386  5410  
 5386  5410  r20 = 3                ; 3=fpa transmitter
 5387  5410  
 5387  5410  ; definition of coredump startchar and commandchars:
 5388  5410  
 5388  5410  r10 = 253              ; coredump block
 5389  5410  
 5389  5410  r0  = 128              ; send next block
 5390  5410  r1  = 2                ; start coredump
 5391  5410  r2  = 12               ; end coredump (= reject from ncp)
 5392  5410  r3  = 1                ; retransmit
 5393  5410  
 5393  5410  ; timercounts:
 5394  5410  
 5394  5410  d0:  100000            ; loopcount for transfer
 5395  5412  d1:  100000            ; loopcount for reset
 5396  5414  
 5396  5414  ; device address:
 5397  5414  
 5397  5414  d10: 1<23 + r20 < 3    ;
 5398  5416  
 5398  5416  ; device descriptor:
 5399  5416  
 5399  5416  d11 = k - r20 < 3      ; device base for coredump
 5400  5416  
 5400  5416       c0                ; channel program start
 5401  5418       d12               ; standard status
 5402  5420       d13               ; interrupt address
 5403  5422       -1                ; interrupt data
 5404  5424  
 5404  5424  ; status area:
 5405  5424  
 5405  5424  d12 = 0                ; (not used)
 5406  5424  
 5406  5424  ; interrupt word:
 5407  5424  
 5407  5424  d13: 0                 ; 0==false, else true
 5408  5426  
 5408  5426  ; coredump channel program:
 5409  5426  
 5409  5426  c0:         0<8    , 0  , 12  ; clear core(0:7)
 5410  5432  d20: r10<16+3<8+1<7, d20, 1   ; send startchar (from left char in the command)
 5411  5438  d21 = k+2,  3<8+1<7, 0  , 768 ; send coreblock
 5412  5444              3<8    , d22, 2   ; send coreaddr (two leftmost chars)
 5413  5450              1<8    , d23, 1   ; receive command char
 5414  5456             15<8               ; stop
 5415  5458  
 5415  5458  ; coreaddress: -1==endblock, else blockaddress
 5416  5458  
 5416  5458  d22: 0                 ;
 5417  5460  
 5417  5460  ; command character
 5418  5460  
 5418  5460  d23: 0                 ; (received in leftmost char)
 5419  5462  
 5419  5462  ; miscellaneous:
 5420  5462  
 5420  5462  d30: 0                 ; saved device base
 5421  5464  d31: 0                 ; retries
 5422  5466  d32: 0                   ; saved link
 5423  5468  
 5423  5468  ; after interrupt:
 5424  5468  ;   don't care if the output was not actually made.
 5425  5468  ;   switch out, depending on received command-character.
 5426  5468  
 5426  5468  i30: rl. w0     d23.   ;
 5427  5470       ls  w0    -16     ;   w0 := received command, rigth justified;
 5428  5472  
 5428  5472       sn  w0     r0     ;   if command = next then
 5429  5474       jl.        i11.   ;     goto next coreblock;
 5430  5476       sn  w0     r1     ;   if command = start coredump then
 5431  5478       jl.        i10.   ;     goto restart;
 5432  5480       sn  w0     r2     ;   if command = end then
 5433  5482       jl.        i40.   ;     goto end coredump;
 5434  5484       sn  w0     r3     ;   if command = retransmit then
 5435  5486       jl.        i15.   ;     goto send coreblock;
 5436  5488  
 5436  5488       jl.        i20.   ;   goto prepare repeat;
 5437  5490  
 5437  5490  ; end of coredump:
 5438  5490  ;   restore device base:
 5439  5490  
 5439  5490  i40: rl. w0     d30.   ;
 5440  5492       rs  w0     b65    ;   device base := old device base;
 5441  5494       jl.        (d32.)   ; exit: return;
 5442  5496  e.
 5443  5496  z.
 5444  5496  \f


 5444  5496  
 5444  5496  
 5444  5496  ; procedure set interrupt(address, mask);
 5445  5496  ;           call:   return:
 5446  5496  ; save w0   mask    unchanged
 5447  5496  ; save w1           unchanged
 5448  5496  ; save w2           unchanged
 5449  5496  ; save w3   address unchanged
 5450  5496  
 5450  5496  b. i2 w.
 5451  5496  e0:  rl  w2  x1+a31    ;    address:=save w3 (cur);
 5452  5498  
 5452  5498       al  w0  x2+a180   ;    (w0 = top of regdump)
 5453  5500       se  w2     0      ;    if address <> 0 then
 5454  5502       jl  w3     d112   ;      check within(address, top regdump);
 5455  5504  
 5455  5504       rl  w3  x1+a27    ;
 5456  5506       sn  w3 (x1+a170)  ;    if old intaddr = old escape address then
 5457  5508       rs  w2  x1+a170   ;      escape address := address;
 5458  5510  
 5458  5510       rl  w0  x1+a176   ;
 5459  5512       se  w0     0      ;    if monitor function <> set interrupt address then
 5460  5514       am         a170-a27;      escape address := address
 5461  5516       rs  w2  x1+a27    ;    else intaddr := address;
 5462  5518  
 5462  5518       se  w0     0      ;
 5463  5520       am         4      ;  
 5464  5522       dl. w3     i1.    ;
 5465  5524       la  w2  x1+a28    ;    mask := save w0(cur) extract relevant bits;
 5466  5526       la  w3  x1+a32    ;    status := status(cur) remove the corresponding bits;
 5467  5528       sn  w0     0      ;
 5468  5530       ls  w2    -3      ;    (if set intaddr then oldfashioned rc4000 style)
 5469  5532       lo  w2     6      ;    status(cur) := status 'or' mask;
 5470  5534       rs  w2  x1+a32    ;
 5471  5536       gg  w3     b91    ;    move: user exception address(cur)
 5472  5538       dl  w1  x1+a170   ;          user escape    address(cur)
 5473  5540       ds  w1  x3+a325+a328;    to: previous interrupt stack element;
 5474  5542       jl         c99    ;    goto interrupt return;
 5475  5544  
 5475  5544       8.3000 0000       ; i1-2: extract aritmetic bits (nb: oldfashioned rc4000-way)
 5476  5546  i1:  8.7477 7777       ;     : remove      -      -
 5477  5548       8.2477 0000       ; i1+2: extract escape bits
 5478  5550       8.5300 7777       ; i1+4: remove    -     -
 5479  5552  
 5479  5552  e.
 5480  5552  
 5480  5552  ; procedure process description(name, result);
 5481  5552  ;             call:  return:
 5482  5552  ; save w0            result (=0, proc descr addr)
 5483  5552  ; save w1
 5484  5552  ; save w2
 5485  5552  ; save w3     name
 5486  5552  
 5486  5552  b. i0, j0 w.
 5487  5552  e2:  rl  w0  x1+a176   ; if monitor call = 4 then
 5488  5554       se  w0     4      ; begin
 5489  5556       jl.        j0.    ;
 5490  5558       jl  w3     d101   ;    check and search name
 5491  5560       al. w3     i0.    ;+2  not found: w3:=zero address
 5492  5562       rl  w0  x3        ;    result := proc descr;  
 5493  5564       jl         r28    ;    goto return prepared result;
 5494  5566  j0:  rs  w1  x1+a29    ; own process:
 5495  5568       jl         c99    ; save w1 := own process description;
 5496  5570  i0: 0                  ; end;
 5497  5572  e.
 5498  5572  
 5498  5572  ; procedure initialize process(name, result);
 5499  5572  ;    -      reserve       -   ( -  ,   -   );
 5500  5572  ;              call:   return:
 5501  5572  ; save w0              result (=0, 1, 2, 3, 4)
 5502  5572  ; save w1              unchanged
 5503  5572  ; save w2              unchanged
 5504  5572  ; save w3      name    unchanged
 5505  5572  
 5505  5572  b.  i10, j21, h90  w.
 5506  5572  
 5506  5572  e3:                    ; initialize process:
 5507  5572  e4:                    ; reserve process:
 5508  5572                         ; begin
 5509  5572       al  w0  x2        ;   save monitor function;
 5510  5574       jl  w3     d101   ;   check and search name;
 5511  5576       jl         r3     ;   +0: not found: goto result(3);
 5512  5578       rl  w2  x3        ;   +2: found: proc := name table(entry);
 5513  5580       am     (x2+a10)   ;
 5514  5582       jl.       (2)     ;   goto case proc.kind of:
 5515  5584                         ;   (
 5516  5584       h0                ;    0: internal 
 5517  5586       h2                ;    2: clock 
 5518  5588       h4                ;    4: area 
 5519  5590       h6                ;    6: ida disc
 5520  5592       h8                ;    8: csp_terminal/sspconsole (9)
 5521  5594       r3                ;   10: 
 5522  5596       r3                ;   12:
 5523  5598       h28               ;   14: csp-printer
 5524  5600       r3                ;   16:
 5525  5602       h18               ;   18: ida mag tape
 5526  5604       h20               ;   20: ida main
 5527  5606       r3                ;   22:
 5528  5608       r3                ;   24:
 5529  5610       h26               ;   26: ifp main
 5530  5612       h28               ;   28: ifp general sequential device
 5531  5614       r3                ;   30:
 5532  5616       r3                ;   32:
 5533  5618       r3                ;   34:
 5534  5620       r3                ;   36:
 5535  5622       r3                ;   38:
 5536  5624       r3                ;   40:
 5537  5626       r3                ;   42:
 5538  5628       r3                ;   44:
 5539  5630       r3                ;   46:
 5540  5632       r3                ;   48:
 5541  5634       r3                ;   50:
 5542  5636       r3                ;   52:
 5543  5638       r3                ;   54:
 5544  5640       r2                ;   56: remoter, not allowed
 5545  5642       r3                ;   58:
 5546  5644       r3                ;   60:
 5547  5646       h62               ;   62: disc
 5548  5648       h64               ;   64: pseudo 
 5549  5650       r3                ;   66:
 5550  5652       r3                ;   68: free ida/ifp subprocess
 5551  5654       r3                ;   70:
 5552  5656       r2                ;   72: rc8602 (sscir), not allowed
 5553  5658       r3                ;   74: rc8602 (isrpy), does not exist
 5554  5660       h76               ;   76: rc8601 (sscir)
 5555  5662       h78               ;   78: rc8601 (isrpy)
 5556  5664       h80               ;   80: fpa main
 5557  5666       r2                ;   82: fpa host, not allowed
 5558  5668       h84               ;   84: fpa subprocess
 5559  5670       h86               ;   86: fpa receiver
 5560  5672       h88               ;   88: fpa transmitter
 5561  5674       r2                ;   90: host, not allowed
 5562  5676                         ;   );
 5563  5676                         ;
 5564  5676  ; *** at entry:  w0: monitor function
 5565  5676  ;                w1: cur
 5566  5676  ;                w2: proc
 5567  5676  
 5567  5676  h0:                    ; internal:
 5568  5676  h2:                    ; clock:
 5569  5676  h64:                   ; pseudo:
 5570  5676                         ; begin
 5571  5676       se  w0     8      ;   if monitor function = initialize then
 5572  5678       jl         r0     ;        result(0)
 5573  5680       jl         r2     ;   else result(2);
 5574  5682                         ; end;
 5575  5682                         ;
 5576  5682  h4:                    ; area:
 5577  5682       rs. w0     i2.    ; begin
 5578  5684       jl  w3     d102   ;   check user(cur, proc);
 5579  5686       jl         r3     ;   +0: not user: result(3);
 5580  5688       rl. w0     i2.    ;   +2: user:
 5581  5690       se  w0     8      ;   if monitor function = initialize then
 5582  5692       jl         r0     ;   result(0);
 5583  5694                         ;
 5584  5694       jl. w3     j21.   ;   check reserver ok(cur, proc);
 5585  5696       jl  w3     d114   ;   check writeprotect(cur, proc);
 5586  5698       jl.        j1.    ;   +0: none: goto check base;
 5587  5700       jl.        j2.    ;   +2: internal: goto reserve proc;
 5588  5702       jl         r4     ;   +4: other: result(4);
 5589  5704       jl         r4     ;   +6: other+internal: result(4);
 5590  5706                         ;
 5591  5706  j1:                    ;   check base:
 5592  5706       dl  w0  x2+a49    ;   if proc.upperbase > cur.maxupper or
 5593  5708       al  w3  x3+1      ;      proc.lowerbase < cur.maxlower then
 5594  5710       sh  w0 (x1+a44)   ;      result(2);
 5595  5712       sh  w3 (x1+a44-2) ;
 5596  5714       jl      r2        ;
 5597  5716                         ;
 5598  5716  j2:                    ;   reserve proc:
 5599  5716       jl  w3     d125   ;   reserve process(cur, proc);
 5600  5718       jl         r0     ;   result(0);
 5601  5720                         ; end;
 5602  5720                         ;
 5603  5720  h6:                    ; ida disc:
 5604  5720                         ; begin
 5605  5720       jl. w3     j20.   ;   check user and initialize(monitor function, cur, proc);
 5606  5722       jl. w3     j21.   ;   check reserve ok(cur, proc);
 5607  5724       rs. w2     i3.    ;
 5608  5726       zl  w0  x2+a57    ;   if proc.type = physical disc then
 5609  5728       sz  w0     2.1    ;   begin
 5610  5730       jl.        j4.    ;
 5611  5732  j3:  rl  w2  x2+a70    ;     proc := proc.next logical disc;
 5612  5734       sn  w2     0      ;     while proc <> 0 do
 5613  5736       jl.        j5.    ;     begin
 5614  5738       jl  w3     d113   ;       check any reserver(cur, proc);
 5615  5740       jl         r1     ;       +0: other: result(1);
 5616  5742       jl.        j3.    ;       +2: internal:
 5617  5744       jl.        j3.    ;       +4: none:
 5618  5746                         ;       proc := proc.next logical disc;
 5619  5746                         ;     end;
 5620  5746  j4:                    ;   end else
 5621  5746       sz  w0  2.0100000 ;   begin  (*w0 state)
 5622  5748       jl         r2     ;     if part of logical volume then result(2)
 5623  5750       rl  w2  x2+a50    ;   
 5624  5752       jl  w3     d113   ;     check any reserver(cur, proc.main);
 5625  5754       jl         r1     ;     +0: other: result(1);
 5626  5756       am         0      ;     +2: internal:
 5627  5758                         ;     +4: none:
 5628  5758                         ;   end;
 5629  5758  j5:  rl. w2     i3.    ;   
 5630  5760       jl  w3     d125   ;   reserve process(cur, proc);
 5631  5762       jl         r0     ;   result(0);
 5632  5764                         ; end;
 5633  5764                         ;
 5634  5764                         ;
 5635  5764  h8:                    ; csp_terminal process:
 5636  5764       rs. w0     i2.    ; begin
 5637  5766  
 5637  5766       jl  w3     d126   ;   include user(cur, proc);
 5638  5768                         ;   
 5639  5768       rl  w0  x2+a10    ;   if proc.kind=ssp_console then
 5640  5770       sn  w0     q9     ;    result(0);
 5641  5772       jl         r0     ;    <* just say jyes *>
 5642  5774       jl  w3     d113   ;   check any reserver(cur, proc);
 5643  5776       jl         r1     ;   +0: other: result(1);
 5644  5778       am         0      ;   +2: internal:
 5645  5780       al  w3     1      ;   +4: none:
 5646  5782       hs  w3  x2+a56+1  ;   proc.external state := initialized;
 5647  5784       rl. w0     i2.    ;
 5648  5786       se  w0     8      ;   if initialize then
 5649  5788       jl         r0     ;   result(0)
 5650  5790                         ;   else begin
 5651  5790       al  w0     0      ;     cur.save_w0 := 0; <* prepare ok result *>
 5652  5792       rs  w0  x1+a28    ;
 5653  5794       jl. w3     j21.   ;     test reserver;
 5654  5796       jl  w3     d125   ;     reserve(int_proc,ext_proc);
 5655  5798       rs  w1  x2+a74    ;     proc.reserver_process := cur;
 5656  5800                         ;     <* force := no *>
 5657  5800       al  w2  x2+a81    ;     element := proc.process_queue;
 5658  5802       jl.        d142.  ;     test_ready_and_setup(force, element);
 5659  5804                         ;   end;
 5660  5804                         ; end;
 5661  5804                         ;
 5662  5804  h20:                   ; ida main:
 5663  5804  h26:                   ; ifp main:
 5664  5804                         ; begin
 5665  5804       jl. w3     j20.   ;   check user and initialize(monitor function, cur, proc);
 5666  5806       jl. w3     j21.   ;   check reserver ok(cur,proc);
 5667  5808       jl  w3     d125   ;   reserve process(cur, proc);
 5668  5810       jl         r0     ;   result(0);
 5669  5812                         ; end;
 5670  5812                         ;
 5671  5812                         ;
 5672  5812  h18:                   ; ida mag tape:
 5673  5812  h28:                   ; ifp gsd and csp-printer:
 5674  5812  h76:                   ; rc8601 (sscir):
 5675  5812  h78:                   ; rc8601 (isrpy):
 5676  5812                         ; begin
 5677  5812       jl  w3     d102   ;   check user(cur, proc);
 5678  5814       jl         r2     ;   +0: not user: result(2);
 5679  5816                         ;   +2: user:
 5680  5816       jl. w3     j21.   ;   check reserver ok(cur, proc);
 5681  5818       jl  w3     d125   ;   reserve process(cur, proc);
 5682  5820       jl         r0     ;   result(0);
 5683  5822                         ; end;
 5684  5822                         ;
 5685  5822  h62:                   ; disc:
 5686  5822                         ; begin
 5687  5822       jl. w3     j20.   ;   check user and initialize(monitor function, cur, proc);
 5688  5824       jl. w3     j21.   ;   check reserver ok(cur, proc);
 5689  5826       rs. w2     i3.    ;  
 5690  5828       rl  w2  x2+a50    ;   proc := proc.main;
 5691  5830       sn  w2     0      ;   if proc <> none then
 5692  5832       jl.        j7.    ;   begin <*logical disc*>
 5693  5834       jl  w3     d113   ;     check any reserver(cur, main);
 5694  5836       jl         r1     ;     +0: other: result(1);
 5695  5838       am         0      ;     +2: internal:
 5696  5840       jl.        j10.   ;     +4: none:
 5697  5842                         ;   end else
 5698  5842  j7:                    ;   begin <*physical disc*>
 5699  5842       rl  w2     b4     ;
 5700  5844  j8:  rs. w2     i4.    ;     proc := first external;
 5701  5846       rl  w2  x2+0      ;     repeat begin
 5702  5848       rl  w3  x2+a10    ;
 5703  5850       rl  w0  x2+a50    ;       if proc.kind = disc and
 5704  5852       sn  w3     62     ;          proc.main = main then
 5705  5854       se. w0    (i3.)   ;       begin
 5706  5856       jl.        j9.    ;
 5707  5858       jl  w3     d113   ;         check any reserver(cur, proc);
 5708  5860       jl         r1     ;         +0: other: result(1);
 5709  5862       am         0      ;         +2: internal: 
 5710  5864                         ;         +4: none:
 5711  5864  j9:  am.       (i4.)   ;       end;
 5712  5866       al  w2     2      ;       proc := next external;
 5713  5868       se  w2    (b5)    ;     end
 5714  5870       jl.        j8.    ;     until proc = first area;
 5715  5872                         ;
 5716  5872  j10:                   ;   end;
 5717  5872       rl. w2     i3.    ;
 5718  5874       jl  w3     d125   ;   reserve process(cur, proc);
 5719  5876       jl         r0     ;   result(0);
 5720  5878                         ; end;
 5721  5878                         ;
 5722  5878                         ;
 5723  5878  h80:                   ; fpa main:
 5724  5878                         ; begin
 5725  5878       jl. w3     j20.   ;   check user and initialize(monitor function, cur, proc);
 5726  5880       jl. w3     j21.   ;   check reserver ok(cur, proc);
 5727  5882       rs. w2     i3.    ;
 5728  5884       rl  w3     b4     ;   main := first external;
 5729  5886       sz                ;
 5730  5888  j11: al  w3  x3+2      ;   while main <> proc do
 5731  5890       se  w2 (x3+0)     ;   main := next in nametable;
 5732  5892       jl.        j11.   ;
 5733  5894                         ;
 5734  5894       rs. w3     i4.    ;   
 5735  5896       rl  w2  x3+2      ;   rec := nametable(main.devno + 1);
 5736  5898       jl  w3     d113   ;   check any reserver(cur, rec);
 5737  5900       jl         r1     ;   +0: other: result(1);
 5738  5902       am         0      ;   +2: internal:
 5739  5904       rl. w2     i4.    ;   +4: none:
 5740  5906       rl  w2  x2+4      ;   trm := nametable(main.devno + 2);
 5741  5908       jl  w3     d113   ;   check any reserver(cur, trm);
 5742  5910       jl         r1     ;   +0: other: result(1);
 5743  5912       am         0      ;   +2: internal:
 5744  5914       rl. w2     i3.    ;   +4: none:
 5745  5916       jl  w3     d125   ;   reserve process(cur, proc);
 5746  5918       jl         r0     ;   result(0);
 5747  5920                         ; end;
 5748  5920                         ;
 5749  5920                         ;
 5750  5920  h84:                   ; fpa subprocess:
 5751  5920       rs. w0     i2.    ; begin
 5752  5922       rl  w3  x2+a10    ;
 5753  5924       se  w3     84     ;   if proc.kind = temp then
 5754  5926       jl  w3     d126   ;   include user(cur, proc);
 5755  5928       jl  w3     d102   ;   check user(cur, proc);
 5756  5930       jl         r2     ;   +0: not user: result(2);
 5757  5932                         ;   +2: user:
 5758  5932       jl  w3     d113   ;   check any reserver(cur, proc);
 5759  5934       jl         r1     ;   +0: other: result(1);
 5760  5936       am         0      ;   +2: internal:
 5761  5938       al  w3     1      ;   +4: none:
 5762  5940       hs  w3  x2+a56+1  ;   proc.external state := initialized;
 5763  5942       rl. w0     i2.    ;
 5764  5944       zl  w3  x2+a63    ;
 5765  5946       se  w0     8      ;   if not initialize or
 5766  5948       se  w3     8      ;      proc.subkind <> terminal then
 5767  5950       jl  w3     d125   ;   reserve process(cur, proc);
 5768  5952       jl         r0     ;   result(0);
 5769  5954                         ; end;
 5770  5954                         ;
 5771  5954                         ;
 5772  5954  h86:                   ; fpa receiver:
 5773  5954  h88:                   ; fpa transmitter:
 5774  5954                         ; begin
 5775  5954       jl. w3     j20.   ;   check user and initialize(monitor function, cur, proc);
 5776  5956       jl. w3     j21.   ;   check reserver ok(cur, proc);
 5777  5958       rs. w2     i3.    ;
 5778  5960       rl  w2  x2+a50    ;   main := proc.main;
 5779  5962       jl  w3     d113   ;   check any reserver(cur, main);
 5780  5964       jl         r1     ;   +0: other: result(1);
 5781  5966       am         0      ;   +2: internal:
 5782  5968       rl. w2     i3.    ;   +4: none:
 5783  5970       jl  w3     d125   ;   reserve process(cur, proc);
 5784  5972       jl         r0     ;   result(0);
 5785  5974                         ; end;
 5786  5974                         ;
 5787  5974  i1:  0                 ; return address
 5788  5976  i2:  0                 ; monitor function
 5789  5978  i3:  0                 ; save proc
 5790  5980  i4:  0                 ; nt index
 5791  5982                         ;
 5792  5982                         ;
 5793  5982  ; procedure check user and initialize(func, cur, proc);
 5794  5982  ;       call           return
 5795  5982  ;  w0  monitor func    monitor func
 5796  5982  ;  w1  cur             cur
 5797  5982  ;  w2  proc            proc
 5798  5982  ;  w3  link            -
 5799  5982  ;
 5800  5982  ;  return:  if user and func = reserve        : link
 5801  5982  ;           if not user                       : result 2
 5802  5982  ;           if user and func = initialize     : result 0
 5803  5982  ;
 5804  5982  
 5804  5982  j20:                   ; begin
 5805  5982       ds. w0     i2.    ;
 5806  5984       jl  w3     d102   ;   check user(cur, proc);
 5807  5986       jl         r2     ;   +0: not user: result(2);
 5808  5988       rl. w0     i2.    ;   +2: user:
 5809  5990       sn  w0     6      ;   if initialize then
 5810  5992       jl         r0     ;        result(0)
 5811  5994       jl.       (i1.)   ;   else return to link;
 5812  5996                         ; end;
 5813  5996  
 5813  5996  ; procedure check reserve ok(cur, proc);
 5814  5996  ;           call       return
 5815  5996  ;  w0:      -          destroyed
 5816  5996  ;  w1:      cur        cur
 5817  5996  ;  w2:      proc       proc
 5818  5996  ;  w3:      link       -
 5819  5996  ; 
 5820  5996  ;  return:  other reserver : result 1
 5821  5996  ;           internal       : result 0
 5822  5996  ;           none           : link
 5823  5996  ;
 5824  5996  
 5824  5996  j21:                   ; begin
 5825  5996       rs. w3     i1.    ;
 5826  5998       jl  w3     d113   ;   check any reserver(cur, proc);
 5827  6000       jl         r1     ;   +0: other: result(1);
 5828  6002       jl         r0     ;   +2: internal: result(0);
 5829  6004       jl.       (i1.)   ;   +4: none: return to link;
 5830  6006                         ; end;
 5831  6006  
 5831  6006                         ;
 5832  6006  e.                     ;
 5833  6006  
 5833  6006  ; procedure release process (name);
 5834  6006  ;            call:  return:
 5835  6006  ; save w0           unchanged
 5836  6006  ; save w1           unchanged
 5837  6006  ; save w2           unchanged
 5838  6006  ; save w3    name   unchanged
 5839  6006  b. i5 w.
 5840  6006  
 5840  6006  e5:  jl  w3     d101   ;    check and search name;
 5841  6008       jl         c99    ;+2  not found: goto interrupt return;
 5842  6010       rl  w2  x3        ;+4  proc:=name table(entry);
 5843  6012       rl  w3  x2+a10    ;    if proc.kind <> internal and
 5844  6014       sz  w3    -1-64   ;       proc.kind <> pseudo then
 5845  6016       jl  w3     d113   ;    check reserver
 5846  6018       jl         c99    ;+0  other reserver or proc =internal/pseudo: return
 5847  6020       sz                ;+2  cur is reserver: continue
 5848  6022       jl         c99    ;+4  no reserver    : return
 5849  6024       rl  w3  x2+a10    ;
 5850  6026       sz  w3    -1-64   ;       proc.kind <> pseudo then
 5851  6028       jl  w3     d124   ;    release process(cur, proc);
 5852  6030       rl  w0  x2+a10    ; if proc.kind = csp terminal then
 5853  6032       se  w0     q8     ; begin
 5854  6034       jl         c99    ;
 5855  6036       al  w0     0      ;   proc.reserver_process := 0;
 5856  6038       rs  w0  x2+a74    ;
 5857  6040                         ;   <* force := no *>
 5858  6040       al  w2  x2+a81    ;   element := proc.process_queue;
 5859  6042       jl.        d142.  ;   test_ready_and_setup(force, element);
 5860  6044                         ; end;
 5861  6044  e.
 5862  6044                         ;    end;
 5863  6044  
 5863  6044  ; procedure include user(name, device, result);
 5864  6044  ;     -     exclude  -  ( -  ,   -   ,   -   );
 5865  6044  ;            call:   return:
 5866  6044  ; save w0            result (=0, 2, 3, 4)
 5867  6044  ; save w1    device  unchanged
 5868  6044  ; save w2            unchanged
 5869  6044  ; save w3    name    unchanged
 5870  6044  
 5870  6044  b. i0 w.
 5871  6044  e6:  am         d126-d123; include: switch := insert user;
 5872  6046  e7:  al  w0     d123     ; exclude: switch := remove user;
 5873  6048       rs. w0     i0.    ;    save(switch);
 5874  6050       jl  w3     d101   ;    check and search name;
 5875  6052       jl         r3     ;+2  not found: goto result3;
 5876  6054       rl  w2  x3        ;+4  child:=name table(entry);
 5877  6056       rs  w2  x1+a28    ;    save w0(cur) := child;
 5878  6058       rl  w3  x2+a10    ;    w3:=kind(child);
 5879  6060       sn  w3     0      ;    if kind<>0 or
 5880  6062       se  w1 (x2+a34)   ;       cur<>parent(child) then
 5881  6064       jl         r3     ;    goto result 3;
 5882  6066       rl  w3  x1+a29    ;    device:=save w1(cur);
 5883  6068       ls  w3     1      ;
 5884  6070       wa  w3     b4     ;    entry:=2*device+first device;
 5885  6072       sl  w3    (b4)    ;    if entry<first device or
 5886  6074       sl  w3    (b5)    ;       entry>=first area then
 5887  6076       jl         r4     ;    goto result 4;
 5888  6078       rl  w2  x3        ;    proc:=name table(entry);
 5889  6080       jl  w3     d102   ;    check user(cur, proc);
 5890  6082       jl         r2     ;+2  not user: goto result 2;
 5891  6084  
 5891  6084       rl  w1  x1+a28    ;    restore(child);
 5892  6086       jl. w3    (i0.)   ;    insert/remove user(child, proc);
 5893  6088       rl  w1     b1     ;    restore(cur);
 5894  6090       jl         r0     ;    goto result 0;
 5895  6092  i0:  0                 ; saved switch
 5896  6094  e.
 5897  6094    
 5897  6094  ; procedure send pseudo message(pseudo proc, name, mess, buf);
 5898  6094  ;             call              return
 5899  6094  ; save w0     pseudo proc descr unch.
 5900  6094  ; save w1     mess              unch.
 5901  6094  ; save w2     mess flag         unch.
 5902  6094  ; save w3     name              unch.
 5903  6094    
 5903  6094  
 5903  6094  ; procedure send message(name, mess, buf); send att message (driver function);
 5904  6094  ;           call: call:      return:
 5905  6094  ; save w0              unchanged
 5906  6094  ; save w1   mess       unchanged mess
 5907  6094  ; save w2   mess flag  unchanged sender
 5908  6094  ; save w3   name       unchanged receiver
 5909  6094  b. i15 w.
 5910  6094                         ; send pseudo message:
 5911  6094  e62: rl  w3  x1+a28    ;    proc:= savew0(cur);
 5912  6096       rl  w2    (b5)
 5913  6098       rl  w0    (b6)
 5914  6100       sl  w3  x2
 5915  6102       sl  w3    (0)
 5916  6104       jl      c29       ;
 5917  6106       rl  w2  x3+a10    ;
 5918  6108       se  w2  64        ;    if kind(proc) <> pseudo kind
 5919  6110       jl      c29       ;       then goto internal 3;
 5920  6112       rl  w2  x3+a50    ;
 5921  6114       se  w2  (b1)      ;    if main(proc) <> cur
 5922  6116       jl      c29       ;       then goto internal 3;
 5923  6118       am      -1        ;    function:= send pseudo message;
 5924  6120                         ; send message:
 5925  6120  e8:  al  w0   0        ;    function:= send message;
 5926  6122       rs. w0  i7.       ;    save function;
 5927  6124       rl  w3  x1+a31    ;    
 5928  6126       rl  w2  x1+a176   ;    if cause = send att mess then
 5929  6128       sn  w2     17     ;
 5930  6130       jl.        i3.    ;      goto driver message;
 5931  6132  i6:  jl  w3     d110   ;    check mess area and name area(name);
 5932  6134       wa  w2  x1+a182   ; get phys. addr.
 5933  6136       rl  w3  x2+8      ;    entry:=word(name+8);
 5934  6138       sl  w3    (b3)    ;    if entry<name table start or
 5935  6140       sl  w3    (b7)    ;       entry>=name table end then
 5936  6142       jl.        i1.    ;    goto search;
 5937  6144       rl  w3  x3        ;    proc:=name table(entry);
 5938  6146       dl  w1  x2+2      ;    
 5939  6148       sn  w0 (x3+a11)   ;    if name in call<>name in monitor then
 5940  6150       se  w1 (x3+a11+2) ;
 5941  6152       jl.        i1.    ;      goto search;
 5942  6154       sn  w0     0      ;    if name(0)=0 then
 5943  6156       jl.        i2.    ;      goto unknown;
 5944  6158       dl  w1  x2+6      ;  
 5945  6160       sn  w0 (x3+a11+4) ;
 5946  6162       se  w1 (x3+a11+6) ;
 5947  6164       jl.        i1.    ;
 5948  6166  
 5948  6166  ; the receiver is found. now check bufclaim and deliver the message
 5949  6166  ; w3=proc
 5950  6166  i0:  rl. w0  i7.       ;    if function = send pseudo message then
 5951  6168       sn  w0  0         ;    begin
 5952  6170       jl.     i10.      ;     
 5953  6172       rl  w0  x3+a10    ;      if kind(receiver) <> internal
 5954  6174       se  w0  0         ;         then goto internal 3;
 5955  6176       jl      c29       ;    end;
 5956  6178  i10: rl  w1  b1        ;
 5957  6180       bz  w0  x1+a19    ;    if buf claim(cur)=0 then
 5958  6182       sn  w0     0      ;      goto decrease buffer claim;
 5959  6184       jl         d108   ;      (which exits with save w2=0);
 5960  6186       bs. w0     1      ;    decrease (bufclaim(cur));
 5961  6188       hs  w0  x1+a19    ;  
 5962  6190       rl  w2     b8     ;    buf:=next(mess pool);
 5963  6192       rs  w3  x2+4      ;    receiver(buf):=proc;
 5964  6194       rl. w3  i7.       ;    
 5965  6196       se  w3  0         ;    if function = send pseudo message 
 5966  6198       jl.     i8.       ;       then sender(buf):= pseudo proc 
 5967  6200       rs  w1  x2+6      ;       else sender(buf):= cur;
 5968  6202       jl.     i9.       ;
 5969  6204  i8:  rl  w3  x1+a28    ;
 5970  6206       rs  w3  x2+6      ;
 5971  6208  i9:
 5972  6208       rl  w3  x1+a30    ;
 5973  6210       rs  w3  x2+a139   ;   mess flag(buf):=saved w2;
 5974  6212       rs  w2  x1+a30    ;    save w2(cur):=buf;
 5975  6214       rl  w3  x1+a29    ;    mess:=save w1(cur);
 5976  6216       wa  w3  x1+a182   ; get phys. addr.
 5977  6218       dl  w1  x3+2      ;
 5978  6220       ds  w1  x2+10     ;    move 8 words from mess to buf;
 5979  6222       dl  w1  x3+6      ;
 5980  6224       ds  w1  x2+14     ; 
 5981  6226       dl  w1  x3+10     ;
 5982  6228       ds  w1  x2+18     ;
 5983  6230       dl  w1  x3+14     ;
 5984  6232  i4:  ds  w1  x2+22     ; move last:
 5985  6234       jl  w3     d5     ;    remove(buf);
 5986  6236       al  w3     c99    ;    deliver message(buf);
 5987  6238       jl.        d16.   ;    goto interrupt return;
 5988  6240  
 5988  6240  ; the name table address was illegal or not correct:
 5989  6240       
 5989  6240  i1:  rl  w1  b1        ; w1:= cur
 5990  6242       ws  w2  x1+a182   ; logical address
 5991  6244       jl  w3     d11    ; search name(name.entry)
 5992  6246       jl.        i2.    ; not found: goto unknown
 5993  6248       wa  w2  x1+a182   ; physical buffer address
 5994  6250       rs  w3  x2+8      ;    word(name+8):=entry;
 5995  6252       rl  w3  x3        ;    proc:=name table(entry);
 5996  6254       jl.        i0.    ;    goto found;
 5997  6256  
 5997  6256  i2:  rl  w1     b1     ; unknown:
 5998  6258       rl  w2     b8     ;    buf:=next(mess pool);
 5999  6260       rl  w3  x1+a30    ;
 6000  6262       rs  w3  x2+a139   ; mess.flag=saved w2
 6001  6264       jl  w3     d108   ;    claim buffer(cur, buf);
 6002  6266       rs  w2  x1+a30    ;    save w2(cur) := buf;
 6003  6268       al. w0     i3.    ;    pseudo receiver point to here;
 6004  6270       rl. w3  i7.       ;    if function = send pseudo message
 6005  6272       se  w3  0         ;       then sender(buf):= pseudo proc
 6006  6274       rl  w1  x1+a28    ;       else sender(buf):= cur;
 6007  6276       ds  w1  x2+a142   ;    sender(buf):=cur;
 6008  6278       al  w0     5      ;
 6009  6280       al  w3     c99    ;    deliver answer(buf,result);
 6010  6282       jl.        d15.   ;    goto interrupt return;
 6011  6284  
 6011  6284  ; test that save w2(cur) is an external proc description
 6012  6284  i3:  rl  w2     b4     ;
 6013  6286       rl  w3  x1+a30    ;    for w2 := first device in name table
 6014  6288  i5:  sl  w2    (b5)    ;      step 2 until top device do
 6015  6290       jl         c29    ;
 6016  6292       al  w2  x2+2      ;      if save w1(cur) = entry(w2) then
 6017  6294       se  w3 (x2-2)     ;        goto found;
 6018  6296       jl.        i5.    ; not found: goto internal 3;
 6019  6298       rl  w0  x3+a10    ; 
 6020  6300       sn  w0     q8     ;    if proc.kind = csp_terminal then
 6021  6302       rl  w3  x3+a50    ;       proc := proc.main;
 6022  6304       se  w1 (x3+a250)  ;      if cur <> driverproc(proc) then
 6023  6306       jl         c29    ;      goto internal 3;
 6024  6308       rl  w3  x1+a31    ;
 6025  6310       rl  w0  x3+a10    ;    w0:= receiver kind
 6026  6312       sz  w0     -1-64  ;    if kind<>internal and kind<>pseudo then
 6027  6314       jl         c29    ;    goto internal 3
 6028  6316       rl  w2     b8     ;    buf := next (mess buf pool);
 6029  6318       jl  w3     d108   ;    claim buffer(buf);
 6030  6320       rl  w3  x1+a31    ;    receiver(buf) := save w3(cur);
 6031  6322       al  w0     0      ;     flag := 0;
 6032  6324       rx  w0  x1+a30    ;    sender(buf) := proc; i.e. save w2(cur);
 6033  6326       ds  w0  x2+6      ;
 6034  6328       jl.        i9.    ;    goto move last;
 6035  6330  i7:  0                 ;    save function;
 6036  6332  e.
 6037  6332  
 6037  6332  ; procedure wait answer(buf, answer, result);
 6038  6332  ;            call:      return:
 6039  6332  ; save w0               result (=1, 2, 3, 4, 5)
 6040  6332  ; save w1    answer     unchanged
 6041  6332  ; save w2    b   uf     unchanged
 6042  6332  ; save w3               unchanged
 6043  6332  b. i5 w.
 6044  6332  
 6044  6332  e9:  jl  w3     d103   ;    check message area and buf;
 6045  6334       rl  w3  x2+6      ;    proc:= sender(buf);
 6046  6336       rl  w0  x3+a10    ;    if kind(proc) = pseudo kind then
 6047  6338       se  w0  64        ;     begin
 6048  6340       jl.     i0.       ;       if main(proc) <> cur
 6049  6342       rl  w0  x3+a50    ;          then goto internal 3
 6050  6344       se  w0  (b1)      ;          else goto ok;
 6051  6346       jl      c29       ;     end
 6052  6348       jl.     i1.       ;     else
 6053  6350  i0:  se  w1  (x2+6)    ;       if proc <> cur
 6054  6352       jl      c29       ;          then goto internal 3;
 6055  6354  i1:                    ; ok:
 6056  6354       rl  w0  x2+4      ;    w0:=receiver(buf);
 6057  6356       sz  w0    -8      ;    if answer not send then
 6058  6358       jl         d104   ;      goto remove wait answer;
 6059  6360       rs  w0  x1+a28    ;    save w0(cur):=result;
 6060  6362       jl  w3     d109   ;    increase claim, remove release buf(cur, buf);
 6061  6364       rl  w3     b1     ;    w3:=cur;
 6062  6366       al  w1  x2+8      ;    
 6063  6368       rl  w2  x3+a29    ;    move mess(buf+8, answer);
 6064  6370       wa  w2  x3+a182   ; get physical address of answer area
 6065  6372       al  w3     c99    ;
 6066  6374       jl         d14    ;    goto interrupt return;
 6067  6376  e.
 6068  6376  
 6068  6376  ; procedure wait message(name, mess, buf, result);
 6069  6376  ;           call:   return:
 6070  6376  ; save w0           result (=sender descr addr)
 6071  6376  ; save w1   mess    unchanged
 6072  6376  ; save w2           buf 
 6073  6376  ; save w3   name    unchanged
 6074  6376  
 6074  6376  b. i8 w.
 6075  6376  
 6075  6376  e10: jl  w3     d110   ;    check mess area and name area;
 6076  6378       al  w3    -8      ;
 6077  6380       al  w2  x1+a15    ;    buf:=event q(cur);
 6078  6382  i2:  rl  w2  x2+0      ; next: buf:=next(buf);
 6079  6384       sn  w2  x1+a15    ;    if buf=event q(cur) then
 6080  6386       jl         d105   ;      goto remove wait message;
 6081  6388       sz  w3 (x2+4)     ;    if answer then
 6082  6390       jl.        i3.    ;
 6083  6392       jl.        i2.    ;      goto next;
 6084  6394  i3:  sl  w2    (b8+4)  ;    if buf not message buffer then
 6085  6396       sl  w2    (b8+6)  ;
 6086  6398       jl.        i2.    ;      goto next; (i.e. some kind of general event);
 6087  6400       sh  w3 (x2+4)     ;    if message buffer not claimed then
 6088  6402       jl  w3     d108   ;      claim buffer(cur,buf);
 6089  6404       jl  w3     d5     ;    remove(buf);
 6090  6406       rl  w3  x2+6      ;
 6091  6408       rs  w3  x1+a28    ;    save w0(cur):=sender(buf);
 6092  6410       rs  w2  x1+a30    ;    save w2(cur):=buf;
 6093  6412       sh  w3     0      ;    if sender(buf)<=0 then
 6094  6414       al  w3  x1        ;      sender:=dummy name address;
 6095  6416       rl  w2  x1+a31    ;    move 4 words process name
 6096  6418       wa  w2  x1+a182   ; add base of current process
 6097  6420       dl  w1  x3+a11+2  ;      from sender
 6098  6422       ds  w1  x2+2      ;
 6099  6424       dl  w1  x3+a11+6  ;
 6100  6426       ds  w1  x2+6      ;      to name parameter;
 6101  6428       rl  w2     b1     ;  
 6102  6430       rl  w0  x2+a182   ; get base of current process
 6103  6432       dl  w3  x2+a30    ; mess:= save w1(cur)
 6104  6434       wa  w2  0         ; get physical address of message area
 6105  6436       al  w1  x3+8      ;    w1:=buf+8;
 6106  6438       al  w3     c99    ;    move mess(buf+8, mess);
 6107  6440       jl         d14    ;    goto interrupt return;
 6108  6442  
 6108  6442  ; procedure send answer(buf, answer, result);
 6109  6442  ;           call:   return:
 6110  6442  ; save w0   result  unchanged
 6111  6442  ; save w1   answer  unchanged
 6112  6442  ; save w2   buf     unchanged
 6113  6442  ; save w3           unchanged
 6114  6442  
 6114  6442  e11: jl  w3     d103   ;    check message area and buf(cur);
 6115  6444       ac  w3 (x2+4)     ; check state:
 6116  6446       sh  w3    -1      ;    if receiver(buf)>0 
 6117  6448       jl         c29    ;    goto internal 3; (i.e. not claimed);
 6118  6450       rl  w0  x3+a10    ;    if kind(-receiver(buf))=pseudoproc then
 6119  6452       sn  w0     64     ;
 6120  6454       rl  w3  x3+a50    ;      receiver:=-mainproc(-receiver);
 6121  6456       sz  w0    -1-64   ;    if receiver is neither internal process nor pseudo process then
 6122  6458       rl  w3  x3+a250   ;      receiver := driverproc(receiver);
 6123  6460       se  w1  x3        ;    if -receiver<>cur then
 6124  6462       jl         c29    ;      goto internal 3; (i.e. cur not receiver);
 6125  6464  
 6125  6464       rl  w0  x1+a28    ;    result:=save w0(cur);
 6126  6466       sl  w0     1      ;    if result<1 or
 6127  6468       sl  w0     6      ;       result>5 then
 6128  6470       jl         c29    ;    goto internal 3;
 6129  6472       bz  w3  x1+a19    ;
 6130  6474       al  w3  x3+1      ;    increase buf claim(cur);
 6131  6476       hs  w3  x1+a19    ;
 6132  6478       rl  w0  x1+a182   ;
 6133  6480       rl  w1  x1+a29    ;
 6134  6482       wa  w1  0         ; get physical address of answer area
 6135  6484       al  w2  x2+8      ;
 6136  6486       jl  w3     d14    ;    move mess(answer, buf+8);
 6137  6488       al  w2  x2-8      ;
 6138  6490       am         (b1)   ;
 6139  6492       rl  w0     +a28   ;
 6140  6494       al  w3     c99    ;    deliver answer(buf,result);
 6141  6496       jl.        d30.   ;    goto interrupt return;
 6142  6498  
 6142  6498  e.
 6143  6498  
 6143  6498  ; procedure wait event(last buf, next buf, result);
 6144  6498  ;           call:     return:
 6145  6498  ; save w0             result (=0, 1)
 6146  6498  ; save w1             unchanged
 6147  6498  ; save w2   last buf  unchanged
 6148  6498  ; save w3             unchanged
 6149  6498  
 6149  6498  ; procedure test event(last buf, next buf, result);
 6150  6498  ;           call:      return:
 6151  6498  ; saved w0             result (-1: empty, 0: message, 1: answer)
 6152  6498  ; saved w1             unchanged/sender(mess)/message flag
 6153  6498  ; saved w2  last buf   next buf
 6154  6498  ; saved w3             unchanged
 6155  6498  
 6155  6498  
 6155  6498  b. i20 w.
 6156  6498  c96: rl  w1     b21    ; entry to wait first event:
 6157  6500       rl  w2  x1+a302   ;    goto wait-first-event entry
 6158  6502       jl     (x2+a304)  ;      in the driver process;
 6159  6504  
 6159  6504  e33: am         -1-0   ; test event: function:=inspect;
 6160  6506  
 6160  6506  e12: al  w0     0      ; wait event: function:=wait;
 6161  6508       rs. w0     i0.    ;
 6162  6510       rl  w2  x1+a30    ;    last buf:=save w2(cur);
 6163  6512       se  w2     0      ;    if last buf<>0 then
 6164  6514       jl.        i4.    ;      check event(cur, last buf);
 6165  6516       al  w2  x1+a15    ;    else last buf:=event q(cur);
 6166  6518  i3:  al  w3  x2        ;
 6167  6520       al  w0     0      ;
 6168  6522       jl.        i6.    ;    goto test buf;
 6169  6524  i4:  jl  w3     d19    ; check event: call check event
 6170  6526       jl.        i3.    ;
 6171  6528  
 6171  6528  ; scan the event queue, from last buf, until last buf or already waited buf.
 6172  6528  ; in the last case: release the claim.
 6173  6528  ;
 6174  6528  ; w0=0, w2=buf, w3=last buf
 6175  6528  i5:  rl  w2  x2+0      ; next buf: buf:=next(buf);
 6176  6530       sn  w2  x3        ;    if buf=last buf then
 6177  6532       jl.        i9.    ;      goto all buffers released;
 6178  6534  i6:  se  w2  x1+a15    ; test buf: if buf=event q(cur) or
 6179  6536       sh  w0 (x2+4)     ;      receiver(buf)>=0 then
 6180  6538       jl.        i5.    ;    goto next buf;
 6181  6540       sl  w2    (b8+4)  ;
 6182  6542       sl  w2    (b8+6)  ;    if buffer not message buffer then
 6183  6544       jl.        i5.    ;      goto next buf; (i.e. some kind of general event);
 6184  6546  
 6184  6546  ; an already claimed buffer is found
 6185  6546       sh  w0 (x2+6)     ;    if sender(buf)<0 then
 6186  6548       jl.        i7.    ;      begin comment regretted, perform the actual release;
 6187  6550       sn  w3  x2        ;      if last buf=buf then
 6188  6552       rl  w3  x2+2      ;        last buf:=last(buf);
 6189  6554       al  w0  x3        ;      save last buf;
 6190  6556       jl  w3     d106   ;      remove and release buf(buf);
 6191  6558       rl  w3     0      ;      restore last buf;
 6192  6560       rl  w1     b1     ;      restore cur;
 6193  6562       jl.        i8.    ;      end
 6194  6564  i7:                    ;    else
 6195  6564       ws  w0  x2+4      ;      receiver(buf):=+receiver(buf);
 6196  6566       rs  w0  x2+4      ;
 6197  6568  i8:                    ;
 6198  6568       bz  w2  x1+a19    ;
 6199  6570       al  w2  x2+1      ;    increase(buffer claim(cur));
 6200  6572       hs  w2  x1+a19    ;
 6201  6574  i9:                    ; buf released:
 6202  6574                         ; examine next event:
 6203  6574  
 6203  6574  ; at this point there should not be any claimed buffers in the queue...
 6204  6574  ; examine the next event in the queue
 6205  6574  ;
 6206  6574  ; w3=last buf
 6207  6574       rl  w2  x3+0      ;    buf:=next(last buf);
 6208  6576       sn  w2  x1+a15    ;    if buf=event q(cur) then
 6209  6578       jl.        i13.   ;      goto empty;
 6210  6580       rs  w2  x1+a30    ;    save w2(proc):=buf;
 6211  6582  
 6211  6582  ; the buf may either be a message buffer or interrupt operation 
 6212  6582       sl  w2    (b8+4)  ;    if buf is not message buffer then
 6213  6584       sl  w2    (b8+6)  ;
 6214  6586       jl.        i12.   ;      goto interrupt operation;
 6215  6588       rl  w0  x2+4      ;    save w0(cur):=
 6216  6590       sz  w0    -8      ;      if 0<=receiver(buf)<8 then
 6217  6592       am        -1      ;      1 else 0;
 6218  6594       al  w0     1      ;    i.e.: 0==message,
 6219  6596       rs  w0  x1+a28    ;          1==answer;
 6220  6598       rl. w3     i0.    ;
 6221  6600       se  w3     -1     ;   if function=test event then
 6222  6602       jl.        i10.   ;     if event=message then
 6223  6604       sn  w0     0      ;       saved w1:=sender(message)
 6224  6606       am         a142-a139;   else
 6225  6608       rl  w3  x2+a139   ;       saved w1:=message flag(answer);
 6226  6610       rs  w3  x1+a29    ;
 6227  6612  i10:                   ;
 6228  6612       se  w0     0      ;    if answer then
 6229  6614       jl         c99    ;      goto interrupt return;
 6230  6616       rl  w3  x1+a30    ;    <* get saved next mess addr
 6231  6618       zl  w0  x1+a19    ;       in case claims exceeded *>
 6232  6620       sn  w0     0      ;    if internal.bufclaims = 0 then
 6233  6622       jl.        i9.    ;      goto examine next event;
 6234  6624       jl  w3     d108   ;    claim buffer(cur,buf);
 6235  6626       jl         c99    ;    goto interrupt return;
 6236  6628  
 6236  6628  i12:                   ; interrupt operation:
 6237  6628       jl  w3     d5     ;    remove(operation);
 6238  6630       al  w3     c99    ;    take interrupt operation;
 6239  6632       jl         d127   ;    goto interrupt return;
 6240  6634  
 6240  6634  ; the queue was empty.
 6241  6634  i13: rl. w0     i0.    ; empty:
 6242  6636       se  w0     -1     ;    if function<>test event then
 6243  6638       jl         d107   ;      goto remove wait event;
 6244  6640       rs  w0  x1+a28    ;    save w0:=-1(:=function);
 6245  6642       al  w0     0      ;    save w2:=0; (next buffer address)
 6246  6644       rs  w0  x1+a30    ;
 6247  6646       jl         c99    ;    goto interrupt return;
 6248  6648  
 6248  6648  i0:  0                 ; function
 6249  6650  e.
 6250  6650  
 6250  6650  
 6250  6650  ; procedure get event(buf);
 6251  6650  ;           call:   return:
 6252  6650  ; save w0           unchanged
 6253  6650  ; save w1           unchanged
 6254  6650  ; save w2   buf     unchanged
 6255  6650  ; save w3           unchanged
 6256  6650  
 6256  6650  b. i0 w.
 6257  6650  e13: rl  w2  x1+a30    ;    buf:=save w2(cur);
 6258  6652       jl  w3     d19    ;    check event(cur, buf);
 6259  6654       rl  w3  x2+4      ;    if 0 <=receiver(buf)<8 then
 6260  6656       sz  w3    -8      ;      begin comment answer;
 6261  6658       jl.        i0.    ;
 6262  6660       al  w3     c99    ;      increase claim, remove release buf(cur, buf);
 6263  6662       jl         d109   ;      goto interrupt return;
 6264  6664  i0:                    ;      end;
 6265  6664  
 6265  6664  ; message: if not claimed by means of wait event then claim it now:
 6266  6664       sl  w3     0      ;    if receiver>=0 then
 6267  6666       jl  w3     d108   ;      claim buffer(cur, buf);
 6268  6668  
 6268  6668       al  w3     c99    ;    remove(buf);
 6269  6670       jl         d5     ;    goto interrupt return;
 6270  6672  e.
 6271  6672  
 6271  6672  
 6271  6672  ; procedure set writeprotect(name, result);
 6272  6672  ; procedure remove writeprotect(name, result);
 6273  6672  ;
 6274  6672  ;         call                 return
 6275  6672  ; save w0:                     result (0, 1, 2, 3)
 6276  6672  ; save w1:
 6277  6672  ; save w2:
 6278  6672  ; save w3: name addr           name addr
 6279  6672  
 6279  6672  b.  i1, j1  w.
 6280  6672  
 6280  6672  
 6280  6672  e15:                   ; set writeprotect:
 6281  6672  e16:                   ; remove writeprotect:
 6282  6672       jl  w3     d101   ; check and search name;
 6283  6674       jl           r3   ;not found: goto result 3;
 6284  6676                         ;found:
 6285  6676       rl  w2  x3        ;
 6286  6678       rl  w0  x2+ a10   ; if process <> area then
 6287  6680       se  w0        4   ;   goto result 3;
 6288  6682       jl           r3   ;
 6289  6684       rl  w0  x1+a176   ;    if cur.cause = remove writeprotect then
 6290  6686       al  w3     r0     ;    begin
 6291  6688       se  w0     30     ;      remove writeprotect(cur, proc);
 6292  6690       jl         d119   ;      result(0);
 6293  6692                         ;    end;
 6294  6692       jl  w3     d102   ;    check user(cur, proc);
 6295  6694       jl         r3     ;+0: not user: result(3);
 6296  6696                         ;+2: user:
 6297  6696       jl  w3     d113   ;    check any reserver(cur, proc);
 6298  6698       jl         r1     ;+0: other: result(1);
 6299  6700       jl.        j1.    ;+2: internal: goto writeprotect;
 6300  6702                         ;+4: none:
 6301  6702       dl  w0  x2+a49    ;
 6302  6704       al  w3  x3+1      ;    if proc.upperbase > cur.maxupper or
 6303  6706       sh  w0 (x1+a44)   ;       proc.lowerbase < cur.maxlower then
 6304  6708       sh  w3 (x1+a44-2) ;       result(2);
 6305  6710       jl         r2     ;
 6306  6712                         ;
 6307  6712  j1:  al  w3     r0     ;
 6308  6714       jl         d118   ;    insert writeprotect(cur, proc);
 6309  6716                         ;    result(0);
 6310  6716                         ;
 6311  6716  e.                     ;
 6312  6716  
 6312  6716  
 6312  6716  
 6312  6716  
 6312  6716  ; procedure regret message;
 6313  6716  ;           call:   return:
 6314  6716  ; save w0           unchanged
 6315  6716  ; save w1           unchanged
 6316  6716  ; save w2   buf     unchanged
 6317  6716  ; save w3           unchanged
 6318  6716  
 6318  6716  e41:                   ; regret message
 6319  6716       al  w3     c99    ; begin
 6320  6718       rl  w2  x1+a30    ;   if cur = procfunc then
 6321  6720       rl  w0    (b6)    ;   begin
 6322  6722       sn  w0  x1        ;
 6323  6724       jl         d75    ;     <* it's allowed for procfunc to regret all
 6324  6726                         ;        messages send from a process which is going
 6325  6726                         ;        to be removed *>
 6326  6726                         ;     regretted message(message); goto interrupt return;
 6327  6726                         ;   end;
 6328  6726  
 6328  6726       jl  w3     d12    ;    check message(buf);
 6329  6728       rl  w3  x2+6      ;   proc:= sender(buf);
 6330  6730       sh  w3  0         ;
 6331  6732       ac  w3  x3        ;
 6332  6734       rl  w0  x3+a10    ;   if kind(proc) = pseudo kind
 6333  6736       sn  w0  64        ;      then proc:= main(proc);
 6334  6738       rl  w3  x3+a50    ;
 6335  6740       zl  w0  x2+a138+1 ;
 6336  6742       sn  w3  (b1)      ;   if proc <> cur or
 6337  6744       sz  w0     2.0000001;    message.state.io then
 6338  6746       jl         c29    ;      goto internal 3;
 6339  6748       al  w3     c99    ;    regretted message(buf);
 6340  6750       jl         d75    ;    goto interrupt return;
 6341  6752                         ; end;
 6342  6752  
 6342  6752  
 6342  6752  ; procedure set number of processors(count)
 6343  6752  ;           call:   return:
 6344  6752  ; save w0           result (0, 1, 2)
 6345  6752  ; save w1  count    unchanged
 6346  6752  ; save w2           unchanged
 6347  6752  ; save w3           unchanged
 6348  6752  
 6348  6752  b. i3, j3 w.
 6349  6752  
 6349  6752  e17: rl  w0  x1+a22    ; check function mask
 6350  6754       so  w0     1<4    ; if function bit 7 <> 0 then
 6351  6756       jl         r1     ;   deliver result 1
 6352  6758  
 6352  6758  b. h1 w.               ;  if mp then
 6353  6758       am        (b9)    ;
 6354  6760  h0=k
 6355  6760       jl.       0       ;  begin
 6356  6762       jl.        j1.    ; goto mp activation
 6357  6764  c.(:h0+a8-k-1:)
 6358  6764       am  0, r.(: h0+a8+2-k :)>1 ;  fill up
 6359  6764  z.
 6360  6764  e.                     ;  end mp
 6361  6764  
 6361  6764       rl  w0  x1+a29    ;  if new number of processors <> 1 then
 6362  6766       sn  w0     1      ;     deliver result 2
 6363  6768       jl         r0     ;  else deliver result 0 (ok)
 6364  6770       jl         r2     ;  <* end not mp *>
 6365  6772  
 6365  6772  j1:  al  w2     0      ; find max no of processors
 6366  6774       rl  w3     (b59)  ; for i:=1 step 1 until 4 do
 6367  6776       rs. w3     i2.    ; begin
 6368  6778       al  w3  x3+8      ;   if pu_table(i)<>-1 then
 6369  6780  j0:  rl  w0  x3        ;     max_no:=max_no+1;
 6370  6782       se. w0     (i3.)  ;
 6371  6784       al  w2  x2+1      ;
 6372  6786       al  w3  x3-2      ;
 6373  6788       se. w3     (i2.)  ;
 6374  6790       jl.        j0.    ; end;
 6375  6792       sh  w2     (b82)  ; if current no of processors > max then
 6376  6794       rs  w2     b82    ; current max no := max;
 6377  6796                         ; a cpu has'nt received the power up interrupt
 6378  6796       al  w2  x2+1      ;
 6379  6798       rl  w0  x1+a29    ; if process count < 1
 6380  6800       sl  w0     1      ;   or process count > max processors then
 6381  6802       sl  w0  x2        ;   deliver result 2
 6382  6804       jl         r2     ;
 6383  6806       rl  w2     b82    ; set new number of active processors
 6384  6808       rs  w0     b82    ; delta := number_of_processors - count;
 6385  6810       ws  w2     0      ; pu_table.no_of_free :=
 6386  6812       rl  w3     (b59)  ;   pu_table.no_of_free - delta;
 6387  6814       rl  w0  x3        ;
 6388  6816       ws  w0     4      ;
 6389  6818       rs  w0  x3        ; 
 6390  6820       rl. w0     i1.    ; if active processors = 1 
 6391  6822       rl  w2     b82    ;   then current process :=-1000000
 6392  6824       se  w2     1      ;
 6393  6826       rs  w0     b42    ;
 6394  6828       jl         r0     ; return ok
 6395  6830  i1: -1000000           ;
 6396  6832  i2:  0                 ; pu_table addr
 6397  6834  i3: -1                 ; free pu entry
 6398  6836  
 6398  6836  e.
 6399  6836  
 6399  6836  
 6399  6836  ; procedure get clock(time);
 6400  6836  ;           call:   return:
 6401  6836  ; save w0           time high
 6402  6836  ; save w1           time low
 6403  6836  ; save w2           unchanged
 6404  6836  ; save w3           unchanged
 6405  6836  
 6405  6836  e18: jl  w3     d7     ;    update time;
 6406  6838       dl  w3     b13+2  ;  
 6407  6840       ds  w3  x1+a29    ;    save w0w1(cur):=time;
 6408  6842       jl         c99    ;    goto interrupt return;
 6409  6844  
 6409  6844  ; procedure set clock(time);
 6410  6844  ;           call:   return:
 6411  6844  ; save w0 time high unchanged
 6412  6844  ; save w1 time low  unchanged
 6413  6844  ; save w2           unchanged
 6414  6844  ; save w3           unchanged
 6415  6844  
 6415  6844  e19: bz  w0  x1+a22    ;    mask:=function mask(cur);
 6416  6846       so  w0     1<4    ;    if mask(7)=0 then
 6417  6848       jl         c29    ;      goto internal 3;
 6418  6850       jl  w3     d7     ;   update time;
 6419  6852       dl  w3     b70+2  ;   last inspected:=
 6420  6854       ss  w3     b13+2  ;     last inspected
 6421  6856       aa  w3  x1+a29    ;     -time
 6422  6858       ds  w3     b70+2  ;     +newtime;
 6423  6860       dl  w3  x1+a29    ;
 6424  6862       ss  w3     b13+2  ;   clockchange:=
 6425  6864       aa  w3     b15+2  ; clockchange+
 6426  6866       ds  w3     b15+2  ;   newtime - time;
 6427  6868       dl  w3  x1+a29    ;   c. tested by clock driver;
 6428  6870       ds  w3     b13+2  ;    time:=save w0w1(cur);
 6429  6872       jl         c99    ;    goto interrupt return;
 6430  6874  
 6430  6874  ; call of process functions:
 6431  6874  ;
 6432  6874  ; make a primary check on the parameters to ensure that they are inside the calling process.
 6433  6874  ; notice especially that it is not always possible to check the consistence of the parameters,
 6434  6874  ; because the circumstances may change before procfunc has time to perform the function.
 6435  6874  ; special care must be taken, so that the call may be repeated: if the calling process is
 6436  6874  ; stopped before procfunc reaches the process, the call is deleted, and the ic of the process
 6437  6874  ; will be decreased to repeat the call as soon as the process is restarted.
 6438  6874  
 6438  6874  b. i20 w.
 6439  6874  
 6439  6874  e51:                   ; prepare bs;
 6440  6874       zl  w0  x1+a20    ;
 6441  6876       sh  w0     0      ; if areaclaim.sender=0 then
 6442  6878       jl         r1     ; result 1
 6443  6880       jl.        i14.   ; else continue at check;
 6444  6882  
 6444  6882  e61:                   ; delete aux entry:
 6445  6882       jl  w3     d111   ;    check name (save w2) area;
 6446  6884       rl  w2  x1+a29    ;    first param := save w1(cur);
 6447  6886       al  w0  x2+a88-2  ;    last param := first + entry size - 2;
 6448  6888       al. w3     i3.    ;    check within (first, last);
 6449  6890       jl         d112   ;    goto link call;
 6450  6892  
 6450  6892  e60:                   ; create aux entry and area process:
 6451  6892       jl  w3     d111   ;    check name (save w2) area;
 6452  6894  e56:                   ; connect main catalog:
 6453  6894  e52:                   ; insert entry:
 6454  6894       am         i6     ;    switch := test entry area;
 6455  6896  i14:                   ; prepare bs:
 6456  6896       al. w0     i3.    ;    switch := link call;
 6457  6898       rs. w0     i7.    ;    save switch;
 6458  6900  
 6458  6900       rl  w2  x1+a31    ;    first param := save w3(cur);
 6459  6902       al  w0  x2+a88-2  ;    last param := first param + catentrysize - 2;
 6460  6904       jl  w3     d112   ;    check within(first,last);
 6461  6906  
 6461  6906       bz  w0  x2+28     ;    last param := last slice(chaintable)
 6462  6908       al  w2  x2+a88-2  ;                  + first param + catentrysize - 2;
 6463  6910       wa  w0     4      ;
 6464  6912       jl  w3     d112   ;    check within(first,last);
 6465  6914       jl.       (i7.)   ;    goto (saved switch);
 6466  6916  i7:  0                 ; saved switch
 6467  6918  
 6467  6918  e53:                   ; insert bs:
 6468  6918  e54:                   ; delete bs:
 6469  6918  e55:                   ; delete entries:
 6470  6918       jl  w3     d111   ;    check name (save w2) area;
 6471  6920       jl.        i3.    ;    goto link call;
 6472  6922  
 6472  6922  e39:                   ; set bs claims:
 6473  6922  e59:                   ; lookup bs claims
 6474  6922       jl  w3     d111   ;    check name(save w2) area;
 6475  6924  
 6475  6924  ; get size of param (save w1(cur)):
 6476  6924                         ; set bs claims (continued):
 6477  6924       am    a110*4+4-12 ;    size:=(maxkey+1)*4;
 6478  6926  e28:                   ; create internal:
 6479  6926  e31:                   ; modify internal:
 6480  6926       am    12-8        ;    size:=12;
 6481  6928  e23:                   ; rename entry:
 6482  6928       am    8-a88       ;    size:=8;
 6483  6930  e38:                   ; lookup head and tail:
 6484  6930  i0:                    ; insert entry (continued):
 6485  6930       am    a88-a88+14  ;    size:=catentry size;
 6486  6932  e20:                   ; create entry:
 6487  6932  e21:                   ; lookup entry:
 6488  6932  e22:                   ; change entry:
 6489  6932       al  w0     a88-14-2 ;  size:=catentry size-14; notice -2;
 6490  6934       rl  w2  x1+a29    ;    first param:=save w1(cur);
 6491  6936       wa  w0     4      ;    last param:=first param+size-2;
 6492  6938       al. w3     i2.    ;    check within(first, last);
 6493  6940       jl         d112   ;    goto check name(save w3);
 6494  6942  e43:                    ; lookup-aux-entry:
 6495  6942        al  w0  a88-14-2  ;    size:= catentrysize-14; NOTICE -2
 6496  6944        rl  w2  x1+a29    ;    first param:= save w1(cur)
 6497  6946        wa  w0  4         ;    last param := first param+size-2;
 6498  6948        jl  w3  d112      ;    check within(first,last)
 6499  6950  e44:  al. w3  i2.       ; clear-stat-entry:
 6500  6952        jl      d111      ;    check name( save w2) area;
 6501  6954  
 6501  6954  
 6501  6954  e46:                   ; create entry lock process:
 6502  6954       rl  w2  x1+a31    ;    first param:=save w3(cur);
 6503  6956       al  w0  x2+8      ;    last param:=first param+8;
 6504  6958       am         d112-d111;  check within(first, last)
 6505  6960                         ;      instead of
 6506  6960  e45:                   ; permanent entry in auxcat:
 6507  6960       jl  w3     d111   ;    check name(save w2) area;
 6508  6962  
 6508  6962  ; check param (save w3(cur)):
 6509  6962  e24:                   ; remove entry:
 6510  6962  e25:                   ; permanent entry:
 6511  6962  e26:                   ; create area process:
 6512  6962  e27:                   ; create peripheral process:
 6513  6962  e32:                   ; remove process:
 6514  6962  e34:                   ; generate name:
 6515  6962  e36:                   ; set catalog base:
 6516  6962  e37:                   ; set entry interval:
 6517  6962  e40:                   ; create pseudo process:
 6518  6962  i2:  jl  w3     d17    ;    check name area;
 6519  6964  e57:                   ; remove main catalog:
 6520  6964  
 6520  6964  ; link the calling process to the process function queue.
 6521  6964  ; procfunc is activated if it is waiting for a call.
 6522  6964  i3:  i6=i0-i3          ;
 6523  6964       al  w0     a101   ; link call:
 6524  6966       jl  w3     d9     ;    remove internal(wait proc func); (w2 := cur + a16)
 6525  6968                         ;    elem:=process q(cur);
 6526  6968       rl  w1    (b6)    ;    proc:=name table(first internal); i.e. proc func;
 6527  6970       al  w1  x1+a15    ;  
 6528  6972       jl  w3     d6     ;    link(event queue(proc func), elem);
 6529  6974       al  w1  x1-a15    ;
 6530  6976       bz  w0  x1+a13    ;    if state(proc func)=wait message then
 6531  6978       sn  w0     a102   ;
 6532  6980       jl  w3     d10    ;      link internal(proc func);
 6533  6982       jl         c99    ;    goto interrupt return;
 6534  6984  
 6534  6984  ; procedure reset device: special meaning when called form proc func.
 6535  6984  e1:  rl  w2    (b6)    ;    proc:=name table(first internal); i.e. proc func;
 6536  6986       se  w2  x1        ;    if proc<>cur then
 6537  6988       jl.        i4.    ;      goto reset device;
 6538  6990       rl  w2  x1+a15    ;    proc:=next(event q(cur)); i.e. calling process;
 6539  6992       jl  w3     d5     ;    remove (proc) from proc func queue;
 6540  6994       rs. w2     i7.    ;    save (proc);
 6541  6996       al  w0     a102   ;
 6542  6998       sn  w3  x1+a15    ;    if next(proc)=event q(cur) (i.e. queue empty) then
 6543  7000       jl  w3     d9     ;      remove internal(wait mess);
 6544  7002       rl. w2     i7.    ;    restore (proc);
 6545  7004       al  w1  x2-a16    ; 
 6546  7006       al  w3     c99    ;    link internal(proc);
 6547  7008       jl         d10    ;
 6548  7010  
 6548  7010  ; reset device
 6549  7010  ;          call:   return:
 6550  7010  ; save w0  resettype   result (=0,4)
 6551  7010  ; save w1 device   unchanged
 6552  7010  ; save w2          unchanged
 6553  7010  ; save w3          unchanged
 6554  7010  
 6554  7010  i4:  rl  w2  x1+a29    ;    device := save w1(cur);
 6555  7012       lx  w2     g49    ;    exchange bit 0;
 6556  7014       sz  w2     2.111  ;    if device number not multiple of 8 (halfwords) then
 6557  7016       jl         r4     ;      goto result 4;
 6558  7018       wa  w2     b65    ;
 6559  7020       sl  w2    (b67)   ;    if device address outside
 6560  7022       sl  w2    (b68)   ;      controller table then
 6561  7024       jl         r4     ;      goto result 4;
 6562  7026  
 6562  7026       rl  w2  x2+a311   ;    status addres := status(contr descr);
 6563  7028       al  w2  x2-a230   ;
 6564  7030       jl  w1     d130   ;    clear device(proc);
 6565  7032       rl  w1     b1     ;    w1 := cur;
 6566  7034       al  w0     0      ;    result:=0;
 6567  7036       rx  w0  x1+a28    ;    if save w0(cur) = 0 then
 6568  7038       sn  w0     0      ;      result := power restart
 6569  7040       am         6-3    ;    else
 6570  7042       al  w0     3      ;      result := timeout;
 6571  7044       al  w2  x2+a241   ;    w2 := interrupt operation(proc);
 6572  7046       al  w3     c99    ;    deliver interrupt;
 6573  7048       jl         d121   ;    goto interrupt return;
 6574  7050  
 6574  7050  e29: rl  w2    (b6)    ; start internal process
 6575  7052       se  w2  x1        ;    if cur <> first internal (i.e. proc func) then
 6576  7054       jl.        i2.    ;      goto check name(save w3);
 6577  7056  ; proc func has issued a call of start process.
 6578  7056  ;  all processes to be started are linked together, via wait-address, and the start of the
 6579  7056  ;  chain is given in save w3.
 6580  7056  i5:  rl  w1  x2+a31    ; rep: proc := save w3(proc func);
 6581  7058       sn  w1     0      ;    if end chain then
 6582  7060       jl         c99    ;      goto interrupt return;
 6583  7062  
 6583  7062       rl  w0  x1+a40    ;    save w3(proc func) := wait address.proc;
 6584  7064       rs  w0  x2+a31    ;
 6585  7066       rl  w2  x1+a34    ;    father := parent.proc;
 6586  7068       bz  w3  x2+a12    ;
 6587  7070       al  w3  x3+1      ;    increase(stopcount(father));
 6588  7072       hs  w3  x2+a12    ;
 6589  7074       al  w0     a101   ;
 6590  7076       hs  w0  x1+a13    ;    state.proc := waiting for process function; (prepare for not starting)
 6591  7078       rl  w0  x1+a33    ;
 6592  7080       so  w0     1      ;    if save ic(proc) even then
 6593  7082       jl  w3     d10    ;      link internal(proc);
 6594  7084       rl  w2    (b6)    ;
 6595  7086       jl.        i5.    ;    goto rep;
 6596  7088  
 6596  7088  e30:                   ; stop internal process:
 6597  7088       bz  w0  x1+a19    ;    if buf claim(cur)=0 then
 6598  7090       sn  w0     0      ;      goto claim buffer(cur, irrellevant);
 6599  7092       jl         d108   ;    (there are no buffers, so save w2:=0 and exit);
 6600  7094  
 6600  7094  ; you may not actually claim the buffer for returning the answer yet, because the calling
 6601  7094  ; process may get stopped itself, before procfunc reaches it. when the call is repeated, the
 6602  7094  ; buffer might be claimed more than once.
 6603  7094       jl.        i2.    ;    goto check name area;
 6604  7096  
 6604  7096  b.j10 w.
 6605  7096  
 6605  7096  ; procedure copy.
 6606  7096  ;            call      return
 6607  7096  ; save w0    x         z
 6608  7096  ; save w1    x         z
 6609  7096  ; save w2    x         z
 6610  7096  ; save w3    x         z
 6611  7096  
 6611  7096  e35:                   ; copy message:
 6612  7096       jl  w3  d12       ;   check message buf;
 6613  7098       rl  w3  x1+a29    ;   first:=saved w1;
 6614  7100       rl  w0  x1+a31    ;   last:=saved w3;
 6615  7102  
 6615  7102       sl  w3  (x1+a17)  ; check:
 6616  7104       sl  w0  (x1+a18)  ;   if first<first addr(cur)
 6617  7106       jl      c29       ;   or last>=top addr(cur)
 6618  7108       ws  w0  6         ;   or first>last then
 6619  7110       sh  w0  -1        ;     goto internal 3
 6620  7112       jl      c29       ; 
 6621  7114                         ; 
 6622  7114       ac  w3  (x2+4)    ;   rec:= -(-receiver(mess))
 6623  7116       so  w3  2.1       ;   if rec odd
 6624  7118       sh  w3  0         ;   or rec<=0 then
 6625  7120       jl      c29       ;     goto internal 3
 6626  7122       rl  w0  x3+a10    ; 
 6627  7124       sn  w0  64        ;   if rec is a pseudo process then
 6628  7126       rl  w3  x3+a50    ;     rec:=main(rec);
 6629  7128       rl  w0  x3+a10    ;
 6630  7130       sz  w0  -1-64     ;   if rec neither internal nor pseudo process then
 6631  7132       rl  w3  x3+a250   ;     rec:=driver proc(rec);
 6632  7134       se  w3  x1        ;   if rec<>cur then
 6633  7136       jl      c29       ;     goto internal3;
 6634  7138  
 6634  7138       bz  w3  x2+8      ;
 6635  7140       so  w3  2.1       ;   if operation(mes) even then
 6636  7142       jl      r3        ;     goto result3;
 6637  7144  
 6637  7144  ; further checking is postponed until procfunc.
 6638  7144       jl.     i3.       ;   goto link call;
 6639  7146  
 6639  7146  
 6639  7146  
 6639  7146  ; procedure general copy
 6640  7146  ; copies an area in the calling process to or from an
 6641  7146  ; area described in a message buffer.
 6642  7146  ; the first word to be copied is defined by its position
 6643  7146  ; relative to the first address in the messagebuffer.
 6644  7146  ;          call      return
 6645  7146  ; save w0            result (=0,2,3)
 6646  7146  ; save w1  params    halfwords moved
 6647  7146  ; save w2  buf
 6648  7146  ; save w3
 6649  7146  ; params+0  function (addr pair<1 + mode)
 6650  7146  ;       +2  first
 6651  7146  ;       +4  last
 6652  7146  ;       +6  relative(mess data buffer)
 6653  7146  
 6653  7146  j10=512    ; max number of bytes immidiately transferred
 6654  7146  
 6654  7146  e42:                   ; general copy:
 6655  7146       jl  w3  d12       ;  check message buf
 6656  7148       rl  w3  x1+a29    ;  param:= parameter address(=cur.w1)
 6657  7150       al  w0  x3+6      ;  if param<first addr(cur) or
 6658  7152       sl  w3  (x1+a17)  ;     param+6>=top addr(cur) then
 6659  7154       sl  w0  (x1+a18)  ;
 6660  7156       jl      c29       ;  goto internal 3
 6661  7158       wa  w3  x1+a182   ;  w3:= abs addr of param
 6662  7160       rl  w0  x3+0      ;
 6663  7162       rs. w0  j4.       ;   function:=function(param);
 6664  7164       ls  w0  -1        ;   if addr pair>12 then
 6665  7166       sl  w0  14        ;     goto internal 3
 6666  7168       jl      c29       ;
 6667  7170       rs. w0  j0.       ;   pair:=function>1;
 6668  7172                         ;
 6669  7172       rl  w0  x3+6      ;  rel:= param.relative
 6670  7174       sh  w0  -1        ;  if rel<0 then
 6671  7176       jl      c29       ;  goto internal 3
 6672  7178       rs. w0  j1.       ;  relative:=rel;
 6673  7180                         ;
 6674  7180       dl  w0  x3+4      ;  first:=param.first addr
 6675  7182                         ;  last:=param.last addr
 6676  7182       sl  w3  (x1+a17)  ; check:
 6677  7184       sl  w0  (x1+a18)  ;  if first<first addr(cur) or
 6678  7186       jl      c29       ;     last>=top addr(cur) or
 6679  7188       ws  w0  6         ;     first>last then
 6680  7190       sh  w0  -1        ;  goto internal 3
 6681  7192       jl      c29       ;
 6682  7194       wa  w3  x1+a182   ;   abs first(cur):=first(cur)+base(cur);
 6683  7196       ds. w0  j3.       ;   size(cur)-2:=last(cur)-first(cur);
 6684  7198                         ;
 6685  7198       rl  w2  x1+a30    ;   mess:=saved w2;
 6686  7200       ac  w3  (x2+4)    ;   rec:= -(-receiver(mess));
 6687  7202  sh w3 0  ;*****aht. driver proc
 6688  7204  ac w3 x3 ;*****
 6689  7206       so  w3  2.1       ;   if rec odd
 6690  7208       sh  w3  0         ;   or rec<=0 then
 6691  7210       jl      c29       ;    goto internal 3;
 6692  7212       rl  w0  x3+a10    ;
 6693  7214       sn  w0  64        ;   if rec is a pseudo process then
 6694  7216       rl  w3  x3+a50    ;     rec:=main(rec);
 6695  7218       rl  w0  x3+a10    ;
 6696  7220       sz  w0  -1-64     ;   if rec neither internal nor pseudo process then
 6697  7222       rl  w3  x3+a250   ;     rec:=driver proc(rec);
 6698  7224       se  w3  x1        ;   if rec<>cur then
 6699  7226       jl      c29       ;     goto internal3;
 6700  7228  
 6700  7228       rl  w3  x2+a142   ;   w3 := sender(mess);
 6701  7230       bz  w0  x2+a150   ;
 6702  7232       sz  w0  2.1       ;   if operation(mess) even
 6703  7234       sh  w3  0         ;   or sender <= 0 (i.e. regretted)  then
 6704  7236       jl      r3        ;     goto result 3;
 6705  7238       rl  w0  x3+a10    ; if kind(sender) = pseudo kind
 6706  7240       sn  w0  64        ; then sender := main(sender)
 6707  7242       rl  w3  x3+a50    ;
 6708  7244  
 6708  7244       bz  w0  x3+a13    ;   if state(sender) = stopped then
 6709  7246       sz  w0  a105      ;
 6710  7248       jl      r2        ;     goto result 2;
 6711  7250  
 6711  7250       am.     (j0.)     ;   first(mess):=first(mess+pair)+relative;
 6712  7252       dl  w1  x2+8+2    ;   last(mess):=last(mess+pair+2);
 6713  7254       la  w0  g50       ;   <make addr in message even>
 6714  7256       la  w1  g50       ;
 6715  7258       wa. w0  j1.       ;
 6716  7260       sl  w0  (x3+a17)  ;   if first(mess)<first(sender)
 6717  7262       sl  w1  (x3+a18)  ;   or last(mess)>last(sender) then
 6718  7264       jl.     i13.      ;     goto result3;
 6719  7266  
 6719  7266       ws  w1  0         ;   size-2:=last(mess)-first(mess);
 6720  7268       sh  w1  -1        ;   if size-2 < 0
 6721  7270       jl.     i13.      ;      then goto result 3;
 6722  7272       wa  w0  x3+a182   ;   abs first(mess):=first(mess)+base(sender);
 6723  7274       sl. w1  (j3.)     ;   if size>size(cur) then
 6724  7276       rl. w1  j3.       ;     size:=size(cur);
 6725  7278       al  w3  x1+2      ;
 6726  7280       rx  w3  0         ;
 6727  7282       rl. w2  j2.       ;
 6728  7284  
 6728  7284  ; w0: size, w2: abs first(cur), w3: abs first(mess)
 6729  7284  
 6729  7284       rl. w1  j4.       ;
 6730  7286       so  w1  2.1       ;   if mode=1 then from:=cur, to:=mess
 6731  7288       rx  w2  6         ;   else from:=mess, to:=cur;
 6732  7290                         ;
 6733  7290       rl  w1  b1        ;
 6734  7292       sl  w0  j10+1     ;   if size>max number trf immidiately then
 6735  7294       jl.     i3.       ;     goto call link;
 6736  7296  
 6736  7296       rs  w0  x1+a29    ;   saved w1:=size;
 6737  7298  
 6737  7298  ; move.
 6738  7298  ; w0: size, w1: , w2: from-addr, w3: to-addr
 6739  7298  ; use 'move-halfwords' instruction if implemented
 6740  7298       gg  w1     b100   ;    if cpu-kind= mp-cpu then
 6741  7300       sh  w1     55     ;    begin
 6742  7302       jl.        i8.    ;
 6743  7304                         ; mh-instr:
 6744  7304       rx  w2     6      ;      move-halfwords(size, destination, source);
 6745  7306       mh  w3    (0)     ;
 6746  7308       rl  w1     b1     ;      goto result0;
 6747  7310       jl         r0     ;    end;
 6748  7312                         ; programmed-move:
 6749  7312  
 6749  7312  i8:  ac  w1  (0)       ;    remaining := - bytes;
 6750  7314       so  w1  1<1       ;    if even number of words to move then
 6751  7316       jl.     i10.      ;      goto move fast;
 6752  7318       rl  w0  x2+0      ;
 6753  7320       rs  w0  x3+0      ;
 6754  7322       al  w3  x3+2      ;    increase(to-address);
 6755  7324       al  w2  x2+2      ;    increase(from-address);
 6756  7326       al  w1  x1+2      ;    decrease(remaining);  (remember: negative)
 6757  7328  
 6757  7328  i10:                   ; move fast:
 6758  7328       rs. w1  j5.       ;    save(remaining);
 6759  7330       sl  w1  i12       ;    if remaining does no exceed size of move-table
 6760  7332       jl.     x1+i11.   ;      then switch out through table;
 6761  7334                         ;    (otherwise move a whole portion)
 6762  7334  i9:                    ; start of move-table:
 6763  7334       dl  w1  x2+30     ;
 6764  7336       ds  w1  x3+30     ;
 6765  7338       dl  w1  x2+26     ;
 6766  7340       ds  w1  x3+26     ;
 6767  7342       dl  w1  x2+22     ;
 6768  7344       ds  w1  x3+22     ;
 6769  7346       dl  w1  x2+18     ;
 6770  7348       ds  w1  x3+18     ;
 6771  7350       dl  w1  x2+14     ;
 6772  7352       ds  w1  x3+14     ;
 6773  7354       dl  w1  x2+10     ;
 6774  7356       ds  w1  x3+10     ;
 6775  7358       dl  w1  x2+6      ;
 6776  7360       ds  w1  x3+6      ;
 6777  7362       dl  w1  x2+2      ;
 6778  7364       ds  w1  x3+2      ;
 6779  7366  i11:                   ; top of move-table:
 6780  7366  i12=i9-i11             ; size of move-table (notice: negative)
 6781  7366  
 6781  7366       al  w3  x3-i12    ;    increase(to-address);
 6782  7368       al  w2  x2-i12    ;    increase(from-address);
 6783  7370       rl. w1  j5.       ;    restore(remaining);
 6784  7372       al  w1  x1-i12    ;    decrease(remaining);  (remember: negative)
 6785  7374       sh  w1  -1        ;    if not all moved yet then
 6786  7376       jl.     i10.      ;     goto move fast;
 6787  7378  
 6787  7378  ; now return to result0.
 6788  7378       rl  w1  b1        ;
 6789  7380       jl      r0        ; exit: goto result0;
 6790  7382  
 6790  7382  i13: rl  w1  b1        ; exit3:
 6791  7384       jl      r3        ;   goto result3;
 6792  7386  
 6792  7386  j0:  0                 ;  pair
 6793  7388  j1:  0                 ;  relative
 6794  7390  j2:  0                 ;  abs first(cur)
 6795  7392  j3:  0                 ;  size(cur)-2
 6796  7394  j4:  0                 ;  function
 6797  7396  j5:  0                 ;  remaining bytes (multiplum of 4 bytes)
 6798  7398  e.
 6799  7398  e.                     ; end of proc func block
 6800  7398  
 6800  7398  ;test users , reserver, and writeprotection
 6801  7398  ;
 6802  7398  ; call                    return
 6803  7398  ;save w0                  result (=0 2 3 4)
 6804  7398  ;save w1 adr of internal  
 6805  7398  ;save w2                  user reserver writeprotection specification
 6806  7398  ;save w3 adr of external
 6807  7398  b. i2, j5 w.
 6808  7398  e14: rl  w2  x1+a29      ;
 6809  7400       wa  w2  x1+a182     ; if addr+base >= lower write limit and
 6810  7402       al  w0  x2+6        ;    addr+base+6 < upper write limit then
 6811  7404       sl  w2 (x1+a183)    ;    nameaddr:= addr+base
 6812  7406       sl  w0 (x1+a184)    ;
 6813  7408       sz                  ; else
 6814  7410       jl.        j2.      ; if addr< cpa and 
 6815  7412       ws  w2  x1+a182     ;    addr> 7 then
 6816  7414       al  w0  x2+6        ;    nameaddr:= addr
 6817  7416       sl  w2     8        ;
 6818  7418       sl  w0 (x1+a181)    ; else
 6819  7420       jl         c29      ; goto internal 3;
 6820  7422  j2:                      ;
 6821  7422       al  w3  x1          ; internal := current process
 6822  7424       rl  w0  x2          ;
 6823  7426       sn  w0  0           ;
 6824  7428       jl.     j1.         ;
 6825  7430       ws  w2  x1+a182     ; <* adjust for the base *>
 6826  7432       jl  w3  d11         ; search name(internal)
 6827  7434       jl      r3          ;+2 not found: result 3
 6828  7436       rl  w3  x3          ; internal := entry.nametable
 6829  7438       rl  w0  x3+a10      ; if kind not internal then 
 6830  7440       se  w0  0           ; result 3
 6831  7442       jl      r3          ;
 6832  7444  j1:  rs. w3  i1.         ; save internal
 6833  7446       rl  w2  x1+a31      ;
 6834  7448       wa  w2  x1+a182     ; if addr+base>= lower writelimit and
 6835  7450       al  w0  x2+6        ;    addr+base+6< upper writelimit then
 6836  7452       sl  w2 (x1+a183)    ;    nameaddr:= addr+base
 6837  7454       sl  w0 (x1+a184)    ; 
 6838  7456       sz                  ; else
 6839  7458       jl.        j3.      ; if addr< cpa and addr> 7 then
 6840  7460       ws  w2  x1+a182     ;    nameaddr:= addr
 6841  7462       al  w0  x2+6        ;
 6842  7464       sl  w2     8        ; else
 6843  7466       sl  w0 (x1+a181)    ; goto internal 3;
 6844  7468       jl         c29      ;
 6845  7470  j3:                      ;
 6846  7470       ws  w2  x1+a182     ; <* adjust for the base *>
 6847  7472       jl  w3  d11         ; search name(external)
 6848  7474       jl      r4          ; +2 not found : result 4
 6849  7476       rl  w3  x3          ; external := entry.name table
 6850  7478       rl  w0  x3+a10      ; if kind = internal or
 6851  7480       se  w0  64          ; kind = pseudo proc then
 6852  7482       sn  w0  0           ;
 6853  7484       jl      r4          ; result := 4
 6854  7486       al  w2  x3          ; 
 6855  7488       rl. w1  i1.         ; test users , reserver, and writeprotection
 6856  7490       jl  w3  d76         ;
 6857  7492       rl  w1  b1          ; save w0(cur) := result ok
 6858  7494       al  w0  0           ; save w2(cur) := user-reservr bits
 6859  7496       rs  w0  x1+a28      ;
 6860  7498       rs  w3  x1+a30      ; 
 6861  7500       jl      c99         ; return 
 6862  7502  
 6862  7502  i1:  0                   ; saved internal
 6863  7504  
 6863  7504  e.
 6864  7504  
 6864  7504  
 6864  7504  ; set priority.
 6865  7504  ; saved w0                     result(=0,3)
 6866  7504  ; saved w1    priority
 6867  7504  ; saved w2
 6868  7504  ; saved w3    name addr(child)
 6869  7504  b.i10,j10 w.
 6870  7504  e47:  jl  w3  d17       ;   check name(saved w3);
 6871  7506        rl  w2  x1+a31    ;   name addr:=saved w3;
 6872  7508        jl  w3  d11       ;   search name(name, entry);
 6873  7510        jl      r3        ;    not found: goto result3;
 6874  7512        rl  w3  x3        ;    found:
 6875  7514        rs. w3  i0.       ;   child:=proc(entry);
 6876  7516        se  w1 (x3+a34)   ;   if parent(child)<>cur then
 6877  7518        jl      r3        ;     goto result3;
 6878  7520        rl  w0  x3+a10    ;
 6879  7522        se  w0  0         ;   if child not internal proc then
 6880  7524        jl      r3        ;     goto result3;
 6881  7526        rl  w0  x1+a29    ;   prio:=saved w1;
 6882  7528        sh  w0  -1        ;   if prio<0 then
 6883  7530        jl      c29       ;     goto internal3;
 6884  7532        ws  w0  x3+a301   ;   increment:=prio-priority(proc);
 6885  7534        rs. w0  i1.       ;
 6886  7536  ; search descendents of process and the process itself, and increment their
 6887  7536  ; priority values. if they are in timeslice queue, then reinsert them to 
 6888  7536  ; assure proper displacement in priority-queue.
 6889  7536        rl  w3  b6        ;
 6890  7538  j0:   rl  w2  x3        ;
 6891  7540  j1:   sn. w2 (i0.)      ;
 6892  7542        jl.     j3.       ;
 6893  7544        rl  w2  x2+a34    ;
 6894  7546        se  w2  0         ;
 6895  7548        jl.     j1.       ;
 6896  7550  j2:   al  w3  x3+2      ;
 6897  7552        se  w3 (b7)       ;
 6898  7554        jl.     j0.       ;
 6899  7556        jl      r0        ; exit: goto result0;
 6900  7558  
 6900  7558  j3:   rl  w2  x3        ;
 6901  7560        rl  w0  x2+a301   ;
 6902  7562        wa. w0  i1.       ;   priority(proc):=priority(proc)+increment;
 6903  7564        rs  w0  x2+a301   ;
 6904  7566  ;*    rl  w0  x2+a16    ;
 6905  7566  ;*    sn  w0  x2+a16    ;   if proc in time-slice-queue then
 6906  7566  ;*    jl.     j2.       ;
 6907  7566  ;*    rs. w3  i2.       ;   save w3;
 6908  7566  ;*    al  w2  x2+a16    ;
 6909  7566  ;*    jl  w3  d5        ;
 6910  7566  ;*    jl  w3  d10       ;
 6911  7566  ;*    rl. w3  i2.       ;
 6912  7566        jl.     j2.       ;
 6913  7568  
 6913  7568  i0:   0                 ;   proc(child)
 6914  7570  i1:   0                 ;   increment
 6915  7572  i2:   0                 ;   saved w3
 6916  7574  
 6916  7574  e.
 6917  7574  
 6917  7574  
 6917  7574  ; procedure relocate(name,start address,result)
 6918  7574  ;           call:               return:
 6919  7574  ; save w0                       result (= 3,6        )
 6920  7574  ; save w1   start address
 6921  7574  ; save w2
 6922  7574  ; save w3   name address
 6923  7574    
 6923  7574  b.i10,j10 w.
 6924  7574  e48:  jl  w3  d17       ; check name(save w3)
 6925  7576        rl  w2  x1+a31    ; name addr:= save w3
 6926  7578        jl  w3  d11       ; search name(name,entry)
 6927  7580        jl      r3        ;    not found: goto result 3
 6928  7582        rl  w3  x3        ;    found    :
 6929  7584        rs. w3  i0.       ; child:= proc(name table entry)
 6930  7586        rl  w0  x1+a182   ; 
 6931  7588        rs. w0  i2.       ; save address base of calling process
 6932  7590        se  w1  (x3+a34)  ; if parent(child) <> cur 
 6933  7592        jl      r3        ;      then goto result 3
 6934  7594        rl  w0  x3+a10    ; 
 6935  7596        se  w0  0         ; if kind(child) <> internal
 6936  7598        jl      r3        ;    then goto result 3
 6937  7600        bz  w0  x3+a13    ; if state(child) <> waiting f. start by parent
 6938  7602        se  w0  a99       ;    then goto result 3
 6939  7604        jl      r3        ;
 6940  7606        rl  w0  x1+a29    ; 
 6941  7608        rl  w2  x3+a18    ; if child is relocated outside relevant part
 6942  7610        ws  w2  x3+a17    ; of core then goto internal 3
 6943  7612        wa  w2  0         ;
 6944  7614        sh  w2  0         ; if overflow 
 6945  7616        jl      c29       ;    then goto result 3
 6946  7618        al  w2  x2-1      ;
 6947  7620        sl  w0  (x1+a17)  ;
 6948  7622        sl  w2  (x1+a18)  ;
 6949  7624        jl      c29       ;
 6950  7626        rl  w0  x1+a29    ; displ:= 
 6951  7628        wa  w0  x1+a182  ;         cur.new start address + cur.base -
 6952  7630        ws  w0  x3+a17   ;        (child.first address + child.base);
 6953  7632        ws  w0  x3+a182  ;
 6954  7634        rs. w0  i1.       ;
 6955  7636        rl  w3  b6        ; search:
 6956  7638  j0:   rl  w2  x3        ; proc:= next internal in name table
 6957  7640  j1:   sn. w2  (i0.)     ; if proc = child then goto update else
 6958  7642        jl.     j3.       ; begin
 6959  7644        rl  w2  x2+a34    ;   while parent(proc) <> 0 do
 6960  7646        se  w2  0         ;         if parent(proc)=child then goto update
 6961  7648        jl.     j1.       ;         else proc:= parent(proc);
 6962  7650  j2:                     ; end;
 6963  7650        al  w3  x3+2      ; next:
 6964  7652        se  w3  (b7)      ; if more internals in name table
 6965  7654        jl.     j0.       ;    then goto search
 6966  7656        rl  w1  b1        ;
 6967  7658        jl      r0        ; exit: goto result 0
 6968  7660  j3:   rl  w2  x3        ; update: proc:= proc(name table entry)
 6969  7662        rl. w0  i1.       ; current base(proc):= current base(proc)+displ;
 6970  7664        wa  w0  x2+a182   ;
 6971  7666        rs  w0  x2+a182   ;
 6972  7668        rl  w0  x2+a24   ; if proc.mode = 0 then
 6973  7670        sn  w0     0     ;    goto next;
 6974  7672        jl.        j2.   ;
 6975  7674        dl  w1  x2+a184   ; current lower write limit(proc):= 
 6976  7676        wa. w0  i1.       ; current lower write limit(proc)+displ;
 6977  7678        wa. w1  i1.       ; current upper write limit(proc):=
 6978  7680        ds  w1  x2+a184   ; current upper write limit(proc)+displ;
 6979  7682       dl  w1  x2+a306   ;  update first and second process extension
 6980  7684       wa. w0     i1.    ;
 6981  7686       wa. w0     i1.    ;
 6982  7688       ds  w1  x2+a306   ;
 6983  7690        jl.     j2.       ; goto next;
 6984  7692    
 6984  7692  i0:   0                 ; save child
 6985  7694  i1:   0                 ; save displacement
 6986  7696  i2:   0                 ; save address base of parent
 6987  7698  e.
 6988  7698  ; procedure change address base(name,displacement,result);
 6989  7698  ;           call:                return:
 6990  7698  ; save w0:                       result (= 1,3,6         )
 6991  7698  ; save w1:  displacement
 6992  7698  ; save w2:
 6993  7698  ; save w3:  name address
 6994  7698    
 6994  7698  b.i10,j10 w.
 6995  7698  e49:
 6996  7698        jl  w3  d17        ; check name(save w3)
 6997  7700        rl  w2  x1+a31     ; name addr:= save w3;
 6998  7702        jl  w3  d11        ; search name(name,entry);
 6999  7704        jl      r3         ;   not found: goto result 3
 7000  7706        rl  w3  x3         ;   found: proc:= proc(name table entry)
 7001  7708        rl  w0  x1+a29     ;
 7002  7710        la  w0     g50     ; remove lsb
 7003  7712  c.(:a399>23a.1:)-1
 7004  7712        sz  w0     (g68)   ; if displacement mod 8k<>0 then
 7005  7712        jl         c29     ;   goto internal 3
 7006  7712  z.
 7007  7712        rs. w0  i0.        ; save displacement
 7008  7714        se  w1  (x3+a34)   ;   if parent(proc) <> cur
 7009  7716        jl      r3         ;      then goto result 3
 7010  7718        rl  w0  x3+a10     ;
 7011  7720        se  w0  0          ;   if kind(proc) <> internal
 7012  7722        jl      r3         ;      then goto result 3
 7013  7724        bz  w0  x3+a13     ;
 7014  7726        se  w0  a99        ;   if state(proc) <> waiting f. start by parent
 7015  7728        jl      r3         ;      then goto result 3
 7016  7730        al  w1  x3         ;
 7017  7732        rl  w3  b6         ; check if actual process has any children.
 7018  7734  j1:   rl  w2  x3         ; in this case goto result 3
 7019  7736        sn  w1  (x2+a34)   ;
 7020  7738        jl      r3         ;
 7021  7740        al  w3  x3+2       ;
 7022  7742        se  w3  (b7)       ;
 7023  7744        jl.     j1.        ;
 7024  7746        dl  w0  x1+a18     ; first addr(proc):= first addr(proc)-displ
 7025  7748        ws. w0  i0.        ; last addr(proc):= last addr(proc)-displ
 7026  7750        ws. w3  i0.        ;
 7027  7752       sh  w3  -1        ; if logical address < 0 or
 7028  7754       jl      r1        ;  wraps around top of core then
 7029  7756       sh  w0  x3        ;  goto result 1
 7030  7758       jl      r1        ;
 7031  7760        ds  w0  x1+a18     ;
 7032  7762        dl  w0  x1+a170    ; if exception addr(proc) <> 0 then
 7033  7764        sn  w3  0          ;    exception addr(proc):=exception addr(proc)-displ;
 7034  7766        jl.     j2.        ;
 7035  7768        ws. w3  i0.        ;
 7036  7770  j2:   sn  w0  0          ; if escape addr(proc) <> 0 then
 7037  7772        jl.     j3.        ;    escape addr(proc):=escape addr(proc);
 7038  7774        ws. w0  i0.        ;
 7039  7776  j3:   ds  w0  x1+a170    ;
 7040  7778        rl  w0  x1+a182    ; address base(proc):= address base(proc)+displacement;
 7041  7780        wa. w0  i0.        ;
 7042  7782        rs  w0  x1+a182    ;
 7043  7784        rl  w0  x1+a33     ; ic(proc):= ic(proc)-displacement;
 7044  7786        ws. w0  i0.        ;
 7045  7788        rs  w0  x1+a33     ;
 7046  7790        rl  w1  b1         ;
 7047  7792        jl      r0         ; exit: goto result 0
 7048  7794    
 7048  7794  i0:   0                  ; save displacement
 7049  7796  e.
 7050  7796  
 7050  7796  ; procedure set cpa
 7051  7796  ; set the cparegister of an internal process.
 7052  7796  ;
 7053  7796  ;     call                  return
 7054  7796  ;
 7055  7796  ; save w0                   result (=0,2,3,4 )
 7056  7796  ; save w1  cpa         
 7057  7796  ; save w2
 7058  7796  ; save w3  name adr(proc)
 7059  7796  ;
 7060  7796  
 7060  7796  b. i10, j10 w.
 7061  7796  
 7061  7796  e63: jl  w3  d101      ; check and search name
 7062  7798       jl      r3        ; not found: result 3
 7063  7800       rl  w3  x3        ; found :
 7064  7802       rs. w3  i1.       ; save proc
 7065  7804       rl  w0  x3+a10    ; if process not an internal process
 7066  7806       se  w0  0         ; then goto result 3
 7067  7808       jl      r3        ;
 7068  7810       se  w1  (x3+a34)  ; if parent(proc) <> cur
 7069  7812       jl      r3        ; then goto result 3
 7070  7814       zl  w0  x3+a13    ; if state(child) <> waiting for start by parent
 7071  7816       se  w0  a99       ; then goto result 2
 7072  7818       jl      r2        ;
 7073  7820       rl  w0  x1+a29    ; save cpa value
 7074  7822  c.(:a399>23a.1:)-1
 7075  7822       sz  w0     (g67)  ; if new cpa mod 2k<>0 then
 7076  7822       jl         c29    ;   goto internal 3
 7077  7822  z.
 7078  7822       rs. w0  i0.       ;
 7079  7824       al  w0  x3        ; if the process has any children
 7080  7826       rl  w3  b6        ; then goto result 2
 7081  7828  j1:  rl  w2  x3        ;
 7082  7830       sn  w0  (x2+a34)  ;
 7083  7832       jl      r2        ;
 7084  7834       al  w3  x3+2      ;
 7085  7836       se  w3  (b7)      ;
 7086  7838       jl.     j1.       ;
 7087  7840       rl. w0  i0.       ; 
 7088  7842       rl  w3  0         ;
 7089  7844       rl  w2  b8+6      ;
 7090  7846       sn  w0  0         ; if cpa := 0 then 
 7091  7848       al  w3  x2+2      ; cpa := last word of last monitor table+2
 7092  7850       am.     (i1.)     ; if cpa:= 1 then
 7093  7852       rl  w2  +a171     ;
 7094  7854       sn  w0  1         ; cpa:= initial cpa(child)
 7095  7856       al  w3  x2        ;
 7096  7858       rl. w2  i1.       ;
 7097  7860       la  w3  g50       ; <*make cpa even*>
 7098  7862       sh  w3  (x2+a171) ; check cpa:
 7099  7864       sh  w3  7         ; if cpa > initial cpa(child) or
 7100  7866       jl      r4        ; cpa < 7 then 
 7101  7868       rs  w3  x2+a181   ; goto result 4 else
 7102  7870       jl      r0        ; goto result 0 ; end
 7103  7872  i0: 0                  ; saved cpa
 7104  7874  i1: 0                  ; saved proc
 7105  7876  
 7105  7876  e.
 7106  7876  
 7106  7876  
 7106  7876  
 7106  7876  
 7106  7876  ; procedure start i/o;
 7107  7876  ;           call:                          return:
 7108  7876  ; save w0   function select                result (=0,1,2,3)
 7109  7876  ; save w1   cp start (logic addr)          unchanged
 7110  7876  ; save w2   0 or buf                       unchanged
 7111  7876  ; save w3   device address                 unchanged
 7112  7876  
 7112  7876  ; the channelprogram is started using the device address in proc desc+a235.
 7113  7876  ; at start time the working register holds the io-device number extracted 
 7114  7876  ; from the save w3 (only of importance in connection with rc8601).
 7115  7876  
 7115  7876  ; result = 0: channel program etc ok, the interrupt operation will arive
 7116  7876  ;                                    (except after 'reset device')
 7117  7876  ;          1: message regretted, i.e. no transfer started
 7118  7876  ;          2: sender stopped   , i.e. no transfer started
 7119  7876  ;          3: sender address error, i.e.no transfer started
 7120  7876  ;                data command specifies buffers outside senders limits
 7121  7876  ;                (should give the reaction: message unintelligible)
 7122  7876  
 7122  7876  ; the procedure returns always immediatly to the calling process
 7123  7876  ; (i.e. the driver), to the instruction just following the call.
 7124  7876  ; the driver may however specify (via function select) that
 7125  7876  ; execution should be resumed via 'wait first event' (unless
 7126  7876  ; result <> 0, in which case the normal resumption is made).
 7127  7876  ; in case of parameter errors the driver process is break'ed, as usual.
 7128  7876  
 7128  7876  ; parameter errors:
 7129  7876  ;   illegal function select
 7130  7876  ;   save w3 is not a device address
 7131  7876  ;   device descriptor not governed by current process
 7132  7876  ;   previous transfer not awaited (if not 'reset...')
 7133  7876  ;   save w2 not message buffer
 7134  7876  ;   state of message buffer not legal for transfer (***not implemented***)
 7135  7876  ;   channel program too long for device description (or outside driver process)
 7136  7876  ;   wait-command in channel program
 7137  7876  ;   illegal address code
 7138  7876  ;   address error (i.e. buffers outside limits (except sender limits) )
 7139  7876  ;   illegal data- or skip-chain
 7140  7876  ;
 7141  7876  ; function select:
 7142  7876  ;   function   a. 1 = 0 : return to just after call
 7143  7876  ;                   = 1 : exit via the std return address
 7144  7876  ;
 7145  7876  ;   function>1 a. 1 = 0 : no reset
 7146  7876  ;                   = 1 : reset device before start of operation
 7147  7876  ;
 7148  7876  ;   function>2      = 0 : no operation
 7149  7876  ;                   = 1 : start channelprogram
 7150  7876  ;                   = 2 : start std wait program
 7151  7876  ;                   = 3 : start std control program
 7152  7876  ;   function>12    = 0 ; data= deviceno. < 1 (w3 > 2 )
 7153  7876  ;   function>12 < >  0 ; data = function > 12 
 7154  7876  
 7154  7876  
 7154  7876  ; address code:
 7155  7876  ;    code = 0: data area in senders process (i.e. sender(buf))
 7156  7876  ;           2:  -    -   -  drivers process
 7157  7876  ;           4:  -    -   -  device descr
 7158  7876  ;           6:  -    -   -  message buffer
 7159  7876  ;           8:  -    -   -  core (no check)
 7160  7876  ;
 7161  7876  ; first logic address depends on address code:
 7162  7876  ;    code = 0: logic address in senders process
 7163  7876  ;           2: logic address in drivers process
 7164  7876  ;           4: relative address in device descr (relative to a10)
 7165  7876  ;           6: relative address in message buffer (relative to a140)
 7166  7876  ;           8: absolute address, with no limit check
 7167  7876  
 7167  7876  ; timeout:  (unit: 0.1 msec)
 7168  7876  ;    if a channel program is not terminated with an interrupt within
 7169  7876  ;       the specified period, a software timeout will be generated, which
 7170  7876  ;       will deliver the interrupt operation to the driver.
 7171  7876  ;    the device will be reset, exept after a wait-program.
 7172  7876  ;    notice: if timeout = 0, no software timeout will be provided.
 7173  7876  
 7173  7876  ; channel program:
 7174  7876  ;    the channel program must be in the drivers area, and will be
 7175  7876  ;       copied to the device description.
 7176  7876  ;
 7177  7876  ;    the channel program may contain commands with the following format:
 7178  7876  ;         comm + a321:   irrell < 12 + 4095
 7179  7876  ;         comm + a322:   irrell
 7180  7876  ;         comm + a323:   irrell
 7181  7876  ;    in this case the command will be interpreted as a dummy-command,
 7182  7876  ;      i.e. will not be copied into the device description
 7183  7876  ;
 7184  7876  ;    if the program contains the commands 0,1,2,3 (i.e. sense, control,
 7185  7876  ;       read, write with data buffer) without the skip-modification, the
 7186  7876  ;       commands must have the following format:
 7187  7876  ;         comm + a321:   address code < 12 + command < 8 + modifs
 7188  7876  ;         comm + a322:   first logic address
 7189  7876  ;         comm + a323:   char count
 7190  7876  ;    char count must be >= 0 (unless in sense commands, where is must be >= 12)
 7191  7876  ;    (furthermore: if the command is a sense, the 'top chp addr' in the
 7192  7876  ;       sense-area will be cleared)
 7193  7876  ;
 7194  7876  ;    the stop-command must have the following format:
 7195  7876  ;      comm + a321:   0 < 12 + 2.1111 < 8 + 0
 7196  7876  ;      comm + a322:   0
 7197  7876  ;      comm + a323:   timeout
 7198  7876  ;    (this may prepare for introducing 'jump'-commands with the same
 7199  7876  ;    format as the 'stop', except for:
 7200  7876  ;      comm + a322:   continue-address  )
 7201  7876  
 7201  7876  b. f20, h40, i60, j50 w.
 7202  7876  
 7202  7876  ; function select table:
 7203  7876  h0:  f0                ; 0 : no operation
 7204  7878       f1                ; 1 : start channelprogram
 7205  7880       f2                ; 2 : start std wait program
 7206  7882       f3                ; 3 : start std control program
 7207  7884  j0=-h0.<1              ; top value of function select
 7208  7884  
 7208  7884  ; address code table:
 7209  7884  h1:  f10               ;0: sender area
 7210  7886       f11               ;2: driver area
 7211  7888       f12               ;4: device descr
 7212  7890       f13               ;6: message buffer
 7213  7892       f14               ;8: abs core address (no limit check)
 7214  7894  j1=-h1.                ; top address code
 7215  7894  
 7215  7894  h5:  0                 ; device descr address
 7216  7896  
 7216  7896  h10: 0                 ; sender area used: 0=false, else true
 7217  7898  h11: 0     ; =h10+2    ; driver area used: 0=false, else true
 7218  7900  
 7218  7900  h15: 0                 ; first of sender area (logic addr)
 7219  7902  h16: 0     ; =h15+2    ; top   -    -     -   (  -    -  )
 7220  7904  h17: 0                 ; sender process description address
 7221  7906  
 7221  7906  h20: 0                 ; abs first of channel program area in device descr
 7222  7908  h21: 0     ; =h20+2    ; abs top   -     -       -     -   -    -      -
 7223  7910  h22: 0                 ; last of current chp prog entry in device descr
 7224  7912  h23: 0                 ; old command
 7225  7914  
 7225  7914  h25: 1<23              ; change bit 0
 7226  7916  h26: -1<1              ; make addresses even
 7227  7918  h27: 3                 ; number of characters per word
 7228  7920  
 7228  7920  h30: 2.1100 < 8 + 1 < 6; mask: databuffer-command without skip
 7229  7922  h36: j36               ; mask: sign extended command field
 7230  7924  
 7230  7924  h40: j32               ; std wait channel program
 7231  7926  
 7231  7926  ; format of channel program, in driver area:
 7232  7926  ;    (used relative to w3 = last of entry)
 7233  7926  j11 = -a320 + 2        ; (base of command)
 7234  7926  j12 = j11 + a321       ; command field
 7235  7926  j13 = j11 + a322       ; param 1  (=first logic address)
 7236  7926  j14 = j11 + a323       ; param 2  (=char count,  or timeout)
 7237  7926  
 7237  7926  ; format of channel program, in device description:
 7238  7926  ;    (matches the format prescribed by the controller)
 7239  7926  ;    (used relative to w2 = last of entry)
 7240  7926  j20 = 6                ; (size of entry)
 7241  7926  j21 = -j20 + 2         ; (base of command)
 7242  7926  j22 = j21 + 0          ; command field
 7243  7926  j23 = j21 + 2          ; param 1
 7244  7926  j24 = j21 + 4          ; param 2
 7245  7926  
 7245  7926  j30 = 2.0011 < 8       ; mask: sense command
 7246  7926  j31 = 12               ; minimum char count in sense command
 7247  7926  j34 = -1 < 8 + 1 < 6   ; mask: sense command without skip (sign extended)
 7248  7926  
 7248  7926  j32 = 2.0100 < 8       ; wait command (sign extended)
 7249  7926  j33 = -1 < 8           ; stop command (sign extended)
 7250  7926  j37 = -1 < 0           ; dummy command (sign extended)
 7251  7926  
 7251  7926  j35 = 1 < 7 + 1 < 6    ; data-  +  skip-chain
 7252  7926  j36 = -1 < 8           ; sign extended command field
 7253  7926  
 7253  7926  j40 = -1               ; status bit: status transfer error
 7254  7926  
 7254  7926  
 7254  7926  e50:                   ; start i/o:
 7255  7926  ; this first part of the code checks some of the most important
 7256  7926  ; parameters.
 7257  7926  ; it should be possible to skip this checking, in case the driver
 7258  7926  ; contains no errors ???
 7259  7926       rl  w3  x1+a31    ;    devaddr := save w3(cur);
 7260  7928       sz  w3     2.111  ;    if devaddr not multiplum of 8 (bytes) then
 7261  7930       jl  w3     c29    ;      goto internal 3; i.e. not legal at all;
 7262  7932  
 7262  7932       lx. w3     h25.   ;    change bit 0 in devaddr;
 7263  7934       wa  w3     b65    ;    controller descr := controller table(devaddr);
 7264  7936       sl  w3    (b67)   ;    if controller descr outside
 7265  7938       sl  w3    (b68)   ;      controller table then
 7266  7940       jl  w3     c29    ;      goto internal 3;
 7267  7942  
 7267  7942       rl  w3  x3+a311   ;    status addr := std status(controller descr);
 7268  7944       al  w3  x3-a230   ;    device descr addr := proc(status addr);
 7269  7946       rs. w3     h5.    ;
 7270  7948       se  w1 (x3+a250)  ;    if cur <> driverproc(device) then
 7271  7950       jl  w3     c29    ;      goto internal 3;
 7272  7952  
 7272  7952       rl  w2  x1+a30    ;
 7273  7954       se  w2     0      ;    if save w2(cur) <> 0 then
 7274  7956       jl  w3     d12    ;      check message buf;
 7275  7958  
 7275  7958       zl  w3  x1+a28+1  ;    function select := save w0(cur);
 7276  7960       sl  w3     0      ;    if function select outside limits then
 7277  7962       sl  w3     j0     ;
 7278  7964       jl  w3     c29    ;      goto internal 3;
 7279  7966  
 7279  7966  ; at this point the following has been checked:
 7280  7966  ;    save w3 is a legal device address, governed by the current process
 7281  7966  ;    save w2 is zero  or  a legal message buffer address
 7282  7966  ;    save w0 is a legal function select
 7283  7966  
 7283  7966  ; w1 = cur, w3 = function select
 7284  7966  
 7284  7966       so  w3     1<1    ;   if function select.reset is on then
 7285  7968       jl.        i6.    ;     device descr := saved device descr;
 7286  7970       rl. w2     h5.    ;     clear device(device descr);
 7287  7972       jl  w1     d129   ;
 7288  7974       rl  w1     b1     ;     w1 := cur;
 7289  7976       zl  w3  x1+a28+1  ;     function select:=save(w0);
 7290  7978  i6:  ls  w3     -1     ;   function select := function select > 1;
 7291  7980       jl.    (x3+h0.)   ;    switch out through function select table;
 7292  7982  
 7292  7982  ; general return actions:
 7293  7982  ; a result is delivered to the driver, indicating the result of the call.
 7294  7982  ; if result = ok and function select is odd, return to the driver is made
 7295  7982  ;   via 'wait first event', else a normal return is made
 7296  7982  
 7296  7982  i3:  am         3-2    ; result 3: address error:
 7297  7984  i2:  am         2-1    ; result 2: sender stopped:
 7298  7986  i1:  am         1-0    ; result 1: message regretted:
 7299  7988  i0:  al  w0     0      ; result 0: ok:
 7300  7990  
 7300  7990       rl  w1     b1     ;    w1 := cur;
 7301  7992       rl  w2  x1+a28    ;    function select := save w0(cur);
 7302  7994       rs  w0  x1+a28    ;    save w0(cur) := result;
 7303  7996       sn  w0     0      ;    if result <> 0 or
 7304  7998       so  w2     2.1    ;      function select even then
 7305  8000       jl         c99    ;      goto interrupt return;
 7306  8002  
 7306  8002       rl  w2  x1+a302   ;    get save area address;
 7307  8004       rl  w0  x2+a304   ;    save ic(cur) := wait-first-event entry;
 7308  8006       rs  w0  x1+a33    ;
 7309  8008       jl         c99    ;    goto interrupt return;
 7310  8010  
 7310  8010  ; function select actions:
 7311  8010  
 7311  8010  ; function select = no operation.
 7312  8010  ; w1 = cur
 7313  8010  f0=i0                  ;   goto result 0;
 7314  8010  
 7314  8010  ; function select = start std control program
 7315  8010  ; w1 = cur
 7316  8010  f3:  am.        h40.   ;   first := std wait program;
 7317  8012                         ;   continue with std wait program;
 7318  8012  
 7318  8012  ; function select = start std wait program
 7319  8012  ; w1 = cur
 7320  8012  f2:  al  w0     0      ;   first := 0 (i.e. no start)
 7321  8014       rs. w0     h20.   ;   abs first of channel program := first;
 7322  8016  
 7322  8016       rl  w0  x1+a29    ;    timeout := save w1(cur);
 7323  8018  
 7323  8018       al  w3     0      ;    transfer code := 0;
 7324  8020                         ;      (i.e. 'wait' not considered a transfer...)
 7325  8020       jl.        i50.   ;    goto init transfer code;
 7326  8022  
 7326  8022  ; function select = start channel program:
 7327  8022  ; w1 = cur
 7328  8022  f1:  ld  w3    -100    ;
 7329  8024       ds. w3     h11.   ;    sender area used := driver area used := false;
 7330  8026       rs. w3     h23.   ;    old command := 0; (i.e. at least not data-chain)
 7331  8028       ds. w3     h16.   ;    first,top sender area := 0; i.e. presume empty
 7332  8030  
 7332  8030       rl  w3  x1+a30    ;    buf := save w2(cur);
 7333  8032       sn  w3     0      ;    if buf = 0 then
 7334  8034       jl.        i10.   ;      goto buffer consistency checked;
 7335  8036  
 7335  8036  ; when a message buffer is specified, it is generally concerning a
 7336  8036  ; data-transfer to/from the sender area
 7337  8036  ;
 7338  8036  ; therefore the message buffer is checked once and for all, and the proper
 7339  8036  ; buffer limits are found
 7340  8036  ;
 7341  8036  ; if any errors are found, the buffer limits will be set to en empty
 7342  8036  ; buffer, thus any attempt to specify addresses within the sender area
 7343  8036  ; will provoke a buffer limit violation
 7344  8036  
 7344  8036  ; w1 = cur, w3 = buf
 7345  8036  
 7345  8036       dl  w2  x3+a142   ;    w2 := sender(buf);  (w1 := receiver(buf) )
 7346  8038       sh  w2     0      ;    if sender <= 0 then
 7347  8040       jl.        i1.    ;      goto message regretted;
 7348  8042  
 7348  8042       bz  w0  x3+a145   ;    if operation(buf) is even then
 7349  8044       so  w0     2.1    ;
 7350  8046       jl.        i10.   ;      goto message buffer checked;
 7351  8048  
 7351  8048  ; check that the buffer is a message sent to the driver:
 7352  8048       sh  w1    -1      ;    if message received then
 7353  8050       ac  w1  x1        ;      receiver := - receiver;
 7354  8052       sh  w1     7      ;    if receiver <= 7 then
 7355  8054       jl.        i10.   ;      goto message buffer checked; i.e. an answer
 7356  8056  
 7356  8056       rl  w0  x1+a10    ;    w0 := kind(receiver);
 7357  8058       sn  w0     64     ;    if kind = pseudo process then
 7358  8060       rl  w1  x1+a50    ;      receiver := mainproc (receiver);
 7359  8062       sz  w0    -1-64   ;    if receiver is neither internal process nor
 7360  8064       rl  w1  x1+a250   ;      pseudo process then
 7361  8066       se  w1    (b1)    ;      receiver := driverproc (receiver);
 7362  8068       jl.        i10.   ;    if receiver <> cur then goto message checked;
 7363  8070  
 7363  8070  ; now buf has shown out to be a message, sent to this driver
 7364  8070  ; w2 = sender(buf), w3 = buf
 7365  8070       rl  w0  x2+a10    ;    w0 := kind(sender);
 7366  8072       sn  w0     64     ;    if kind = pseudo process then
 7367  8074       rl  w2  x2+a50    ;      sender := mainproc (sender);
 7368  8076       sz  w0    -1-64   ;    if sender neither internal nor pseudo process then
 7369  8078       rl  w2  x2+a250   ;      sender := driverproc (sender);
 7370  8080  ; w2 = internal process, which sent the message buffer
 7371  8080  ; w3 = message buffer
 7372  8080       dl  w1  x3+a152   ;    w0w1 := first,last address(buf);  (logic addresses)
 7373  8082       la. w0     h26.   ;    make the limits even;
 7374  8084       la. w1     h26.   ;
 7375  8086       sl  w0  x1+1      ;    if first address > last address then
 7376  8088       jl.        i10.   ;      goto message checked;
 7377  8090  
 7377  8090       sl  w0 (x2+a17)   ;    if first,last address area outside
 7378  8092       sl  w1 (x2+a18)   ;      the senders area then
 7379  8094       jl.        i10.   ;      goto message checked;
 7380  8096       al  w1  x1+2      ;    first of sender area := first address;
 7381  8098       ds. w1     h16.   ;    top   -    -     -   := last address + 2;
 7382  8100       rs. w2     h17.   ;    save sender process description address;
 7383  8102  
 7383  8102  ; message buffer consistency checked:
 7384  8102  ; prepare moving of the channel program, i.e. get first,last of
 7385  8102  ;    channel program area in device descr, and transform them to absolute
 7386  8102  ;    addresses.
 7387  8102  ; check that the channel-program-source starts within the driver process.
 7388  8102  ;
 7389  8102  ; (all regs irrell)
 7390  8102  
 7390  8102  i10:                   ; message checked:
 7391  8102       rl. w1     h5.    ;    device descr := saved descr;
 7392  8104       dl  w3  x1+a227   ;    abs first of chp area in device descr :=
 7393  8106       wa  w2     2      ;      device descr + relative first of chp area;
 7394  8108       wa  w3     2      ;    abs top of chp area in device descr :=
 7395  8110       ds. w3     h21.   ;      device descr + relative top of chp area;
 7396  8112  
 7396  8112       rl  w0  x1+a225   ;    if transfer code(device descr) <> 0 then
 7397  8114       se  w0     0      ;
 7398  8116       jl  w3     c29    ;      goto internal 3;
 7399  8118  ; note: this check is repeated at i50, where it is needed for checking
 7400  8118  ; start of 'std wait program'
 7401  8118  
 7401  8118       rl  w1     b1     ;    w1 := cur;
 7402  8120       rl  w3  x1+a29    ;    first of channel program := save w1 (cur);
 7403  8122       sl  w3 (x1+a17)   ;    if first of channel program
 7404  8124       sl  w3 (x1+a18)   ;      is outside current process then
 7405  8126       jl  w3     c29    ;      goto internal 3;
 7406  8128  
 7406  8128       wa  w3  x1+a182   ;    w3 := first of channel program
 7407  8130       al  w3  x3-2      ;          + base (cur) - 2;  i.e. last of entry
 7408  8132       al  w2  x2-2      ;    w2 := last of current entry in device descr;
 7409  8134  
 7409  8134  ; next command:
 7410  8134  ; w1 = cur
 7411  8134  ; w2 = last of current entry in device descr (abs addr)
 7412  8134  ; w3 = last of current entry in driver process (abs addr)
 7413  8134  i15:  al  w2  x2+j20    ; next command:    increase(device pointer);
 7414  8136       sl. w2    (h21.)  ;    if outside top of device descr area then
 7415  8138       jl  w3     c29    ;      goto internal 3;  i.e. channel program too long
 7416  8140       rs. w2     h22.   ;    save (last of current device entry);
 7417  8142  
 7417  8142  i16: rl  w1     b1     ; skip command:
 7418  8144       al  w3  x3+a320   ;    increase(driver pointer);
 7419  8146       sl  w3     0      ;    if overflow or
 7420  8148       sl  w3 (x1+a18)   ;      outside top of driver process then
 7421  8150       jl  w3     c29    ;      goto internal 3;
 7422  8152  
 7422  8152  ; move the command unchanged from driver area to device description:
 7423  8152       dl  w1  x3+j14    ;    move (param 1, param 2);
 7424  8154       ds  w1  x2+j24    ;
 7425  8156       rl  w0  x3+j12    ;    move (command);
 7426  8158       rs  w0  x2+j22    ;
 7427  8160       sz. w0    (h30.)  ;    if command is not databuffer without skip then
 7428  8162       jl.        i30.   ;      goto test chain;
 7429  8164  
 7429  8164  ; the command is sense, control, read or write with databuffer.
 7430  8164  ; param 1 (i.e. the first logic addr) must be transformed to an absolute
 7431  8164  ;    address, using the address code.
 7432  8164  ; check that the char count is not too small (command dependant).
 7433  8164  ;
 7434  8164  ; w0 = command word
 7435  8164  ; w1 = param 2 (=char count)
 7436  8164  
 7436  8164       sz  w0     j30    ;    minimum := if not sense command then
 7437  8166       am        -j31+1-1;      0   else   sense-char-count;
 7438  8168       sh  w1     j31-1  ;    if char count < minimum then
 7439  8170       jl  w3     c29    ;      goto internal 3;
 7440  8172  
 7440  8172  ; compute size (and thereby last) of data buffer area
 7441  8172       al  w0     0      ;    words := chars // number of chars per word;
 7442  8174       wd. w1     h27.   ;
 7443  8176       ls  w1     1      ;    last byte used := words * 2
 7444  8178       sn  w0     0      ;      - if chars mod (chars per word) = 0 then
 7445  8180       al  w1  x1-2      ;      2  else  0;
 7446  8182  
 7446  8182       rl  w0  x3+j13    ;    w0 := first logic address;
 7447  8184       wa  w1     0      ;    w1 := last logic address; (=last byte+first logic)
 7448  8186       sl  w0  x1+3      ;    if first address > last address then
 7449  8188       jl  w3     c29    ;      goto internal 3;  i.e. buffer wraps around top of core
 7450  8190  
 7450  8190  ; w0 = first logic address
 7451  8190  ; w1 = last logic address
 7452  8190  ; w3 = abs last of current chp entry
 7453  8190       bz  w2  x3+j12    ;    w2 := address code(current command);
 7454  8192       sh  w2     j1-1   ;    if address code inside limits then
 7455  8194       jl.    (x2+h1.)   ;      switch out through address code table;
 7456  8196       jl  w3     c29    ;    else goto internal 3;  i.e. illegal address code
 7457  8198  
 7457  8198  ; address transformation actions:
 7458  8198  
 7458  8198  ; address code = sender area:
 7459  8198  ; w0 = first logic address
 7460  8198  ; w1 = last logic address
 7461  8198  f10: sl. w0    (h15.)  ;    if buffer area outside sender area then
 7462  8200       sl. w1    (h16.)  ;
 7463  8202       jl.        i3.    ;      goto address error;
 7464  8204  
 7464  8204       rl. w2     h17.   ;    sender descr := saved sender process descr;
 7465  8206       rs. w2     h10.   ;    sender area used := true;
 7466  8208       wa  w0  x2+a182   ;    transform first address to absolute address;
 7467  8210       jl.        i20.   ;    goto first address transformed;
 7468  8212  
 7468  8212  ; address code = driver area
 7469  8212  ; w0 = first logic address
 7470  8212  ; w1 = last logic address
 7471  8212  f11: rl  w2     b1     ;    driver := cur;
 7472  8214       sl  w0 (x2+a17)   ;    if buffer area outside driver process then
 7473  8216       sl  w1 (x2+a18)   ;
 7474  8218       jl  w3     c29    ;      goto internal 3;
 7475  8220  
 7475  8220       rs. w2     h11.   ;    sender area used := true;
 7476  8222       wa  w0  x2+a182   ;    transform first address to absolute address;
 7477  8224       jl.        i20.   ;    goto first address transformed;
 7478  8226  
 7478  8226  ; address code = device description
 7479  8226  ; w0 = first relative address
 7480  8226  ; w1 = last relative address
 7481  8226  f12: rl. w2     h5.    ;
 7482  8228       sl  w0 (x2+a220)  ;    if buffer area outside
 7483  8230       sl  w1 (x2+a221)  ;      private area (device descr) then
 7484  8232       jl  w3     c29    ;      goto internal 3;
 7485  8234  
 7485  8234       wa  w0     4      ;    transform first relative address to absolute addr;
 7486  8236       jl.        i20.   ;    goto first address transformed;
 7487  8238  
 7487  8238  ; address code = message buffer
 7488  8238  ; w0 = first relative address
 7489  8238  ; w1 = last relative address
 7490  8238  f13: sl  w0     a145   ;    if buffer area outside
 7491  8240       sl  w1     a146   ;      message part of message buffer then
 7492  8242       jl  w3     c29    ;      goto internal 3;
 7493  8244  
 7493  8244       rl  w2     b1     ;    buf := save w2 (cur);
 7494  8246       wa  w0  x2+a30    ;    transform first relative address to absolute addr;
 7495  8248       sh  w0  x1        ;    if buf <> 0 then
 7496  8250       jl.        i20.   ;      goto first address transformed
 7497  8252       jl  w3     c29    ;    else goto internal 3;
 7498  8254  
 7498  8254  ; address code = abs core address
 7499  8254  ; w0 = absolute first address
 7500  8254  ; w1 = absolute last address
 7501  8254  f14:                   ; continue with first address transformed
 7502  8254  
 7502  8254  ; the legality of the buffer addresses has been checked,
 7503  8254  ;    and the first address is now an absolute core address
 7504  8254  ; w0 = abs first address
 7505  8254  ; w3 = last of current chp entry
 7506  8254  i20:                   ; first address transformed:
 7507  8254       rl. w2     h22.   ;    restore (device pointer);
 7508  8256       rs  w0  x2+j23    ;    move abs first address to channel program;
 7509  8258  
 7509  8258  ; now a complete command has been moved.
 7510  8258  ; check that the command does not change during data- or skip-chain
 7511  8258  ; w2 = last of device descr chp entry
 7512  8258  ; w3 = last of current chp entry
 7513  8258  i30:                   ; test chain:
 7514  8258       bl  w0  x2+j22+1  ;    command := command byte(current entry);
 7515  8260       sn  w0     j37    ;    if command = dummy command then
 7516  8262       jl.        i16.   ;      goto skip command;
 7517  8264       rl. w1     h23.   ;    prev command := old command;
 7518  8266       rs. w0     h23.   ;    old command := command;
 7519  8268       sz  w1     j35    ;    if previous command contained any chains then
 7520  8270       jl.        i31.   ;      begin
 7521  8272       jl.        i32.   ;      test that the two commands are equal:
 7522  8274  
 7522  8274  i31: lx  w1     0      ;      if prev command <> command then
 7523  8276       sz  w1     j36    ;        goto internal 3;
 7524  8278       jl  w3     c29    ;      end;
 7525  8280  i32:                   ;
 7526  8280  
 7526  8280  ; to facilitate the drivers interpretation from the sense-commands,
 7527  8280  ;    the first word of the sense area is cleared.
 7528  8280  ; thereby the driver can detect in a simple way, if that sense
 7529  8280  ;    has been executed.
 7530  8280  ;
 7531  8280  ; w0 = command (sign extended)
 7532  8280  ; w2 = last of device descr chp entry
 7533  8280  ; w3 = last of current chp entry
 7534  8280       sz  w0     j34    ;    if command = sense without skip then
 7535  8282       jl.        i33.   ;      begin
 7536  8284       al  w1     0      ;      top chp addr (sense area) := 0;
 7537  8286       am     (x2+j23)   ;
 7538  8288       rs  w1    +a315   ;
 7539  8290  i33:                   ;      end;
 7540  8290  
 7540  8290  ; a driver-supplied channel program may not contain a 'wait'-command,
 7541  8290  ;    because this migth delay the terminating interrupt infinitly,
 7542  8290  ;    thereby preventing the processes from being stopped.
 7543  8290  ;
 7544  8290  ; w0 = command (sign extended)
 7545  8290  ; w2 = last of device descr chp entry
 7546  8290  ; w3 = last of current chp entry
 7547  8290       la. w0     h36.   ;    w0 := command bits of command;
 7548  8292       sn  w0     j32    ;    if command = 'wait' then
 7549  8294       jl  w3     c29    ;      goto internal 3;
 7550  8296  
 7550  8296  ; if the channel program has not encountered the 'stop'-command
 7551  8296  ;    then move and translate the next command
 7552  8296  ;
 7553  8296  ; w0 = command (sign extended)
 7554  8296  ; w2 = last of device descr chp entry
 7555  8296  ; w3 = last of current chp entry
 7556  8296  
 7556  8296       rl  w1     b1     ;    w1 := cur;
 7557  8298       se  w0     j33    ;    if command <> 'stop' then
 7558  8300       jl.        i15.   ;      goto next command;
 7559  8302  
 7559  8302  ; (maybe it should be tested, that param 1 = 0, i.e. not a 'jump' ?)
 7560  8302  ;    rl  w0  x2+j23    ;
 7561  8302  ;    se  w0     0      ;
 7562  8302  ;    jl.        jump-command
 7563  8302  
 7563  8302  
 7563  8302  ; get the timeout-parameter from param 2 of the 'stop' command:
 7564  8302       rl  w0  x2+j24    ;    timeout := param 2;
 7565  8304  
 7565  8304  ; in case of transfer to/from senders area:
 7566  8304  ;    check that the sender is not stopped
 7567  8304  ;    increase stopcount to prevent further stopping of sender
 7568  8304  ;
 7569  8304  ; w0 = timeout
 7570  8304  ; w1 = driver
 7571  8304  
 7571  8304       rl. w3     h10.   ;    if sender area used then
 7572  8306       sn  w3     0      ;
 7573  8308       jl.        i40.   ;      begin
 7574  8310  
 7574  8310       rl. w3     h17.   ;      sender := saved sender descr addr;
 7575  8312       bz  w2  x3+a13    ;      if state(sender) shows
 7576  8314       se  w2     a99    ;       'waiting for start' then
 7577  8316       sn  w2     a100   ;
 7578  8318       jl.        i2.    ;        goto sender stopped;
 7579  8320  
 7579  8320       bz  w2  x3+a12    ;      increase (stopcount (sender));
 7580  8322       al  w2  x2+1      ;
 7581  8324       hs  w2  x3+a12    ;
 7582  8326  i40:                   ;      end;
 7583  8326  
 7583  8326  ; the driver should actually be put in such a state, that all pending
 7584  8326  ;    transfers would be aborted, in case the driver is stopped.
 7585  8326  ; however, until further, this is only done by means of increasing
 7586  8326  ;    the stopcount of the driver ( *** independant of transfer/no transfer
 7587  8326  ;    to/from the driver area *** )
 7588  8326  ;
 7589  8326  ; w0 = timeout
 7590  8326  ; w1 = driver
 7591  8326  ; w3 = transfer code:  0 = no transfer to sender area
 7592  8326  ;                     >0 = sender descr addr
 7593  8326  
 7593  8326  c.-1 ; ++++ not implemented ++++
 7594  8326       rl. w2     h11.   ;
 7595  8326       sn  w2     0      ;    if driver area not used then
 7596  8326       jl.        i41.   ;      goto init transfer code field;
 7597  8326  z.   ; ++++
 7598  8326  
 7598  8326       al  w3  x3+1      ;    make transfer code odd;  i.e. driver transfer
 7599  8328  
 7599  8328       bz  w2  x1+a12    ;    increase (stopcount (driver) );
 7600  8330       al  w2  x2+1      ;
 7601  8332       hs  w2  x1+a12    ;
 7602  8334  
 7602  8334  c. -1; ++++ not implemented
 7603  8334  i41: sn  w3     0      ;    if no transfers to the involved processes then
 7604  8334       al  w3    -1      ;      transfer code := -1; i.e. transfer pending;
 7605  8334  z.   ; ++++
 7606  8334  
 7606  8334  ; initialize the 'transfer code' field in the device description
 7607  8334  ;    (the field will be used, when the interrupt arrives,
 7608  8334  ;    to decrease the involved stopcounts)
 7609  8334  ; w0 = timeout, w1 = cur, w3 = transfer code
 7610  8334  i50: rl. w2     h5.    ;
 7611  8336       rl  w1  x2+a225   ;    if transfer code (device descr) <> 0 then
 7612  8338       se  w1     0      ;      goto internal 3;
 7613  8340       jl  w3     c29    ;    (i.e. transfer still in progress)
 7614  8342       rs  w3  x2+a225   ;    move transfer code to device descr;
 7615  8344  
 7615  8344  ; prepare timeout-operation:
 7616  8344  ;
 7617  8344  ; w0 = timeout
 7618  8344  ; w2 = device descr
 7619  8344  
 7619  8344  ; initialize controller table:
 7620  8344       am        (b1)    ;
 7621  8346       rl  w3    +a31    ;    entry:=logical device addr(device);
 7622  8348       wa. w3     h25.   ;      + 1 < 23
 7623  8350       wa  w3     b65    ;      base of controller table;
 7624  8352  
 7624  8352       rl. w1     h20.   ;    chp start (controller table entry) :=
 7625  8354       rs  w1  x3+a310   ;      abs first of channel program area;
 7626  8356       se  w1      0     ;   if chpg start = 0 then
 7627  8358       jl.         i54.  ;   begin
 7628  8360       al  w2  x2+a242   ;     oper:= timeout operation address;
 7629  8362       jl.         i53.  ;     goto check timeout;
 7630  8364                         ;   end;
 7631  8364  
 7631  8364  ; prepare for receiving an unusual status, i.e. in case the controller
 7632  8364  ;    could not deliver the standard status informations
 7633  8364  i54: al  w3     0      ;
 7634  8366       rs  w3  x2+a230   ;    chp addr (std status) := 0;
 7635  8368       al  w3     j40    ;
 7636  8370       rs  w3  x2+a233   ;    event status (std status) := status transfer error;
 7637  8372  
 7637  8372       al  w2  x2+a242   ;    oper := timeout operation address;
 7638  8374  
 7638  8374  ; start the device:
 7639  8374  ;
 7640  8374  ; at this point the monitor migth introduce another strategy,
 7641  8374  ;    instead of just starting the device immediatly.
 7642  8374  ; if the interrupt numbers are sparce, or if the bus migth
 7643  8374  ;    get overloaded, the actual starting can be delayed until
 7644  8374  ;    the resources are sufficient.
 7645  8374  ;
 7646  8374  ; notice that the monitor/driver conventions do not imply that
 7647  8374  ;    the transfer is started at once, i.e. buserrors or bustimeout
 7648  8374  ;    etc. are not returned to the driver at the calltime, but
 7649  8374  ;    when the interrupt-operation is received by the driver.
 7650  8374  ;
 7651  8374  ; under any circumstances the driver should have the result 0,
 7652  8374  ;    indicating that the transfer has been accepted to start.
 7653  8374  ;
 7654  8374  ; w0 = timeout
 7655  8374  ; w2 = timeout operation
 7656  8374       am     (b1)            ; if function > 12 = 0 then
 7657  8376       zl  w1  +a28           ;
 7658  8378       se  w1  0              ;
 7659  8380       jl.     i56.           ;
 7660  8382       am     (b1)            ;
 7661  8384       bz  w1  +a31+1         ;
 7662  8386       ls  w1  -2             ;   w1:=io-devno<1;
 7663  8388  i56: do  w1 (x2-a242+a235)  ;   start device(device addr(device desc));
 7664  8390  
 7664  8390       sx         2.111  ;    if any exceptions then
 7665  8392       jl.        i55.   ;      goto not started;
 7666  8394  
 7666  8394  ; if the operation is in queue, there may be three reasons:
 7667  8394  ;   1. a wait program is still in progress, i.e. in timeout-queue
 7668  8394  ;      (remove the operation and proceed, i.e. regret the wait-program)
 7669  8394  ;   2. a wait program is terminated by an event, i.e. in event queue
 7670  8394  ;      (the operation may not be removed, because the driver has to
 7671  8394  ;      reset the controller in order to proceed)
 7672  8394  ;   3. an uspecified channel program has terminated, i.e. in event queue
 7673  8394  ;      (this situation is treated as if it was a wait-program,
 7674  8394  ;      because it does not harm the monitor, but only confuses
 7675  8394  ;      the driver process)
 7676  8394  
 7676  8394  i53:                   ; check timeout:
 7677  8394       sn  w2 (x2+0)     ;    if timeout operation in queue then
 7678  8396       jl.        i52.   ;      begin
 7679  8398  
 7679  8398  ; search through the timeout-queue.
 7680  8398  ; if the operation is found here, then simply remove it and proceed,
 7681  8398  ;   as if it had not been in queue
 7682  8398  ; if not found here, it must be in the event-queue of the driver.
 7683  8398  ;   (just leave it there, because the driver must take proper action on it)
 7684  8398  
 7684  8398       al  w1     b69    ;      elem := timeout-queue head;
 7685  8400  i51: rl  w1  x1+0      ; rep: elem := next(elem);
 7686  8402       sn  w1     b69    ;      if end of timer-queue then
 7687  8404       jl.        i0.    ;        goto result 0; i.e. in event queue
 7688  8406  
 7688  8406       se  w1  x2        ;      if elem = timeout operation then
 7689  8408       jl.        i51.   ;        goto rep;
 7690  8410  
 7690  8410  ; found in timeout-queue:
 7691  8410       jl  w3     d5     ;      remove(timeout operation);
 7692  8412  i52:                   ;      end;
 7693  8412  
 7693  8412  ; w0 = timeout
 7694  8412  ; w2 = timeout operation
 7695  8412  
 7695  8412       al  w1     b69    ;    head := timeout queue head;
 7696  8414       rs  w0  x2-a242+a244;  save timeout in timeout-field(operation);
 7697  8416       se  w0     0      ;    if timeout <> 0 then
 7698  8418       jl  w3     d6     ;      link (timeout queue, timeout operation);
 7699  8420  
 7699  8420       jl.        i0.    ;    goto result 0; i.e. transfer started ok;
 7700  8422  
 7700  8422  ; the transfer could not actually be started, because of
 7701  8422  ;    some kind of bus/controller error.
 7702  8422  ;
 7703  8422  ; the interrupt operation must be returned to the driver,
 7704  8422  ;    together with indication of the kind of malfunction.
 7705  8422  ;
 7706  8422  ; w2 = linkfield of timeout operation
 7707  8422  ; ex = error kind
 7708  8422  
 7708  8422  i55: sx         2.1    ;    errorkind :=
 7709  8424       am         1-2    ;      if rejected then 1
 7710  8426       al  w0     2      ;      else 2;
 7711  8428  
 7711  8428       al. w3     i0.    ;    deliver interrupt(oper, error kind);
 7712  8430       jl         d121   ;    goto result 0;
 7713  8432  
 7713  8432  e.                     ; end of start i/o;
 7714  8432  
 7714  8432  ; monitor procedure start_controller(force, dev_no_of_main, message);
 7715  8432  ; 
 7716  8432  ; if the controller which is superviced by the specified mainprocess is
 7717  8432  ; ready, the communication area for the controller is initialized and the 
 7718  8432  ; controller is started. the message will be linked to the eventqueue of
 7719  8432  ; the mainprocess.
 7720  8432  ; if the mainprocess isn't ready the message is linked to the waiting queue
 7721  8432  ; of the mainprocess.
 7722  8432  ; at entry the message must be claimed ((and it must not be in any queues. ??))
 7723  8432  ;
 7724  8432  ; if the message address is -1 the call will cause rc8000 to send an
 7725  8432  ; 'answer device' function to the controller.
 7726  8432  ; result=3 (rc8000 bus error) is only possible if 'answer device' is 
 7727  8432  ; selected.
 7728  8432  ;
 7729  8432  ;            call                      return
 7730  8432  ;
 7731  8432  ;  save w0   force                     result (0: ok, 3: bus error, 4: unknown)
 7732  8432  ;  save w1   devno of mainprocess      devno of mainprocess
 7733  8432  ;  save w2   message/-1 (answer dev.)  message/-1 (answer dev.)
 7734  8432  ;  save w3   -                         unchanged
 7735  8432  ;
 7736  8432  
 7736  8432  b.  i1, j1  w.
 7737  8432  
 7737  8432  e64:                   ; start controller
 7738  8432       rl  w3  x1+a29    ; begin
 7739  8434       ls  w3    +1      ;
 7740  8436       wa  w3     b4     ;
 7741  8438       sl  w3    (b4)    ;
 7742  8440       sl  w3    (b5)    ;   if not mainproc within external processes then
 7743  8442       jl         r4     ;      result(4);
 7744  8444                         ;
 7745  8444       rl  w3  x3        ;   if mainproc.driverprocess <> cur process then
 7746  8446       se  w1 (x3+a250)  ;      goto internal(3);
 7747  8448       jl  w3     c29    ;
 7748  8450                         ;
 7749  8450       rl  w2  x1+a30    ;
 7750  8452       sn  w2    -1      ;   if not answer device then
 7751  8454       jl.        j0.    ;   begin
 7752  8456       jl  w3     d12    ;     check message buf(cur);
 7753  8458       al  w0     0      ;
 7754  8460       rx  w0  x1+a28    ;     result := ok; force := save_w0;
 7755  8462       jl.      (+2)     ;     goto test_ready_and_setup(force, message);
 7756  8464                  d142   ;
 7757  8466                         ;   end else
 7758  8466  j0:                    ;   begin
 7759  8466       rl  w1  x3+a10    ;
 7760  8468       al  w0     2      ;     if mainproc.kind <> ifp then
 7761  8470       rl  w2  x3+a235   ;        start controller(mainproc.devno + 'answer device')
 7762  8472       se  w1     26     ;     else
 7763  8474       am         2.11<1 ;        start controller(mainproc.devno, ifp-answer device);
 7764  8476       do  w0  x2+0      ;
 7765  8478       rl  w1     b1     ;     <* restore cur process *>
 7766  8480       sx         2.111  ;     if no exception then
 7767  8482       sz                ;        result(0)
 7768  8484       jl         r0     ;     else begin
 7769  8486       al  w0     2.100000;      mainproc.state := after error;
 7770  8488       lo  w0  x3+a78    ;
 7771  8490       hs  w0  x3+a78+1  ;
 7772  8492       jl         r3     ;       result(3);
 7773  8494                         ;     end;
 7774  8494                         ;   end;
 7775  8494  e.                     ; end;
 7776  8494  
 7776  8494  
 7776  8494  ; monitor procedure stop_io_message(message);
 7777  8494  ;
 7778  8494  ; it is only allowed procfunc to stop an io message send to an ida/ifp device.
 7779  8494  ; if the receiver of the message is an ida/ifp-process the message is marked
 7780  8494  ; stopped (if not already stopped). If the message isn't the first in the
 7781  8494  ; waiting queue of the corresponding main process, the driver of the
 7782  8494  ; receiver is started.
 7783  8494  ;
 7784  8494  ;          call             return
 7785  8494  ; saved w0  -                 -
 7786  8494  ; saved w1  -                 -
 7787  8494  ; saved w2  message           message
 7788  8494  ; saved w3  -                 -
 7789  8494  ;
 7790  8494  
 7790  8494  b. j10  w.
 7791  8494  
 7791  8494  e65:                   ; stop_io_message
 7792  8494       rl  w0    (b6)    ; begin
 7793  8496       se  w0  x1        ;   if calling process <> procfunc then
 7794  8498       jl         c29    ;   goto internal 3;
 7795  8500       jl  w3     d12    ;   check message(cur);
 7796  8502       zl  w0  x2+a138+1 ;
 7797  8504       so  w0   2.0000001;   if message.state.io then
 7798  8506       jl         c99    ;   return;
 7799  8508                         ;
 7800  8508       rl  w3  x2+a141   ;   proc := message.receiver;
 7801  8510       sh  w3     0      ;
 7802  8512       ac  w3  x3        ;
 7803  8514       sh  w3     5      ;   if message.receiver < 6 then return;
 7804  8516       jl         c99    ;   <*message has been answered*>
 7805  8518       rl  w0  x3+a10    ;   kind := proc.kind;
 7806  8520       se  w0     26     ;   if kind<>ifp_main and
 7807  8522       sn  w0     20     ;      kind<>ida_main then
 7808  8524       jl.        j2.    ;   begin
 7809  8526  j1:                    ;
 7810  8526       rl  w3  x3+a50    ;     while not (kind = idamain or
 7811  8528       rl  w0  x3+a10    ;                kind = ifpmain) do
 7812  8530       se  w0     26     ;     begin
 7813  8532       sn  w0     20     ;       proc := proc.main;
 7814  8534       sz                ;       kind := proc.kind;
 7815  8536       jl.        j1.    ;     end;
 7816  8538                         ;   end;
 7817  8538  j2:  al  w1     2.1000 ;
 7818  8540       zl  w0  x2+a138+1 ;     if not message.state = stopped then
 7819  8542       sz  w0  x1        ;     begin
 7820  8544       jl         c99    ;
 7821  8546       lo  w0     2      ;       message.state := stopped;
 7822  8548       hs  w0  x2+a138+1 ;
 7823  8550       jl  w3     d5     ;       unlink(message);
 7824  8552       al  w0     1      ;       force := yes;
 7825  8554       jl.      (+2)     ;       test_ready_and_setup(force, message);
 7826  8556                  d142   ;
 7827  8558                         ;     end else return;
 7828  8558  e.                     ; end;
 7829  8558  
 7829  8558  
 7829  8558  ; procedure emergency stop
 7830  8558  ; stop cpu to save registers in emergency situations
 7831  8558  
 7831  8558  e67:
 7832  8558       jl      -100     ; goto monitor fault
 7833  8560  
 7833  8560  
 7833  8560  
 7833  8560  ; procedure errorlog.
 7834  8560  ; called from driver when a abnormal result is received,
 7835  8560  ; or when a internal interupt is received.
 7836  8560  ; if the external process errorlog has received a buffer this procedure
 7837  8560  ; will produce a record. the format of the record depends on 
 7838  8560  ; the kind of error.
 7839  8560  ; the procedure is called with w1 holding the process description of the failed
 7840  8560  ; process e.g. the current internal process in case of a internal
 7841  8560  ; interupt or the physical disc in case of a discerror.
 7842  8560  ;
 7843  8560  ;
 7844  8560  ;
 7845  8560  ;  call                  return
 7846  8560  ; w0                     unchanged
 7847  8560  ; w1 failed process      unchanged
 7848  8560  ; w2 link                unchanged
 7849  8560  ; w3 main *)             unchanged
 7850  8560  ; *) only for lan/ioc device
 7851  8560  
 7851  8560  
 7851  8560  b. i17 , j22 w.
 7852  8560  g66: ds. w1  i0.        ; save all registers
 7853  8562       ds. w3  i1.        ;
 7854  8564       gg  w3  b91        ;
 7855  8566       se  w3  b49+12     ; if called from driverproc then
 7856  8568       am      1          ; called_from_dr:=true else
 7857  8570       al  w0  0          ; called_from_dr:=false;
 7858  8572       rs. w0  i4.        ;
 7859  8574       dl  w1  b19        ; save current buffer , current receiver
 7860  8576       ds. w1  i3.        ; 
 7861  8578       rl  w1  b30        ; set current receiver := errorlog
 7862  8580       rs  w1  b19        ; 
 7863  8582       jl. w3     j18.    ; examine queue 
 7864  8584       rl  w2  b30        ; if mess in queue then
 7865  8586       al  w2  x2+a70     ; c. w2= errorbuffer start
 7866  8588       al  w3  0          ;
 7867  8590       rs  w3  x2         ; 
 7868  8592       dl  w1  b13+2      ; insert time in errorbuf
 7869  8594       ds  w1  x2+32      ;
 7870  8596       rl. w1  i0.        ; record type : goto case kind of 
 7871  8598       rl  w0  x1+a10     ;
 7872  8600       hs  w0  x2+0       ;
 7873  8602       sn  w0  0          ; 
 7874  8604       jl.     j0.        ; internal interupts, monitor call break
 7875  8606       sn  w0  62         ; 
 7876  8608       jl.     j1.        ; discerror
 7877  8610       se  w0  86         ; 
 7878  8612       sn  w0  88         ; 
 7879  8614       jl.     j3.        ; fpa transmission error
 7880  8616       se  w0  84         ; 
 7881  8618       sn  w0  85         ; 
 7882  8620       jl.     j5.        ; subprocesserror
 7883  8622       se  w0  q6         ; if disc or
 7884  8624       sn  w0  q8         ;    terminal or
 7885  8626       jl.     j6.        ;
 7886  8628       se  w0  q18        ;    tape or
 7887  8630       sn  w0  q20        ;    iocmain or
 7888  8632       jl.     j6.        ;
 7889  8634       se  w0  q26        ;    lanmain or
 7890  8636       sn  w0  q28        ;    generel sekvential device
 7891  8638       jl.     j6.        ; then ioc/lan process error;
 7892  8640       jl.     j15.       ; otherwise ... return
 7893  8642  ;
 7894  8642  ; before exit the registers contain 
 7895  8642  ; w0 : kind.failed process
 7896  8642  ; w1 : process description of failed process
 7897  8642  ; w2 : errorbuffer start
 7898  8642  ;
 7899  8642  ;
 7900  8642  j0:  dl  w0  x1+a11+2   ; internal interupt .
 7901  8644       ds  w0  x2+4       ; move name.failed process
 7902  8646       dl  w0  x1+a11+6   ; 
 7903  8648       ds  w0  x2+8       ; 
 7904  8650       al  w2  x2+10      ; 
 7905  8652       al  w0  16         ; copy from process descr. w0,w1 w2 w3
 7906  8654       al  w1  x1+a28     ; status ic(logical) cause sb
 7907  8656       jl. w3  j9.      ;
 7908  8658       rl  w3  x1-a28+a182; copy last two instructions
 7909  8660       wa  w3  x1-a28+a33 ; 
 7910  8662       dl  w1  x3-2       ; 
 7911  8664       ds  w1  x2-10+28   ; 
 7912  8666       al  w3  34         ; size of record
 7913  8668       jl.     j13.       ; goto copy errorbuf
 7914  8670  ;
 7915  8670  ;
 7916  8670  j1:  rs  w1  x2+28      ; discerror
 7917  8672       rl  w3  x1+a244    ; copy i-o result, rem char.std status
 7918  8674       rl  w0  x1+a231    ; 
 7919  8676       ds  w0  x2+20      ;
 7920  8678       dl  w0  x1+100     ; status: sum of all statusbits
 7921  8680       ds  w0  x2+24      ;  e.g. std. status "or" statusarea1
 7922  8682       rl  w3  x1+102     ;     ( "or" statusarea2)
 7923  8684       rs  w3  x2+26      ; 
 7924  8686       rl. w1  i2.        ; copy from "current" buffer
 7925  8688       dl  w0  x1+a151    ; mess(1) - mess(2)
 7926  8690       ds  w0  x2+12      ; mess(4) - mess(5)
 7927  8692       dl  w0  x1+a153+2     
 7928  8694       ds  w0  x2+16      ;
 7929  8696       rl  w1  x1+a141    ; get  process descr. rec
 7930  8698       sh  w1  (b3)     ; if receiver defined then
 7931  8700       jl.     j2.      ;
 7932  8702       dl  w0  x1+a11+2   ;
 7933  8704       ds  w0  x2+4       ;
 7934  8706       dl  w0  x1+a11+6   ;
 7935  8708       ds  w0  x2+8       ; 
 7936  8710  j2:  al  w3  32         ; save size-2 of record
 7937  8712       jl.     j13.       ; goto copy errorbuf
 7938  8714  ;
 7939  8714  ;
 7940  8714  j3:  zl  w0  x1+42      ; fpa transmission error
 7941  8716       ls  w0  12         ; 
 7942  8718       hl  w0  x1+44      ; save
 7943  8720       ds  w1  x2+28      ; startbyte, statusbyte
 7944  8722       dl  w0  x1+a11+2    ; name
 7945  8724       ds  w0  x2+4       
 7946  8726       dl  w0  x1+a11+6   ; 
 7947  8728       ds  w0  x2+8       ;
 7948  8730       dl  w0  x1+a231    ; std status
 7949  8732       ds  w0  x2+12      ;
 7950  8734       dl  w0  x1+a233    ; 
 7951  8736       ds  w0  x2+16      
 7952  8738       dl  w0  x1+28      ; status from first sense
 7953  8740       ds  w0  x2+20      ;
 7954  8742       dl  w0  x1+32      ;
 7955  8744       ds  w0  x2+24      ;
 7956  8746       dl  w0  x1+36      ; copy status from second sense
 7957  8748       ds  w0  x2+36      ; 
 7958  8750       dl  w0  x1+40      ;
 7959  8752       ds  w0  x2+40      ;
 7960  8754       al  w0  18         ;  copy channelprogram
 7961  8756       wa  w1  x1+a226    ; 
 7962  8758       al  w2  x2+42      ;
 7963  8760       jl. w3  j9.        ; 
 7964  8762       al  w3  74         ; save size-2 of record
 7965  8764       jl.     j13.       ; goto copy errorbuf
 7966  8766  ;
 7967  8766  ;
 7968  8766  j5:  rs  w1  x2+28      ; subprocess error
 7969  8768       hl  w0  x1+36      ; copy from subprocess
 7970  8770       hs  w0  x2+1       ; subkind
 7971  8772       dl  w0  x1+a11+2   ;
 7972  8774       ds  w0  x2+4       ; name
 7973  8776       dl  w0  x1+a11+6   ; 
 7974  8778       ds  w0  x2+8       
 7975  8780       dl  w0  g29        ; copy first four words of mess from save area
 7976  8782       ds  w0  x2+12      ;
 7977  8784       dl  w0  g30        ; 
 7978  8786       ds  w0  x2+16      ;
 7979  8788       dl  w0  g21        ; copy the answer from std answer area
 7980  8790       ds  w0  x2+20      ;
 7981  8792       dl  w0  g23
 7982  8794       ds  w0  x2+24      ;
 7983  8796       rl  w3  g24        ;
 7984  8798       rs  w3  x2+26      ;
 7985  8800       al  w3  32         ; save size-2
 7986  8802       jl.     j13.       ; goto copy buf
 7987  8804  ;
 7988  8804  ;
 7989  8804  j6:                     ; ioc/lan error:
 7990  8804       dl  w0  x1+a11+2   ; 
 7991  8806       ds  w0  x2+4       ; move name.failed process
 7992  8808       dl  w0  x1+a11+6   ; 
 7993  8810       ds  w0  x2+8       ; 
 7994  8812       dl  w0  x1+a68     ; slave and contr
 7995  8814       hs  w3     0       ;
 7996  8816       rl. w1     i1.     ; saved w3 is address of main
 7997  8818       ds  w1  x2+14      ; move contr,slave,main
 7998  8820       dl  w0  x1+a501    ; move function,mess buffer address from comm. area
 7999  8822       ds  w0  x2+24      ;
 8000  8824       dl  w0  x1+a503    ;      device-id,proc-id
 8001  8826       ds  w0  x2+28      ;
 8002  8828       al  w1  x1+a510    ; 
 8003  8830       al  w2  x2+34      ;
 8004  8832       al  w0     16      ;
 8005  8834       jl. w3     j9.     ; move(comm_area.mess,addr.errorlog,16)
 8006  8836       al  w3     50      ; save size;
 8007  8838       jl.        j13.    ; goto copy buf
 8008  8840  ;
 8009  8840  ; *** stepping stone ***
 8010  8840  
 8010  8840       jl.  (2),   d15,   d15=k-4
 8011  8844  
 8011  8844  
 8011  8844  ;
 8012  8844  ; help procedure move words.
 8013  8844  ; move the specified number if words as words.
 8014  8844  ;   call                return
 8015  8844  ; w0: no of halfwords   destroyed (zero)
 8016  8844  ; w1: from adr          unchanged
 8017  8844  ; w2: to adr            unchanged
 8018  8844  ; w3: link              unchanged
 8019  8844  ;
 8020  8844  ;
 8021  8844  j9:   ds.w2  i13.       ;
 8022  8846        ds. w0  i15.      ;
 8023  8848  j10:  rl  w0  x1+0      ;
 8024  8850        rs  w0  x2+0      ;
 8025  8852        al  w1  x1+2      ;
 8026  8854        al  w2  x2+2      ;
 8027  8856        rl. w3  i15.      ; decrease word count
 8028  8858        al  w3  x3-2      ;
 8029  8860        rs. w3  i15.      ;
 8030  8862  
 8030  8862        sl  w3  1         ;
 8031  8864        jl.     j10.      ; 
 8032  8866        dl. w2  i13.      ; restore registers
 8033  8868        dl. w0  i15.      ;
 8034  8870        jl      x3        ;
 8035  8872  ;
 8036  8872  ;
 8037  8872        0                 ; from adr
 8038  8874  i13:  0                 ; to adr
 8039  8876        0                 ; link
 8040  8878  i15:  0                 ; word count
 8041  8880  ;
 8042  8880  ;
 8043  8880  ;
 8044  8880  ;
 8045  8880  j13:  rl  w2  b30       ; copy errorbuffer (general copy)
 8046  8882        rl  w1  x2+a54    ; check buffer.
 8047  8884        al  w0  0         ; if buffer<> last used buffer then
 8048  8886        se. w1  (i10.)    ; set bufferadr and clear relative adr.
 8049  8888        ds. w1  i10.      ;
 8050  8890        al  w2  x2+a70    ;
 8051  8892        rl. w1  i4.       ; 
 8052  8894        se  w1  0         ; if called from monitor then
 8053  8896        jl.     j12.      ; begin
 8054  8898        rl  w1  4         ;   copy direct: setup parameters to procedure move doublewors
 8055  8900        rs. w3     i5.    ;   save buffer length
 8056  8902        rl. w2  i10.      ;
 8057  8904        rl  w3  x2+a142   ;   sender
 8058  8906        sh  w3     0      ;
 8059  8908        ac  w3  x3        ;
 8060  8910        rl  w2  x2+a151   ;   first adr in messbuf
 8061  8912        wa  w2  x3+a182   ;   +sender.base
 8062  8914        wa. w2  i9.       ;   + no of hw already moved
 8063  8916        rl. w0     i5.    ;   record size
 8064  8918        jl. w3  j9.       ;
 8065  8920        rl. w1     i5.    ;   goto update no of hw moved
 8066  8922        rl. w2  i10.      ; 
 8067  8924        jl.     j14.      ; end else
 8068  8926                          ; begin <*use generel copy*>
 8069  8926  j12:  wa  w3  4         ;   store first and last adr
 8070  8928        ds. w3  i8.       ;
 8071  8930        al. w1  i6.       ; 
 8072  8932        rl. w2  i10.      ;   setup parameters and call 
 8073  8934        jd      1<11+84   ;   general copy
 8074  8936        se  w0  0         ;   if not ok then !!!!!
 8075  8938        jl.     j11.      ; end;
 8076  8940  j14:  wa. w1  i9.       ; (copy direct continues here. w1=no of hw moved
 8077  8942        rs. w1  i9.       ;  w2= mess buf adr)
 8078  8944        wa  w1  x2+a151   ;  update relative adr and check restsize in buf
 8079  8946        al  w1  x1+74     ;
 8080  8948        sh  w1  (x2+a152) ; if restsize < max record size then
 8081  8950        jl.     j15.      ; deliver answer else goto return
 8082  8952  j11:  rl. w1  i9.       ; 
 8083  8954        rl. w0     i4.    ; 
 8084  8956        se  w0     0      ; if called_from_dr then
 8085  8958        al  w2     g20-a150; addr:=driverproc answer area
 8086  8960        jl. w3     j22.   ; send answer
 8087  8962  
 8087  8962  
 8087  8962  j17: al  w0  -2        ; reset special watched receiver
 8088  8964       rs  w0  b32       ;
 8089  8966       jl. w3     j18.   ; if more messages in queue
 8090  8968       rl  w0  x2+a153   ; then set next special watched receiver adr
 8091  8970       rs  w0  b32       ; (placed in connection to "deliver result" )
 8092  8972   
 8092  8972  j15:  dl. w1  i3.       ; return : restore all parameters
 8093  8974        ds  w1  b19       ; restore current receiver and buffer
 8094  8976        dl. w1  i0.       ; restore all registers
 8095  8978        dl. w3  i1.       ;
 8096  8980        jl      x2        ;
 8097  8982  ;
 8098  8982  ;
 8099  8982  ; procedure next buff
 8100  8982  ; scan the the errorlog bufferqueue to find a buffer from a internal proces 
 8101  8982  ; if the buffer is regretted or the process is stopped then buffer is returned with result 1 and status 0
 8102  8982  ; otherwise the procedure return to link + 0 for no buffer i queue or
 8103  8982  ;                                   link + 2 a buffer in queue
 8104  8982  ; 
 8105  8982  j18: rs. w3     i16.   ; save link
 8106  8984  j19: rl  w1     b30    ;
 8107  8986       rl  w2  x1+a54    ; next buffer errorlog queue
 8108  8988       sn  w2  x1+a54    ; if empty then
 8109  8990       jl.        j15.   ; return
 8110  8992       rs  w2     b18    ;
 8111  8994       rl  w1  x2+a142   ;
 8112  8996       sh  w1     0      ; if regretted then
 8113  8998       jl.        j20.   ; goto prepare send answer else
 8114  9000       bz  w0  x1+a13    ;
 8115  9002       so  w0     a105   ; if -,(sender stopped) then
 8116  9004       jl.        (i16.) ; return happy
 8117  9006  j20: al  w1     0      ; prepare send answer:
 8118  9008       se. w1     (i4.)  ; if called_from_pr then
 8119  9010       al  w2     g20-a150; answer area:=driverproc.answer area else use the buffer
 8120  9012       jl. w3     j22.   ; send answer(result,count,addr);
 8121  9014       jl.        j19.   ; goto test next;     
 8122  9016  ;
 8123  9016  ;
 8124  9016  i16: 0                 ; link (j18)
 8125  9018  i17: 0                 ; link (j22)
 8126  9020  ;
 8127  9020  ; send answer
 8128  9020  ; reg     call         return
 8129  9020  ; w0                   changed
 8130  9020  ; w1      hw count        -
 8131  9020  ; w2      address         -
 8132  9020  ; w3      link            -
 8133  9020  ;
 8134  9020  j22: rs. w3     i17.   ; save link
 8135  9022       rs  w1  x2+a151   ; hw count
 8136  9024       ls  w1     -1     ;
 8137  9026       wm  w1     b203   ;
 8138  9028       rs  w1  x2+a152   ; byte count
 8139  9030       al  w1     0      ;
 8140  9032       rs  w1  x2+a150   ; status
 8141  9034       al  w0     1      ; result
 8142  9036       al. w3     d15.   ;
 8143  9038       se. w1     (i4.)  ; if called_from_dr then
 8144  9040       al  w3     g19    ; then deliver result
 8145  9042       jl  w3  x3        ; else deliver answer
 8146  9044       jl.        (i17.) ; return
 8147  9046  
 8147  9046  
 8147  9046  ; parameter list :
 8148  9046  ;
 8149  9046       0                   ; save w0: 
 8150  9048  i0:  0                   ; save w1: pd.failed process
 8151  9050       0                   ; save w2: link
 8152  9052  i1:  0                   ; save w3:     
 8153  9054  i2:  0                   ; save current buffer
 8154  9056  i3:  0                   ; save current receiver
 8155  9058  i4:  0                   ; boolean called_from;
 8156  9060  i5:  0                   ; record length (if called from monitor)
 8157  9062  
 8157  9062  
 8157  9062  i6:  2<1+1               ; parameters for general copy: funtion
 8158  9064  i7:  0                   ; first adr in errorbuf
 8159  9066  i8:  0                   ; last adr in errorbuf
 8160  9068  i9:  0                   ; relative start to mess buf adr (no of hw moved)
 8161  9070  i10: 0                   ; buffer adr
 8162  9072  
 8162  9072  e.                       ; end of errorlog entry
 8163  9072  \f


 8163  9072  
 8163  9072  
 8163  9072  ; ****** stepping stones ******
 8164  9072  ;
 8165  9072  
 8165  9072       jl.  ( +2),  d141 ,  d141 = k - 4
 8166  9076       jl.  ( +2),  d142 ,  d142 = k - 4
 8167  9080       jl.  ( +2),  d143 ,  d143 = k - 4
 8168  9084       jl.  ( +2),  d144 ,  d144 = k - 4
 8169  9088       jl.  ( +2),  d145 ,  d145 = k - 4
 8170  9092       jl.  ( +2),  d146 ,  d146 = k - 4
 8171  9096       jl.  ( +2),  d147 ,  d147 = k - 4
 8172  9100       jl.  ( +2),  d148 ,  d148 = k - 4
 8173  9104       jl.  ( +2),  d149 ,  d149 = k - 4
 8174  9108       jl.  ( +2),  d150 ,  d150 = k - 4
 8175  9112       jl.  ( +2),  d151 ,  d151 = k - 4
 8176  9116       jl.  ( +2),  d152 ,  d152 = k - 4
 8177  9120       jl.  ( +2),  d153 ,  d153 = k - 4
 8178  9124       jl.  ( +2),  d154 ,  d154 = k - 4
 8179  9128       jl.  ( +2),  d155 ,  d155 = k - 4
 8180  9132       jl.  ( +2),  d156 ,  d156 = k - 4
 8181  9136  
 8181  9136  ; **********************************************************************************
 8182  9136  ;
 8183  9136  ;                          d e v i c e  d r i v e r s
 8184  9136  ;
 8185  9136  ; this part contains drivers for devices connected through intelligent controllers.
 8186  9136  ; these device drivers are executed totaly in monitor mode. the drivers are called
 8187  9136  ; directly from the monitor procedure 'send message' when the receiver is an 
 8188  9136  ; external process representing a device connected through an intelligent device
 8189  9136  ; controller.
 8190  9136  ;
 8191  9136  ;
 8192  9136  ; common comments:
 8193  9136  ; ----------------
 8194  9136  ;
 8195  9136  ; structure of the drivers:
 8196  9136  ;        all drivers contains two parts: one part which is entered from
 8197  9136  ;        the monitor procedure 'send message' when an internal process
 8198  9136  ;        sends a message to an external process representing a device
 8199  9136  ;        connected through an "intelligent" controller. in this part the
 8200  9136  ;        message may be changed slightly (depends on the operation), to
 8201  9136  ;        facilitate the initialization of the "intelligent" controller
 8202  9136  ;        communication area.
 8203  9136  ;        in the second part of the driver the initialization of the 
 8204  9136  ;        communication area takes place. this part is called eigher from
 8205  9136  ;        the first part of the driver (when the controller is ready to 
 8206  9136  ;        receive a new operation immediately) or from the 'operation recei-
 8207  9136  ;        ved' interrupt procedure for the controller (only in the case where
 8208  9136  ;        the controller was busy at the time the message was send, or when
 8209  9136  ;        the message must be transfered as two or more chained operations
 8210  9136  ;        in this case the message has been linked to the waiting queue of 
 8211  9136  ;        the mainprocess).
 8212  9136  ; 
 8213  9136  ; chained operations:
 8214  9136  ;        messages which involve data-transfer to or from an ioc disc,
 8215  9136  ;        may be partitioned into two or more 'chained' operations.
 8216  9136  ;        this will takes place when:
 8217  9136  ;
 8218  9136  ;        1) the data transfer concerns non-consecutively placed segments
 8219  9136  ;           (messages to an area or 'prepare dump' operation to an ioc
 8220  9136  ;           main process).
 8221  9136  ;
 8222  9136  ;        2) the specified transfer exceeds a certain amount of data
 8223  9136  ;           (operations to disc or area or copy operation to an
 8224  9136  ;           ida main process).
 8225  9136  ;
 8226  9136  ;        whenever this partitioning takes place, the message will be placed
 8227  9136  ;        in the waiting queue of the main process. this ensures that 
 8228  9136  ;        all the partitions of one chain is transfered indivisible (the 'dump'
 8229  9136  ;        operation sent to an ioc main process or a regret function might
 8230  9136  ;        interrupt the chain). when the last operation in the
 8231  9136  ;        chain is transfered to the controller, the message is moved to the
 8232  9136  ;        event queue of the receiver.
 8233  9136  ;
 8234  9136  ; message:
 8235  9136  ;        when the specified message have been transfered to the controller
 8236  9136  ;        it will be linked to the receiver of the message (except messages
 8237  9136  ;        send to an area or a logical disc, where it will be linked to the
 8238  9136  ;        physical disc on which the area/logical disc is located).
 8239  9136  ;        if the controller is busy when the driver wants to transfer an
 8240  9136  ;        operation (message), the message will be linked to the waiting
 8241  9136  ;        queue of the main process of the controller.
 8242  9136  ;        when the monitor receives an 'operation received' interrupt from
 8243  9136  ;        the controller, it will check whether there is any messages in the
 8244  9136  ;        waiting queue of the main process or not. if there are any, the
 8245  9136  ;        driver for the receiver of the message will be started in the se-
 8246  9136  ;        cond part of the driver.
 8247  9136  ;
 8248  9136  ; stopping of operations (also called regret):
 8249  9136  ;        it is possible to regret any kinds of operations send to the
 8250  9136  ;        controller if the operation was delivered to the controller as
 8251  9136  ;        a 'device operation' function.
 8252  9136  ;        it is only possible to receive a regretted message in the
 8253  9136  ;        setup-part of the driver.
 8254  9136  ;        a message can be in three states:
 8255  9136  ;        - not transfered: the message has not been transfered to the
 8256  9136  ;          controller (only possible when the message has been linked to
 8257  9136  ;          the waiting queue).
 8258  9136  ;        - during transfer: only possible for messages which are delivered
 8259  9136  ;          as chained operations to the controller. it will be in this
 8260  9136  ;          state when the first element in the chain has been delivered
 8261  9136  ;          and until the last element is delivered.
 8262  9136  ;        - transfer completed: the message has been transfered to the 
 8263  9136  ;          controller.
 8264  9136  ;        
 8265  9136  ;        if the message is in the 'not transfered' state the message is
 8266  9136  ;        returned to the sender. a new message (if any) is selected from the
 8267  9136  ;        waiting queue of the main process, and control is transfered
 8268  9136  ;        to the driver of the receiver.
 8269  9136  ;
 8270  9136  ;        if the message is in the 'during transfer' or 'transfer completed'
 8271  9136  ;        state, the regret is sent as a 'regret message' function to the
 8272  9136  ;        controller.
 8273  9136  ;
 8274  9136  ;        if the message has been transfered to the controller when it is
 8275  9136  ;        regretted, it will be removed from the event queue of the receiver
 8276  9136  ;        and delivered to the driver in the normal way (the message is deli-
 8277  9136  ;        vered to the setup part of the driver).
 8278  9136  ;
 8279  9136  ; **********************************************************************************
 8280  9136  \f


 8280  9136  
 8280  9136  ;
 8281  9136  ; -----------------------------------------------------------------------------
 8282  9136  ;
 8283  9136  ;                            special driver - setup part
 8284  9136  ;
 8285  9136  ; this driver is used for transmission of reserve_process and release_process
 8286  9136  ; requests.
 8287  9136  ;
 8288  9136  ; at entry the registers contains:
 8289  9136  ;
 8290  9136  ; w0  -
 8291  9136  ; w1  main
 8292  9136  ; w2  proc + a81
 8293  9136  ; w3  -
 8294  9136  ;
 8295  9136  
 8295  9136  b.  i5,  j5  w.          ; <* data for special driver *>
 8296  9136                           ; ------ data -----
 8297  9136  i0:  0                   ; param: function
 8298  9138       3                   ;    +2: source (always no message)
 8299  9140       0                   ;    +4: receiver
 8300  9142                           ;
 8301  9142  h1:                      ; special driver: setup
 8302  9142  c. l53  b. f2 w.         ; ***** test 40 *****
 8303  9142       rs. w3     f1.      ;
 8304  9144       rs. w1     f0.      ;
 8305  9146       jl. w3     d150.    ;
 8306  9148       40                  ;
 8307  9150  f0:  0                   ; main
 8308  9152  f1:  0                   ;
 8309  9154       jl.        f2.      ;
 8310  9156       al  w0  x2-a81+a10  ;
 8311  9158       al  w1  x2-a81+a52  ; dump proc.kind - proc.reserver
 8312  9160       jl. w3     d151.    ;
 8313  9162  f2:                      ;
 8314  9162  e. z.                    ; ***** end test 40 *****
 8315  9162                           ;
 8316  9162                           ; begin
 8317  9162       jl  w3     d5       ;   unlink(proc);
 8318  9164       al  w2  x2-a81      ;
 8319  9166                           ;
 8320  9166       rs. w2     i0.+4    ;   param.receiver := proc;
 8321  9168       rl  w0  x2+a52      ;
 8322  9170       se  w0     0        ;   if proc.reserver = 0 then
 8323  9172       jl.        j1.      ;   begin
 8324  9174       al  w0     7        ;     func := release_device;
 8325  9176       jl.        j2.      ;   end
 8326  9178  j1:                      ;   else
 8327  9178       rl  w2  x2+a74      ;   begin
 8328  9180       dl  w0  x2+a11+2    ; 
 8329  9182       ds  w0  x1+a565     ;     main.mess_4 - mess_7 :=
 8330  9184       dl  w0  x2+a11+6    ;     proc.att_receiver.name;
 8331  9186       ds  w0  x1+a567     ;
 8332  9188       al  w0     6        ;     func := reserve_device;
 8333  9190                           ;   end;
 8334  9190  j2:                      ;
 8335  9190       ls  w0    +17       ;   param.function := func shift 17;
 8336  9192       rs. w0     i0.+0    ;
 8337  9194       al. w0     i0.      ;
 8338  9196       jl. w3     d153.    ;   setup(param, main, dummy);
 8339  9198       jl. w3     d155.    ;   increase no_of_outstanding(main);
 8340  9200       jl. w3     d144.    ;   start_controller(main);
 8341  9202       am         0        ;+0: error: ignore
 8342  9204       jl         c99      ;+2: ok   : goto return_from_interrupt;
 8343  9206                           ;
 8344  9206  e.                       ; end
 8345  9206  \f


 8345  9206  
 8345  9206  ;
 8346  9206  ;
 8347  9206  ; ----------------------------------------------------------------------------
 8348  9206  ;
 8349  9206  ;                         area driver,  part 1 
 8350  9206  ;                         ( message received )
 8351  9206  ; 
 8352  9206  ; message send to an area located on a physical disc connected through an
 8353  9206  ; IOC device controller.
 8354  9206  ; 
 8355  9206  ; control is transfered to this part of the area driver from the monitor
 8356  9206  ; procedure 'send message' through the intelligent device driver entry
 8357  9206  ; table, part 1.
 8358  9206  ;
 8359  9206  ; in this part of the driver the format of the messages will be changed
 8360  9206  ; slightly. when the messages is transfered to the second part of the
 8361  9206  ; area driver, they have the following formats:
 8362  9206  ;
 8363  9206  ;        input or output                 security erase
 8364  9206  ;        ---------------                 --------------
 8365  9206  ;   + 0: operation<12 + mode             18<12 + mode
 8366  9206  ;   + 2: first storage address           0
 8367  9206  ;   + 4: 0 (number of bytes)             number of bytes
 8368  9206  ;   + 6: first (logical) segment         first (logical) segment
 8369  9206  ;   + 8: no of segments                  no of segments 
 8370  9206  ;   +10: next (logical) segment          next (logical) segment
 8371  9206  ;
 8372  9206  ;        sense or position    
 8373  9206  ;        -----------------   
 8374  9206  ;   + 0: operation<12 + mode
 8375  9206  ;   + 2: 0                 
 8376  9206  ;   + 4: 0                
 8377  9206  ;   + 6: first (logical) segment (sense: 0) 
 8378  9206  ;   + 8: 0                                 
 8379  9206  ;   +10: first (logical) segment (sense: 0)
 8380  9206  ; 
 8381  9206  ;
 8382  9206  ;
 8383  9206  ; the operation sense acts like a position to the track on which the first
 8384  9206  ; segment of the area is stored. this will ensure that a valid 'detailed
 8385  9206  ; status' can be delivered in the answer.
 8386  9206  ;
 8387  9206  ; at entry the specified message must have been claimed and it may not be
 8388  9206  ; in any queues. the stop count of the sender must not have been increased.
 8389  9206  ; 
 8390  9206  ; at entry the registers contains:
 8391  9206  ;
 8392  9206  ; w0:  -
 8393  9206  ; w1:  receiver (area process description address)
 8394  9206  ; w2:  message buffer address
 8395  9206  ; w3:  -
 8396  9206  ;
 8397  9206  
 8397  9206  b. i10, j10  w.
 8398  9206  
 8398  9206  h4:                        ; message received:
 8399  9206  c.l53   b. f2 w.           ; ***** test 1 *****
 8400  9206       rs. w3     f1.        ;
 8401  9208       rs. w1     f0.        ;
 8402  9210       jl. w3     d150.      ;
 8403  9212       1                     ;
 8404  9214  f0:  0                     ; <area process>
 8405  9216  f1:  0                     ;
 8406  9218       jl.        f2.        ;
 8407  9220       al  w0  x2+a140       ; <dump message: -4 - +18>
 8408  9222       al  w1  x2+a155       ;
 8409  9224       jl. w3     d151.      ;
 8410  9226  f2:                        ;
 8411  9226  e.z.                       ; ***** end test 1 *****
 8412  9226                             ;
 8413  9226       rl. w0     i0.        ; begin
 8414  9228       jl. w3     d148.      ;   test legal operation(message, operation mask);
 8415  9230                             ;
 8416  9230       rl  w3  x1+a50        ;   if receiver.main.state <> connected then
 8417  9232       al  w0     2.0111     ;
 8418  9234       la  w0  x3+a78        ;      goto intervention;
 8419  9236       se  w0     l38        ;
 8420  9238       jl.        j6.        ;
 8421  9240                             ;
 8422  9240       zl  w0  x2+a150       ;
 8423  9242       sn  w0     0          ;   if message.operation <> sense then
 8424  9244       jl.        j3.        ;   begin
 8425  9246                             ;     <*** input, output, position, security erase ***>
 8426  9246  j0:  rl  w3  x2+a153       ;     if message.first_segment < 0 or
 8427  9248       sl  w3     0          ;        message.first_segment > area.size then
 8428  9250       sl  w3 (x1+a61)       ;        goto end_of_area; 
 8429  9252       jl.        j5.        ;
 8430  9254                             ;
 8431  9254       al  w3     0          ;     if message.operation = position then
 8432  9256       sn  w0     8          ;        message.no_of_segments := 0;
 8433  9258       rs  w3  x2+a154       ;
 8434  9260                             ;
 8435  9260       sz  w0     2.1        ;     if message.operation=input or output then
 8436  9262                             ;
 8437  9262       jl. w3     d145.      ;       set_no_of_segments(message);
 8438  9264       rl  w0  x1+a61        ;
 8439  9266       jl. w3     d146.      ;     check i-o transfer(area.size, message);
 8440  9268       rl  w0  x2+a138       ;
 8441  9270       so  w0     2.001      ;     if message.state=io then
 8442  9272       jl.        j1.        ;     begin
 8443  9274       rl  w0  x2+a154       ;
 8444  9276       sn  w0     0          ;     if message.number_of_segments=0 then
 8445  9278       jl.        d147.      ;       deleiver_status('ok',message);
 8446  9280       rl  w3  x2+a142       ;        
 8447  9282       zl  w0  x3+a12        ;       message.sender.stop_count :=
 8448  9284       ba. w0     1          ;       message.sender.stop_count + 1;
 8449  9286       hs  w0  x3+a12        ;
 8450  9288  j1:                        ;     end;
 8451  9288       al  w0     0          ;     message.no of bytes := 0;
 8452  9290       rs  w0  x2+a152       ;
 8453  9292                             ;
 8454  9292       rl  w0  x2+a153       ;     message.next_logical_segment :=
 8455  9294       rs  w0  x2+a155       ;     message.first_segment;
 8456  9296       zl  w0  x2+a150       ;     access_count := 
 8457  9298       se  w0     18         ;
 8458  9300       sz  w0  2.00100       ;     if output or security erase then
 8459  9302       am      a411-a412     ;          write_access
 8460  9304       al  w1  x1+a412       ;     else read_access;
 8461  9306       al  w3     1          ;
 8462  9308       wa  w3  x1            ;     if not possition then
 8463  9310       se  w0     8          ;        access_count :=
 8464  9312       rs  w3  x1            ;        access_count + 1;
 8465  9314       jl.        j4.        ;   end
 8466  9316                             ;   else
 8467  9316  j3:                        ;   begin <* sense, w0=0 *>
 8468  9316       rl  w3  x1+a61        ;     if area.size <= 0 then return_status('ok');
 8469  9318       sh  w3     0          ;
 8470  9320       jl.        d147.      ;
 8471  9322                             ;
 8472  9322       al  w3     0          ;     message.first_address := last_address :=
 8473  9324       ds  w0  x2+a152       ;             first_segment := remaining_segments :=
 8474  9326       ds  w0  x2+a154       ;             next_logical_segment := 0;
 8475  9328       rs  w0  x2+a155       ;
 8476  9330  ;    jl.        j4.        ;   end;
 8477  9330                             ;
 8478  9330  j4:  al  w0     0          ;   force := no;
 8479  9332       jl.        d142.      ;   test_ready_and_setup(force, message);
 8480  9334                             ;
 8481  9334  j5:                        ; end_of_area:
 8482  9334       rl  w0     b229        ;
 8483  9336       jl.        d147.      ;   deliver_status('end_of_area', message);
 8484  9338                             ; 
 8485  9338  j6:                        ; intervention:
 8486  9338       rl  w0     g49        ;
 8487  9340       jl.        d147.      ;   deliver status('intervention', message);
 8488  9342                             ;
 8489  9342  ; area operation mask (legal operations):
 8490  9342  ;   sense  input  output position security_erase
 8491  9342  i0: a0>0 + a0>3 + a0>5  +  a0>8   +   a0>18
 8492  9344                             ;
 8493  9344  e.                         ; end;
 8494  9344  \f


 8494  9344  
 8494  9344   
 8494  9344   
 8494  9344  ; -------------------------------------------------------------------------
 8495  9344  ;
 8496  9344  ;                           area driver, part 2
 8497  9344  ;                           (controller ready)
 8498  9344  ;
 8499  9344  ; this part of the area driver is called when the controller is ready 
 8500  9344  ; to receive the message.
 8501  9344  ; in this part of the driver, the communication area of the controller 
 8502  9344  ; is initialized in accordance with the specified message.
 8503  9344  ; if the message does not need to be delivered in more than one operation,
 8504  9344  ; (unchained), it is linked to the physical disc on which the area is
 8505  9344  ; located.
 8506  9344  ; if the message must be delivered in chained operations because the 
 8507  9344  ; transfer contains non-consecutively placed segments, the message will
 8508  9344  ; be placed in front of the waiting queue of the main process (if not
 8509  9344  ; already there). this will ensure, that the chained operation will be 
 8510  9344  ; delivered before any other operations are delivered to the controller
 8511  9344  ; (except for regret and dump operations!).
 8512  9344  ;
 8513  9344  ; when this part of the area driver transfer the message as an operation to
 8514  9344  ; the controller, the message has the following format:
 8515  9344  ;
 8516  9344  ;        input or output                 security erase
 8517  9344  ;        ---------------                 --------------
 8518  9344  ;   + 0: operation<12 + mode             18<12 + mode
 8519  9344  ;   + 2: first storage address           0
 8520  9344  ;   + 4: no of bytes                     no of bytes
 8521  9344  ;   + 6: first segment on physical disc  first segment on physical disc
 8522  9344  ;   + 8: remaining segments              remaining segments
 8523  9344  ;   +10: first logical segment           first logical segment
 8524  9344  ;        (in next transfer)              (in next operation)
 8525  9344  ;
 8526  9344  ;        sense or position   
 8527  9344  ;        -----------------  
 8528  9344  ;   + 0: operation<12 + mode 
 8529  9344  ;   + 2: 0                  
 8530  9344  ;   + 4: 0                 
 8531  9344  ;   + 6: first segment on physical disc
 8532  9344  ;   + 8: 0                            
 8533  9344  ;   +10: 0                           
 8534  9344  ;                                   
 8535  9344  ;
 8536  9344  ; at entry the specified message may either be linked to the waiting queue
 8537  9344  ; of the specified main process or it may be out of queue.
 8538  9344  ;
 8539  9344  ; at entry the registers contains:
 8540  9344  ;
 8541  9344  ; w0: -
 8542  9344  ; w1: main process
 8543  9344  ; w2: message
 8544  9344  ; w3: -
 8545  9344  ;
 8546  9344  b. i10, j10 w.             ; <* data for area setup *>
 8547  9344                             ;
 8548  9344  i0:  1<17                  ; param + 0: function (always device operation)
 8549  9346       0                     ;       + 2: source
 8550  9348       0                     ;       + 4: ioc receiver (physical disk)
 8551  9350  i1:  0                     ; main process
 8552  9352  i2:  0                     ; saved message
 8553  9354  i3:  0                     ; logical disc process
 8554  9356  i4:  0                     ; area process
 8555  9358                             ;
 8556  9358  h5:                        ; area driver: setup
 8557  9358  c.l53   b.  f2  w.         ; ***** test 2 *****
 8558  9358       rs. w3     f1.        ;
 8559  9360       rs. w1     f0.        ;
 8560  9362       jl. w3     d150.      ;
 8561  9364       2                     ;
 8562  9366  f0:  0                     ; <main process>
 8563  9368  f1:  0                     ;
 8564  9370       jl.        f2.        ;
 8565  9372       al  w0  x2+a138       ; <dump message: -4 - +18>
 8566  9374       al  w1  x2+a155       ;
 8567  9376       jl. w3     d151.      ;
 8568  9378  f2:                        ;
 8569  9378  e.z.                       ; ***** end test 2 *****
 8570  9378                             ;
 8571  9378       rs. w1     i1.        ; begin
 8572  9380       rl  w1  x2+a141       ;   save main process
 8573  9382       ac  w1  x1            ;
 8574  9384       rs. w1     i4.        ;   save area process
 8575  9386       rl  w1  x1+a50        ;
 8576  9388       rs. w1     i3.        ;   save logical disc process
 8577  9390       zl  w0  x1+a57        ;   if logical_disk.type = physical then
 8578  9392       sz  w0     2.00001    ;      <* logical disk = physical disk *> ;
 8579  9394       rl  w1  x1+a50        ;
 8580  9396       rs. w1     i0.+4      ;   save physical disc process
 8581  9398       rs. w2     i2.        ;   save message
 8582  9400                             ;
 8583  9400       zl  w0  x2+a138+1     ;   if message.state = stopped then
 8584  9402       sz  w0     2.0001000  ;   goto stop_message;
 8585  9404       jl.        j7.        ;
 8586  9406                             ;
 8587  9406       sz  w0     2.0000110  ;   if message.state =  not_transfered then
 8588  9408       jl.        j1.        ;   begin
 8589  9410       al  w3     0          ;
 8590  9412       rs. w3     i0.+2      ;     param.source := message;
 8591  9414       al  w3     2.0000010  ;
 8592  9416       lo  w3  x2+a138       ;     message.state := message.state or 
 8593  9418       hs  w3  x2+a138+1     ;     during_transfer;
 8594  9420       jl.        j3.        ;   end
 8595  9422  j1:                        ;   else
 8596  9422       so  w0     2.0000010  ;   if message.state = during_transfer then
 8597  9424       jl.        j2.        ;   begin
 8598  9426       al  w3     2          ;     param.source :=
 8599  9428       so  w0     2.0010000  ;     if message.state.com_save then
 8600  9430       al  w3     1          ;        com_save
 8601  9432       rs. w3     i0.+2      ;     else com_area;
 8602  9434       jl.        j3.        ;   end
 8603  9436  j2:                        ;   else
 8604  9436       jl         -1         ;   panic; <* message.state = transfer_complete *>
 8605  9438                             ;
 8606  9438  j3:  al. w0     i0.        ;
 8607  9440       rl. w1     i1.        ;
 8608  9442       jl. w3     d153.      ;   setup(param, main, message);
 8609  9444                             ;
 8610  9444                             ; <* from now on use com area: com_mes *>
 8611  9444                             ;
 8612  9444       zl  w0  x1+a570+a150  ;   if com_mes.operation = sense then
 8613  9446       ls  w0    -4          ;   begin
 8614  9448       se  w0     0          ;
 8615  9450       jl.        j0.        ;
 8616  9452       al  w0     8          ;     com_mes.operation := position;
 8617  9454       ls  w0    +4          ;     <* rest of message was changen in part 1 *>
 8618  9456       hs  w0  x1+a570+a150  ;
 8619  9458                             ;   end;
 8620  9458  j0:                        ;
 8621  9458       zl  w0  x2+a138+1     ;   
 8622  9460       so  w0     2.0000001  ;   if message.state.io then
 8623  9462       jl.        j4.        ;   begin
 8624  9464                             ;
 8625  9464       al  w3     0          ;
 8626  9466       rl  w0  x1+a570+a152  ;      com_mes.first_address := 
 8627  9468       ls  w0     1          ;      com_mes.first_address + 
 8628  9470       wd  w0     g48        ;      com_mes.no_of_bytes * 2 / 3;
 8629  9472       wa  w0  x1+a570+a151  ;
 8630  9474       rs  w0  x1+a570+a151  ;
 8631  9476                             ;   end;
 8632  9476  j4:  rl  w0  x1+a570+a155  ;
 8633  9478       al  w2  x1+a570       ;   <* pseudo message addr in main.com: com_mes *>
 8634  9480       rl. w1     i4.        ;   prepare_consecutive_transfer(next_logical_segment, area, com_mes);
 8635  9482       jl. w3     d143.      ;
 8636  9484       rl. w1     i1.        ;
 8637  9486       rs  w0  x1+a570+a155  ;   com_mes.next_logical_segment := next_logical_segment;
 8638  9488       rl. w2     i2.        ;
 8639  9490                             ;
 8640  9490       se  w3     0          ;   if com_mes.remaining_segments = 0 then
 8641  9492       jl.        j5.        ;   begin
 8642  9494       jl  w3     d5         ;     unlink(message);
 8643  9496       rl. w1     i0.+4      ;     link(physical disc.event queue, message);
 8644  9498       al  w1  x1+a54        ;
 8645  9500       jl  w3     d6         ;
 8646  9502                             ;
 8647  9502       rl. w1     i1.        ;
 8648  9504       ac  w0     2.001000+1 ;     main.com_state := 
 8649  9506       la  w0  x1+a78        ;     main.com_state and not in_chain;
 8650  9508       hs  w0  x1+a78+1      ;
 8651  9510                             ;
 8652  9510       ac  w0     2.0000110+1;     message.state :=
 8653  9512       la  w0  x2+a138       ;     message.state and
 8654  9514       al  w3     2.0000100  ;     transfer_complete;
 8655  9516       lo  w0     6          ;
 8656  9518       hs  w0  x2+a138+1     ;
 8657  9520       jl.        j6.        ;   end 
 8658  9522                             ;   else
 8659  9522  j5:                        ;   begin
 8660  9522       al  w1  x1+a81        ;     if not message.in_queue then
 8661  9524       sn  w2 (x2+a140)      ;        link(main.waiting_q, message);
 8662  9526       jl  w3     d6         ;
 8663  9528                             ;
 8664  9528       rl. w1     i1.        ;
 8665  9530       al  w0     2.001000   ;     main.com_state := 
 8666  9532       lo  w0  x1+a78        ;     main.com_state or in_chain;
 8667  9534       hs  w0  x1+a78+1      ;
 8668  9536                             ;   end;
 8669  9536                             ; 
 8670  9536  j6:                        ;
 8671  9536  c.l53   b.  f2  w.         ; ***** test 3 *****
 8672  9536       rs. w3     f1.        ;
 8673  9538       rl. w3     i1.        ;
 8674  9540       rs. w3     f0.        ;
 8675  9542       jl. w3     d150.      ;
 8676  9544       3                     ;
 8677  9546  f0:  0                     ; < main process >
 8678  9548  f1:  0                     ;
 8679  9550       jl.        f2.        ;
 8680  9552       al  w0  x2+a138       ; < dump message state>
 8681  9554       al  w1  x2+a138       ;
 8682  9556       jl. w3     d151.      ;
 8683  9558  f2:                        ;
 8684  9558  e.z.                       ; ***** end test 3 *****
 8685  9558                             ;
 8686  9558       jl. w3     d144.      ; start controller(main);
 8687  9560       jl. w3     d152.      ;+0: error: clean_after_buserror(message);
 8688  9562       jl         c99        ;+2: ok, controller started - goto interrupt_return;
 8689  9564                             ;
 8690  9564                             ;
 8691  9564                             ;
 8692  9564  j7:                        ; stop_message:
 8693  9564       rl. w1     i1.        ;
 8694  9566       rl. w0     i0.+4      ;
 8695  9568       jl. w3     d149.      ;   stop_message(physical disc, main, message);
 8696  9570       am         0          ;+0: during transfer:
 8697  9572                             ;+2: transfer completed:
 8698  9572       rl. w0     i0.+4      ;
 8699  9574       jl.        d154.      ;   regret(physical disk, main, message);
 8700  9576                             ;   <* never reached *>
 8701  9576                             ;
 8702  9576  e.                         ; end;
 8703  9576  \f


 8703  9576  
 8703  9576  ;
 8704  9576  ;
 8705  9576  ; ------------------------------------------------------------------------
 8706  9576  ; 
 8707  9576  ;                         disc driver, part 1
 8708  9576  ;                         (message received)
 8709  9576  ;
 8710  9576  ; message send to a (logical or physical) disc which is connected through
 8711  9576  ; an ioc device controller. The logical disc may represent a logical volume.
 8712  9576  ;
 8713  9576  ; control is transfered to this part of the disc driver from the monitor
 8714  9576  ; procedure 'send message' through the intelligent device driver entry
 8715  9576  ; table, part 1.
 8716  9576  ;
 8717  9576  ; in this part of the disc driver the format of the message may be changed
 8718  9576  ; slightly. in case of a sense operation, the format will be changed to 
 8719  9576  ; resemble the format of the position operation, where first segment will
 8720  9576  ; be segment number zero of the (physical or logical) disc. this will 
 8721  9576  ; ensure that a valid 'detailed status' can be delivered in the answer.
 8722  9576  ; If the logical disc represents a logical volume an i/o message where 
 8723  9576  ; first segment is outside the receiving logical disc will be transferred
 8724  9576  ; to the next logical disk in the logical volume with first segment in message 
 8725  9576  ; decreased by the size of the logical disk. The receiver of the message will 
 8726  9576  ; be changed to the new logical disk.
 8727  9576  ; when the message is transfered to the second part of the disc driver,
 8728  9576  ; the message has the following format:
 8729  9576  ;
 8730  9576  ;      input or output                   security erase
 8731  9576  ;      ---------------                   --------------
 8732  9576  ; + 0: operation<12 + mode               18<12 + 0
 8733  9576  ; + 2: first storage address             0
 8734  9576  ; + 4: 0                                 0
 8735  9576  ; + 6: first segment on physical disc    first segment on physical disc
 8736  9576  ; + 8: no of segments                    no of segments 
 8737  9576  ;
 8738  9576  ;      sense or position                 extract stat + read/write defect list
 8739  9576  ;      -----------------                 -------------------------------------
 8740  9576  ; + 0: operation<12 + 0                  operation<12 + mode
 8741  9576  ; + 2: 0                                 first storage address
 8742  9576  ; + 4: 0                                 no of bytes
 8743  9576  ; + 6: segment no on physical disc       
 8744  9576  ; + 8: 0
 8745  9576  ;
 8746  9576  ;      read or write data and ecc 
 8747  9576  ;      --------------------------
 8748  9576  ; + 0: operation<12 + 0
 8749  9576  ; + 2  first storage address
 8750  9576  ; + 4: 0
 8751  9576  ; + 6: first segment on physical disc
 8752  9576  ; + 8: 2 (no of segments)
 8753  9576  ; note: transfers 774 bytes            
 8754  9576  ;
 8755  9576  ; the operation 'format kit' will be transfered unchanged.
 8756  9576  ;
 8757  9576  ; at entry the message must have been claimed and it must not be in any
 8758  9576  ; queues. the stop count of the sender must not have been increased.
 8759  9576  ;
 8760  9576  ; at entry the registers contains:
 8761  9576  ;
 8762  9576  ; w0  -
 8763  9576  ; w1  receiver (disc process address)
 8764  9576  ; w2  message
 8765  9576  ; w3  -
 8766  9576  ;
 8767  9576  
 8767  9576  b. i10, j20  w.
 8768  9576  
 8768  9576  h6:                         ; message received
 8769  9576  j20:
 8770  9576  c.l53   b.  f2  w.          ; ***** test 6 *****
 8771  9576       rs. w3     f1.         ;
 8772  9578       rs. w1     f0.         ;
 8773  9580       jl. w3     d150.       ;
 8774  9582       6                      ;
 8775  9584  f0:  0                      ; < disc process >
 8776  9586  f1:  0                      ;
 8777  9588       jl.        f2.         ;
 8778  9590       al  w0  x2+a140        ; < dump message: +0 - +16 >
 8779  9592       al  w1  x2+a154        ;
 8780  9594       jl. w3     d151.       ;
 8781  9596  f2:                         ;
 8782  9596  e.z.                        ; ***** end test 6 *****
 8783  9596                              ; begin
 8784  9596       zl  w0  x2+a150        ;
 8785  9598       sl  w0     30          ;   if message.operation > 29 then
 8786  9600       jl.        j8.         ;      goto return_result_3;
 8787  9602                              ;
 8788  9602       zl  w0  x1+a57         ;   if receiver.type = physical_disc and
 8789  9604       rl  w3  x1+a70         ;      receiver.next_log_disc <> 0 then
 8790  9606       so  w0     2.00001     ;      goto return_result_3;
 8791  9608       sn  w3     0           ; 
 8792  9610       sz                     ;
 8793  9612       jl.        j8.         ;
 8794  9614                              ;
 8795  9614       zl  w3  x2+a150        ;   if receiver.state <> connected then 
 8796  9616       al  w0     2.0111      ;
 8797  9618       la  w0  x1+a78         ;      if message.operation <> power down or
 8798  9620       sn  w0     l38         ;        (message.operation = power down and
 8799  9622       jl.        j0.         ;         receiver.state <> intervention) then
 8800  9624       sn  w0     l40         ;         goto intervention;
 8801  9626       se  w3     12          ;
 8802  9628       jl.        j10.        ;
 8803  9630  j0:                         ;
 8804  9630                              ;
 8805  9630       am      x3             ;   goto case message.operation of
 8806  9632       am      x3             ;
 8807  9634       jl.       (i0.)        ;
 8808  9636                              ;
 8809  9636  i0:             j3          ; 0: sense
 8810  9638                  j8          ; 1: -
 8811  9640                  j8          ; 2: -
 8812  9642                  j1          ; 3: input
 8813  9644                  j8          ; 4: -
 8814  9646                  j1          ; 5: output
 8815  9648                  j4          ; 6: format kit
 8816  9650                  j8          ; 7: -
 8817  9652                  j1          ; 8: position
 8818  9654                  j2          ; 9: extract statistics
 8819  9656                  j4          ;10: power up spindel
 8820  9658                  j8          ;11: - 
 8821  9660                  j4          ;12: power down spindel
 8822  9662                  j8          ;13: -
 8823  9664                  j14         ;14: define logical volume
 8824  9666                  j8          ;15: -
 8825  9668                  j16         ;16: remove logical volume
 8826  9670                  j8          ;17: -
 8827  9672                  j1          ;18: security erase
 8828  9674                  j1          ;19: read data and ecc
 8829  9676                  j8          ;20: -
 8830  9678                  j1          ;21: write data and ecc 
 8831  9680                  j8          ;22: -
 8832  9682                  j8          ;23: -
 8833  9684                  j8          ;24: -
 8834  9686                  j8          ;25: -
 8835  9688                  j8          ;26: -
 8836  9690                  j8  ; j2    ;27: read defect list <* ej rc8000 *>
 8837  9692                  j8          ;28: -
 8838  9694                  j8  ; j2    ;29: write defect list <* ej rc8000 *>
 8839  9696  
 8839  9696                              ;
 8840  9696  j1:                         ; input:
 8841  9696                              ; output:
 8842  9696                              ; position:
 8843  9696                              ; security erase:
 8844  9696                              ; read and write data with ecc
 8845  9696                              ; salvage data
 8846  9696                              ; begin
 8847  9696       rl  w0  x2+a153        ;   if message.first_segment < 0 or
 8848  9698       sl  w0     0           ;      message.first_segment > disc.size then
 8849  9700       sl  w0 (x1+a74)        ;      goto check_logical_volume;
 8850  9702       jl.        j11.        ;
 8851  9704                              ;
 8852  9704       al  w0     0           ;   if message.operation = position then
 8853  9706       sn  w3     8           ;      message.no of segments := 0;
 8854  9708       rs  w0  x2+a154        ;
 8855  9710                              ;
 8856  9710       sz  w3     2.1         ;   if message.operation = input or output then
 8857  9712       jl. w3     d145.       ;      set_no_of_segments(message);
 8858  9714       rl  w0  x1+a74         ;
 8859  9716       jl. w3     d146.       ;   check_i-o_transfer(disc.size, message);
 8860  9718       rl  w0  x2+a138        ;
 8861  9720       so  w0     2.001       ;    if message.state=io then
 8862  9722       jl.        j6.         ;    begin
 8863  9724       rl  w0  x2+a154        ;
 8864  9726       sn  w0     0           ;    if message.number_of_segments=0 then
 8865  9728       jl.        d147.       ;      deleiver_status('ok',message);
 8866  9730       rl  w3  x2+a142        ;       
 8867  9732       zl  w0  x3+a12         ;      message.sender.stop_count :=
 8868  9734       ba. w0     1           ;      message.sender.stop_count + 1;
 8869  9736       hs  w0  x3+a12         ;
 8870  9738                              ;   end;
 8871  9738  j6:                         ;
 8872  9738       al  w0     0           ;   message.no_of_bytes := 0;
 8873  9740       rs  w0  x2+a152        ;
 8874  9742                              ;
 8875  9742       rl  w0  x2+a153        ;   message.first_segment :=
 8876  9744       wa  w0  x1+a73         ;   message.first_segment + disc.first_segment;
 8877  9746       rs  w0  x2+a153        ;
 8878  9748       jl.        j5.         ; end;
 8879  9750                              ;
 8880  9750  j2:                         ; extract statistics:
 8881  9750                              ; read/write defect list:
 8882  9750       zl  w0  x1+a57         ; begin
 8883  9752       se  w3     9           ;   if message.operation = read/write_defect_list
 8884  9754       so  w0     2.00001     ;   and receiver.kind = locigal_disk then
 8885  9756       sz                     ;   goto return_result_3;
 8886  9758       jl.        j8.         ;
 8887  9760                              ;
 8888  9760       rl  w3  x2+a152        ;
 8889  9762       al  w0  x3+2           ;   message.no_of_bytes :=
 8890  9764       ws  w0  x2+a151        ;   (last_address - first_address + 2)/2*3     ;
 8891  9766       ls  w0    -1           ;
 8892  9768       wm  w0     g48         ;
 8893  9770       rs  w0  x2+a152        ;
 8894  9772                              ;
 8895  9772       rl  w3  x2+a142        ;   message.sender.stop_count :=
 8896  9774       zl  w0  x3+a12         ;   message.sender.stop_count + 1;
 8897  9776       ba. w0     1           ;
 8898  9778       hs  w0  x3+a12         ;
 8899  9780       jl.        j5.         ; end;
 8900  9782                              ;
 8901  9782  j3:                         ; sense:
 8902  9782       al  w0     0           ; begin <* prepare a position operation *>
 8903  9784       rl  w3  x1+a73         ;   message.first_segment := disc.first_segment;
 8904  9786       ds  w0  x2+a154        ;   message.remaining_segments := 0;
 8905  9788       rs  w0  x2+a151        ;   message.first_storage_address := 0;
 8906  9790       rs  w0  x2+a152        ;   message.last_storage_address := 0;
 8907  9792       jl.        j5.         ; end;
 8908  9794                              ;
 8909  9794  j4:                         ; format kit:
 8910  9794                              ; power up spindel:
 8911  9794                              ; power down spindel:
 8912  9794       zl  w0  x1+a57         ; begin
 8913  9796       sz  w0     2.00001     ;   if receiver.type = logical_disc then
 8914  9798       jl.        j8.         ;      goto return_result_3;
 8915  9800       jl.        j5.         ; end;
 8916  9802                              ;
 8917  9802  j5:  al  w0     0           ; force := no;
 8918  9804       jl.        d142.       ; test_ready_and_setup(force, message);
 8919  9806                              ;
 8920  9806  j7:  am         2-3         ; return_result_2:
 8921  9808  j8:                         ; return_result_3:
 8922  9808       al  w0     3           ; r=result
 8923  9810       al  w3     c99         ;
 8924  9812       jl.        d15.        ;   deliver_answer(message,result); goto return_from_interrupt;
 8925  9814                              ;
 8926  9814  j9:                         ; end_medium:
 8927  9814       rl  w0     b229         ;
 8928  9816       jl.        d147.       ;   deliver_status('end_of_medium', message);
 8929  9818                              ;
 8930  9818  j10:                        ; intervention:
 8931  9818       rl  w0     g49         ;
 8932  9820       jl.        d147.       ;   deliver_status('intervention', message);
 8933  9822                              ;
 8934  9822  
 8934  9822  j11:                        ; check_logical_volume:
 8935  9822       rl  w3  x1+a56         ;
 8936  9824       sl  w0     0           ; if buf.first_segment <0 or
 8937  9826       sn  w3     0           ; disk.successor =0 then
 8938  9828       jl.        j9.         ; goto end_medium
 8939  9830       ws  w0  x1+a74         ; buf.first_segment:=
 8940  9832       rs  w0  x2+a153        ;   buf.first_segment-disk.size
 8941  9834       al  w1  x3             ; 
 8942  9836       ac  w3  x3             ; receiver:= receiver.successor;
 8943  9838       rs  w3  x2+a141        ; buf.receiver:=-disk.successor;
 8944  9840       jl.        j20.        ; goto message received
 8945  9842  
 8945  9842  
 8945  9842  j14:                        ; define logical volume:
 8946  9842       rl  w3  x2+a142        ; if sender.function-bit(8) = 0 then
 8947  9844       zl  w0  x3+a22         ;   deliver_result_2;
 8948  9846       so  w0     1<3         ;
 8949  9848       jl.        j7.         ;
 8950  9850       rl  w0  x1+a56         ; <*check that the receiver is not already 
 8951  9852       se  w0     0           ;  part of a logical volume *>
 8952  9854       jl.        j8.         ; if disk.successor = 0 then deliver_result_3;
 8953  9856       zl  w0  x1+a57         ; <*check that receiver is a logical disc*>
 8954  9858       so  w0     2.1         ; if receiver.state = physical_disk then
 8955  9860       jl.        j8.         ; deliver_result_3;
 8956  9862       rl  w3  x2+a153        ; <*check successor*>
 8957  9864       ls  w3     1           ; <*if mess-3 does not not hold a legal device no
 8958  9866       wa  w3     b4          ;  then answer unintelligble*>
 8959  9868       sl  w3     (b4)        ;
 8960  9870       sl  w3     (b5)        ; 
 8961  9872       jl.        j8.         ;
 8962  9874       rl  w3  x3             ; successor := process_description(buff.mess-3);
 8963  9876       sn  w3  x1             ; if successor = receiver then deliver result(3);
 8964  9878       jl.        j8.         ;
 8965  9880       rl  w0  x3+a10         ; <*check that successor is a logical disk*>
 8966  9882       se  w0     q6          ; if successor.kind <> disk then deliver_result_3;
 8967  9884       jl.        j8.         ;
 8968  9886       zl  w0  x3+a57         ; if successor.state <> logical_disk then
 8969  9888       se  w0     2.0000001   ;   deliver_result_3;
 8970  9890       jl.        j8.         ;
 8971  9892                              ; <*everything is found to be ok*>
 8972  9892       lo. w0     i1.         ; successor.state := part_of_logical_volume;
 8973  9894       hs  w0  x3+a57         ;
 8974  9896       zl  w0  x1+a57         ; <*if the receiver is a logical disk then 
 8975  9898       so. w0     (i1.)       ;  it is the head of the logical volume*>
 8976  9900       lo. w0     i2.         ; if receiver.state = logical_disk then
 8977  9902       hs  w0  x1+a57         ;   receiver.state := head_of_logical_volume
 8978  9904       rs  w3  x1+a56         ; receiver.successor := successor;
 8979  9906       al  w0     0           ; deliver_result_ok; 
 8980  9908       jl.        d147.       ;
 8981  9910  
 8981  9910                              ; remove logical volume:
 8982  9910  j16: rl  w3  x2+a142        ; if sender.function_bit(8) = 0 then
 8983  9912       zl  w0  x3+a22         ;   deliver_result_2;
 8984  9914       so  w0     1<3         ;
 8985  9916       jl.        j7.         ;
 8986  9918       zl  w0  x1+a57         ; if receiver.state <> head_of_logical_volume
 8987  9920       so. w0     (i2.)       ;  then deliver_result_3;
 8988  9922       jl.        j8.         ;
 8989  9924                              ; <*receiver ok*>
 8990  9924       lx. w0     i2.         ; receiver.state = not(head_of_logical_volume)
 8991  9926       hs  w0  x1+a57         ;
 8992  9928       al  w3     0           ; <*run through logical volume and release 
 8993  9930       rx  w3  x1+a56         ; all logical disks*>
 8994  9932       sn  w3     0           ; if successor = 0 then panic(16)
 8995  9934       jl         -16         ;
 8996  9936       rs. w2     i3.         ;
 8997  9938       rl. w2     i1.         ; next:=disk.successor;
 8998  9940       al  w0     0           ;
 8999  9942  j17: al  w1  x3             ; while next <> 0 do
 9000  9944       rl  w3  x1+a56         ; begin
 9001  9946       rs  w0  x1+a56         ;   disk.successor := 0;
 9002  9948       zl  w2  x1+a57         ;
 9003  9950       lx. w2      i1.        ;   disk.state:=NOT(part_of_logical_volume);
 9004  9952       hs  w2  x1+a57         ; end;
 9005  9954       se  w3     0           ;
 9006  9956       jl.        j17.        ;
 9007  9958       rl. w2     i3.         ;
 9008  9960       jl.        d147.       ; end ;
 9009  9962  
 9009  9962  i1:  2.0100000              ; bitmask: part_of_logical_volume
 9010  9964  i2:  2.1000000              ; bitmask: head_of_logical_volume
 9011  9966  i3:  0                      ; saved message buffer
 9012  9968  
 9012  9968  e.                          ; end;
 9013  9968  \f


 9013  9968  
 9013  9968  ;
 9014  9968  ;
 9015  9968  ; ------------------------------------------------------------------------
 9016  9968  ;
 9017  9968  ;                         disc driver, part 2
 9018  9968  ;                         (controller ready)
 9019  9968  ;
 9020  9968  ; this part of the disc driver is called when the controller is ready
 9021  9968  ; to receive the message.
 9022  9968  ; in this part of the driver, the communication area of the controller
 9023  9968  ; is initialized in accordance with the specified message.
 9024  9968  ;
 9025  9968  ; if the message must be delivered in more than one operation to the con-
 9026  9968  ; troller (delivered as chained operations), the message buffer will be
 9027  9968  ; linked in front of the waiting queue of the main process (if not
 9028  9968  ; already there). this will only happen when the operation is input, output
 9029  9968  ; or security erase and the specified data transport exceeds a certain
 9030  9968  ; amount of data.
 9031  9968  ; in all other situations the message buffer will be linked to the physical
 9032  9968  ; disc.
 9033  9968  ; 
 9034  9968  ; when this part of the disc driver deliver the message to the control-
 9035  9968  ; ler, the format of the message will be as follows:
 9036  9968  ;
 9037  9968  ;      input or output                  security erase
 9038  9968  ;      ---------------                  --------------
 9039  9968  ; + 0: operation<12 + mode              18<12 + mode
 9040  9968  ; + 2: first storage address            0
 9041  9968  ; + 4: no of bytes                      no of bytes 
 9042  9968  ; + 6: first segment on physical disc   first segment on physical disc
 9043  9968  ; + 8: remaining segments               remaining segments 
 9044  9968  ;
 9045  9968  ;      read or write data and ecc 
 9046  9968  ;      --------------------------           
 9047  9968  ; + 0: operation<12 + 0                 
 9048  9968  ; + 2: first address 
 9049  9968  ; + 4: 2*768 (no of bytes)              
 9050  9968  ; + 6: first segment on physical disc   
 9051  9968  ; + 8: 0 (remaining segments)           
 9052  9968  ;
 9053  9968  ;
 9054  9968  ; all other operation will be delivered unchanged to the controller
 9055  9968  ; (i.e. the format of the messages specified in the first part of the
 9056  9968  ; disc driver is not changed).
 9057  9968  ;
 9058  9968  ; at entry the specified message may either be in the waiting queue
 9059  9968  ; of the specified main process or it may be 'free'.
 9060  9968  ;
 9061  9968  ; at entry the registers contains:
 9062  9968  ;
 9063  9968  ; w0  -
 9064  9968  ; w1  main process
 9065  9968  ; w2  message
 9066  9968  ; w3  -
 9067  9968  ;
 9068  9968  
 9068  9968  b. i10, j25  w.             ; <* data for disk setup *>
 9069  9968  
 9069  9968  i0:  1<17                   ; param: function (always device operation)
 9070  9970       0                      ;    +2: source
 9071  9972       0                      ;    +4: receiver of operation (physical disk)
 9072  9974  i1:  0                      ; main
 9073  9976                              ;
 9074  9976  h7:                         ; disc driver: setup
 9075  9976  c.l53  b.  f2  w.           ; ***** test 7 *****
 9076  9976       rs. w3     f1.         ;
 9077  9978       rs. w1     f0.         ;
 9078  9980       jl. w3     d150.       ;
 9079  9982       7                      ;
 9080  9984  f0:  0                      ; < main process >
 9081  9986  f1:  0                      ;
 9082  9988       jl.        f2.         ;
 9083  9990       al  w0  x2+a138        ; < dump message: -4 - +16 >
 9084  9992       al  w1  x2+a154        ;
 9085  9994       jl. w3     d151.       ;
 9086  9996  f2:                         ;
 9087  9996  e.z.                        ; ***** end test 7 *****
 9088  9996                              ;
 9089  9996       rs. w1     i1.         ; begin
 9090  9998       rl  w3  x2+a141        ;
 9091 10000       ac  w3  x3             ;   physical disc :=
 9092 10002       zl  w0  x3+a57         ;   if message.receiver.kind = physical disc then
 9093 10004       sz  w0     2.00001     ;      message.receiver
 9094 10006       rl  w3  x3+a50         ;   else message.receiver.main;
 9095 10008       rs. w3     i0.+4       ;
 9096 10010                              ;
 9097 10010       zl  w0  x2+a138+1      ;   if message.state.regrettet then
 9098 10012       sz  w0     2.0001000   ;   goto stop_message;
 9099 10014       jl.        j23.        ;
 9100 10016                              ;
 9101 10016       sz  w0     2.0000110   ;   if message.state = not_transfered then
 9102 10018       jl.        j1.         ;   begin
 9103 10020       al  w3     0           ; 
 9104 10022       rs. w3     i0.+2       ;     param.source := message;
 9105 10024       al  w3     2.0000010   ;
 9106 10026       lo  w3  x2+a138        ;     message.state :=
 9107 10028       hs  w3  x2+a138+1      ;     message.state or during_transfer;
 9108 10030       jl.        j5.         ;   end
 9109 10032  j1:                         ;   else
 9110 10032       so  w0     2.0000010   ;   if message.state = during_transfer then
 9111 10034       jl.        j2.         ;   begin
 9112 10036       al  w3     2           ;     param.source :=
 9113 10038       so  w0     2.0010000   ;     if message.state.com_save then
 9114 10040       al  w3     1           ;        com_save
 9115 10042       rs. w3     i0.+2       ;     else com_area;
 9116 10044       jl.        j5.         ;   end
 9117 10046  j2:                         ;   else
 9118 10046       jl         -1          ;   panic; <* message.state = transfer_complete *>
 9119 10048                              ;
 9120 10048  j5:                         ;
 9121 10048       al. w0     i0.         ;   setup(param, main, message);
 9122 10050       jl. w3     d153.       ;
 9123 10052                              ;   <* from now on use com area: com_mes *>
 9124 10052                              ;
 9125 10052       zl  w3  x1+a570+a150   ;
 9126 10054       ls  w3    -3           ;
 9127 10056       am      x3             ;
 9128 10058       jl.    (   j6.)        ;   goto case com_mes.operation of:
 9129 10060  j6:                         ;
 9130 10060       j15                    ;  0: sense
 9131 10062                 -1           ;  1: -
 9132 10064                 -1           ;  2: -
 9133 10066       j10                    ;  3: input
 9134 10068                 -1           ;  4: -
 9135 10070       j10                    ;  5: output
 9136 10072       j16                    ;  6: format
 9137 10074                 -1           ;  7: -
 9138 10076       j16                    ;  8: position
 9139 10078       j16                    ;  9: extract statistics
 9140 10080       j16                    ; 10: power up spindel
 9141 10082                 -1           ; 11: -
 9142 10084       j16                    ; 12: power down spindel
 9143 10086                 -1           ; 13: -
 9144 10088                 -1           ; 14: -
 9145 10090                 -1           ; 15: -
 9146 10092                 -1           ; 16: -
 9147 10094                 -1           ; 17: -
 9148 10096       j10                    ; 18: security erase
 9149 10098       j10                    ; 19: read data and ecc
 9150 10100                 -1           ; 20: -
 9151 10102       j10                    ; 21: write data and ecc
 9152 10104                 -1           ; 22: -
 9153 10106                 -1           ; 23: -
 9154 10108                 -1           ; 24: -
 9155 10110                 -1           ; 25: -
 9156 10112                 -1           ; 26: -
 9157 10114       j16                    ; 27: read defect list
 9158 10116                 -1           ; 28: -
 9159 10118       j16                    ; 29: write defect list
 9160 10120                              ;
 9161 10120  
 9161 10120  j10:                        ; input:
 9162 10120                              ; output:
 9163 10120                              ; security erase:
 9164 10120                              ; read/write data and ecc:
 9165 10120       zl  w0  x2+a138+1      ; begin
 9166 10122       so  w0     2.0000001   ;   if message.state.io then
 9167 10124       jl.        j11.        ;   begin
 9168 10126       al  w3     0           ;
 9169 10128       rl  w0  x1+a570+a152   ;     com_mes.first_address :=
 9170 10130       ls  w0     1           ;     com_mes.first_address +
 9171 10132       wd  w0     g48         ;     com_mes.no_of_bytes * 2 / 3;
 9172 10134       wa  w0  x1+a570+a151   ;
 9173 10136       rs  w0  x1+a570+a151   ;
 9174 10138                              ;   end;
 9175 10138  j11:                        ;
 9176 10138       rl  w0  x1+a570+a152   ;
 9177 10140       al  w3     0           ;   com_mes.first_segment :=
 9178 10142       wd  w0     b222        ;   com_mes.first_segment +
 9179 10144       wa  w0  x1+a570+a153   ;   com_mes.no_of_bytes / 768;
 9180 10146       rs  w0  x1+a570+a153   ;
 9181 10148                              ;
 9182 10148       rl. w2     i0.+4       ;
 9183 10150       rl  w0  x1+a570+a153   ;   segment_in_track :=
 9184 10152       al  w3     0           ;   com_mes.first_segment modulo
 9185 10154       wd  w0  x2+a75         ;   disk.segments_pr_track;
 9186 10156                              ;
 9187 10156       sh  w3     0           ;   if segment_in_track > 0 then
 9188 10158       jl.        j12.        ;   begin
 9189 10160       ac  w3  x3             ;     rem_in_track := 
 9190 10162       wa  w3  x2+a75         ;     disk.segments_pr_track - segment_in_track;
 9191 10164       sl  w3  (x1+a570+a154) ;     no_of_segments :=
 9192 10166       rl  w3  x1+a570+a154   ;     min(rem_in_track, com_mes.remaining_segments);
 9193 10168       sz                     ;   end
 9194 10170  j12:                        ;   else
 9195 10170       rl  w3  x1+a570+a154   ;     no_of_segments := com_mes.remaining_segments;
 9196 10172                              ;
 9197 10172       sl  w3 (x2+a86)        ;   if no_of_segments > disk.max_transfer then
 9198 10174       rl  w3  x2+a86         ;      no_of_segments :=disk.max_transfer;
 9199 10176                              ;
 9200 10176       ac  w0  x3             ;   com_mes.remaining_segments :=
 9201 10178       wa  w0  x1+a570+a154   ;   com_mes.remaining_segments - no_of_segments;
 9202 10180       rs  w0  x1+a570+a154   ;
 9203 10182                              ;
 9204 10182       al  w0  x3             ;   com_mes.no_of_bytes :=
 9205 10184       wm  w0     b222        ;   no_of_segments * 768;
 9206 10186       rs  w0  x1+a570+a152   ;
 9207 10188                              ;
 9208 10188       rl  w2  x1+a551        ;   message := main.message_buffer;
 9209 10190                              ;
 9210 10190       rl  w0  x1+a570+a154   ;   if com_mes.remaining_segments = 0 then
 9211 10192       se  w0     0           ;   begin
 9212 10194       jl.        j13.        ;     <* not chained (any more) *>
 9213 10196                              ;
 9214 10196       jl  w3     d5          ;     unlink(message);
 9215 10198       rl. w1     i0.+4       ;
 9216 10200       al  w1  x1+a54         ;     link(physical_disk.event_q, message);
 9217 10202       jl  w3     d6          ;
 9218 10204                              ;
 9219 10204       rl. w1     i1.         ;
 9220 10206       ac  w0     2.001000+1  ;     main.com_state := 
 9221 10208       la  w0  x1+a78         ;     main.com_state and not in_chain;
 9222 10210       hs  w0  x1+a78+1       ;
 9223 10212                              ;
 9224 10212       ac  w0     2.0000110+1 ;     message.state :=
 9225 10214       la  w0  x2+a138        ;     message.state and transfer_complete;
 9226 10216       al  w3     2.0000100   ;
 9227 10218       lo  w0     6           ;
 9228 10220       hs  w0  x2+a138+1      ;
 9229 10222       jl.        j14.        ;   end
 9230 10224  j13:                        ;   else
 9231 10224       al  w0     2.001000    ;   begin <* chained *>
 9232 10226       lo  w0  x1+a78         ;
 9233 10228       hs  w0  x1+a78+1       ;     main.com_state := main.com_state and in_chain;
 9234 10230                              ;
 9235 10230       al  w1  x1+a81         ;     if not message in queue then
 9236 10232       sn  w2 (x2+a140)       ;        link(main.wait_q, message);
 9237 10234       jl  w3     d6          ;
 9238 10236                              ;
 9239 10236       rl. w1     i1.         ;
 9240 10238                              ;   end;
 9241 10238  j14:                        ;
 9242 10238       jl.        j20.        ; end <* input, output ..........*>
 9243 10240                              ;
 9244 10240                              ;
 9245 10240  j15:                        ; sense:
 9246 10240       al  w0     8           ; begin
 9247 10242       ls  w0     16          ;   <* convert to position *>
 9248 10244       rs  w0  x1+a570+a150   ;   main.operation, mode := position, 0;
 9249 10246  ;    jl.        j16.        ;   goto position;
 9250 10246                              ; end;
 9251 10246                              ;
 9252 10246  j16:                        ; format:
 9253 10246                              ; position (& sense):
 9254 10246                              ; extract statistics:
 9255 10246                              ; power ud/down spindel
 9256 10246                              ; read/write defect list:
 9257 10246                              ; begin
 9258 10246       jl  w3     d5          ;   
 9259 10248       rl. w1     i0.+4       ;   unlink(message);
 9260 10250       al  w1  x1+a54         ;
 9261 10252       jl  w3     d6          ;   link(physical_disk.event_q, message);
 9262 10254                              ;
 9263 10254       rl. w1     i1.         ;
 9264 10256       ac  w0     2.0000110+1 ;   message.state :=
 9265 10258       la  w0  x2+a138        ;   message.state and transfer_complete;
 9266 10260       al  w3     2.0000100   ;
 9267 10262       lo  w0     6           ;
 9268 10264       hs  w0  x2+a138+1      ;
 9269 10266       jl.        j20.        ; end <* format, position .........*>
 9270 10268                              ;
 9271 10268                              ;
 9272 10268  j20:                        ; <* common part *>
 9273 10268                              ;
 9274 10268  c.l53 b. f2  w.             ; ***** test 8 *****
 9275 10268       rs. w3     f1.         ;
 9276 10270       rs. w1     f0.         ;
 9277 10272       jl. w3     d150.       ;
 9278 10274       8                      ;
 9279 10276  f0:  0                      ; main
 9280 10278  f1:  0                      ;
 9281 10280       jl.        f2.         ;
 9282 10282       al  w0  x2+a138        ; dump message.count, state;
 9283 10284       al  w1  x2+a138        ;
 9284 10286       jl. w3     d151.       ;
 9285 10288  f2:                         ;
 9286 10288  e.z.                        ; ***** end test 8 *****
 9287 10288                              ;
 9288 10288       jl. w3     d144.       ; start_controller(main);
 9289 10290       jl. w3     d152.       ;+0: error: clean_after_buserror(message);
 9290 10292       jl         c99         ;+2: ok: return_from_interrupt;
 9291 10294                              ;
 9292 10294                              ; <* ----------- stop message ----------- *>
 9293 10294  j23:                        ; stop_message:
 9294 10294       rl. w0     i0.+4       ; begin
 9295 10296       jl. w3     d149.       ;   stop_message(physical_disk, main, message);
 9296 10298       am         0           ;+0: during_transfer:
 9297 10300                              ;+2: transfer_complete:
 9298 10300       rl. w0     i0.+4       ;
 9299 10302       jl.        d154.       ;   regret(physical_disk, main, message);
 9300 10304                              ;   <* never reached *>
 9301 10304                              ;
 9302 10304  e.                          ; end <* disk driver part 2 *>
 9303 10304  \f


 9303 10304  
 9303 10304  ; ----------------------------------------------------------------------------
 9304 10304  ;
 9305 10304  ;                         csp-terminal driver,  part 1 
 9306 10304  ;                            ( message received )
 9307 10304  ; 
 9308 10304  ; message sent to a csp-terminal connected through an IFP/DLC device
 9309 10304  ; controller.
 9310 10304  ; 
 9311 10304  ; control is transfered to this part of the csp-terminal driver from the monitor
 9312 10304  ; procedure 'send message' through the intelligent device driver entry
 9313 10304  ; table, part 1.
 9314 10304  ;
 9315 10304  ; in this part of the driver the format of the messages will be changed
 9316 10304  ; slightly. when the messages is transfered to the second part of the
 9317 10304  ; csp-terminal driver, they have the following formats:
 9318 10304  ;
 9319 10304  ;        input or output                 lookup specification
 9320 10304  ;        ---------------                 --------------------
 9321 10304  ;   + 0: operation<12 + mode             2<12 + 0
 9322 10304  ;   + 2: first storage address
 9323 10304  ;   + 4: number of bytes
 9324 10304  ;   + 6: proc flags
 9325 10304  ;   + 8: name of sending process
 9326 10304  ;   +10:        - " -
 9327 10304  ;   +12:        - " -
 9328 10304  ;   +14:        - " -
 9329 10304                        
 9329 10304  ;        set specification               sense
 9330 10304  ;        -----------------               -----------------
 9331 10304  ;   + 0: 4<12 + 0                        0<12 + 0
 9332 10304  ;   + 2: echo<11 + type
 9333 10304  ;   + 4: 0
 9334 10304  ;   + 6: prompt<8
 9335 10304  ;   + 8: 0
 9336 10304  ;   +10: 0
 9337 10304  ;   +12: timer<8
 9338 10304  ;   +14: 0
 9339 10304  ;
 9340 10304  ; at entry the specified message must have been claimed and it may not be
 9341 10304  ; in any queues. the stop count of the sender must not have been increased.
 9342 10304  ; 
 9343 10304  ; at entry the registers contains:
 9344 10304  ;
 9345 10304  ; w0:  -
 9346 10304  ; w1:  receiver
 9347 10304  ; w2:  message
 9348 10304  ; w3:  -
 9349 10304  ;
 9350 10304  
 9350 10304  b. i10, j10  w.
 9351 10304  
 9351 10304  h8:                       ; message received:
 9352 10304  c.l53   b. f2 w.          ; ***** test 25 *****
 9353 10304       rs. w3     f1.       ;
 9354 10306       rs. w1     f0.       ;
 9355 10308       jl. w3     d150.     ;
 9356 10310       25                   ;
 9357 10312  f0:  0                    ; <csp_terminal process>
 9358 10314  f1:  0                    ;
 9359 10316       jl.        f2.       ;
 9360 10318       al  w0  x2+a140      ; <dump message: +0 - +18>
 9361 10320       al  w1  x2+a155      ;
 9362 10322       jl. w3     d151.     ;
 9363 10324  f2:                       ;
 9364 10324  e.z.                      ; ***** end test 25 *****
 9365 10324                            ;
 9366 10324                            ; begin
 9367 10324       rs. w1     i1.       ;
 9368 10326       zl  w0  x2+a138+1    ;   if message.state.io then
 9369 10328       so  w0     2.0000001 ;   begin
 9370 10330       jl.        j4.       ;
 9371 10332                            ; 
 9372 10332       rl. w0     i0.       ;
 9373 10334       jl. w3     d148.     ;     test_legal_operation(operatation_mask, message);
 9374 10336       rl  w3  x2+a142      ;
 9375 10338       zl  w0  x3+a12       ;     increase_stopcount(message.sender);
 9376 10340       ba. w0     1         ;
 9377 10342       hs  w0  x3+a12       ;
 9378 10344                            ;
 9379 10344       rl  w3  x2+a152      ;     message.no_of_bytes:=
 9380 10346       al  w0  x3+2         ;     (last storage address -
 9381 10348       ws  w0  x2+a151      ;     first storage address + 2)/2*3;
 9382 10350       ls  w0     -1        ;
 9383 10352       wm  w0     g48       ;
 9384 10354       rs  w0  x2+a152      ;
 9385 10356       sl  w0 (x1+a86)      ;     if message.no_of_bytes > terminal.max_transfer
 9386 10358       jl.        j8.       ;     then got return_result_3;
 9387 10360                            ;
 9388 10360       rl  w3  x2+a142      ;     <* move sender name to mess_4 - mess_7 *>
 9389 10362       dl  w1  x3+a11+2     ;
 9390 10364       ds  w1  x2+a154+2    ;
 9391 10366       dl  w1  x3+a11+6     ;
 9392 10368       ds  w1  x2+a154+6    ;
 9393 10370       rl. w1     i1.       ;
 9394 10372                            ;
 9395 10372       al  w0     0         ;
 9396 10374       rx  w3  x1+a75       ;     message.proc_mask :=
 9397 10376       se  w3 (x1+a75)      ;     if last_user <> sender then
 9398 10378       al  w0     2.10      ;        changed_user 
 9399 10380       rs  w0  x2+a153      ;     else same_user;
 9400 10382                            ;   end;
 9401 10382  j4:  al  w0     0         ;   force := no;
 9402 10384       jl.        d142.     ;   test_ready_and_setup(force, message);
 9403 10386                            ;
 9404 10386  j8:                       ; return_result_3:
 9405 10386       al  w0     3         ;   message.result := 3;
 9406 10388       al  w3     c99       ;   deliver_answer(message,result);
 9407 10390       jl.        d15.      ;   goto return_from_interrupt;
 9408 10392  
 9408 10392  ; csp_terminal operation mask (legal io operations):
 9409 10392  ;    input    output 
 9410 10392  
 9410 10392  i0:  a0>3    +  a0>5
 9411 10394  i1:  0                    ; save receiver
 9412 10396                            ;
 9413 10396  e.                        ; end;
 9414 10396  \f


 9414 10396  
 9414 10396  ; -------------------------------------------------------------------------
 9415 10396  ;
 9416 10396  ;                        csp-terminal driver, part 2
 9417 10396  ;                            (controller ready)
 9418 10396  ;
 9419 10396  ; this part of the csp-terminal driver is called when the controller is 
 9420 10396  ; ready to receive the message.
 9421 10396  ; the communication area of the controller is initialized in accordance
 9422 10396  ; with the specified message.
 9423 10396  ; when this part of the csp-terminal driver is entered the message has 
 9424 10396  ; the following format:
 9425 10396  ;
 9426 10396  ;
 9427 10396  ;        input or output                 lookup specification
 9428 10396  ;        ---------------                 ---------------------
 9429 10396  ;   + 0: operation<12 + mode             2<12 + 0
 9430 10396  ;   + 2: first storage address
 9431 10396  ;   + 4: number of bytes
 9432 10396  ;   + 6: proc flags
 9433 10396  ;   + 8: name of sending process
 9434 10396  ;   +10:        -- " --
 9435 10396  ;   +12:        -- " --
 9436 10396  ;   +14:        -- " --
 9437 10396  ;
 9438 10396  ;        set specification               sense
 9439 10396  ;        -----------------               -----------------
 9440 10396  ;   + 0: 4<12 + 0                        0<12 + 0
 9441 10396  ;   + 2: echo<11 + type
 9442 10396  ;   + 4: 0
 9443 10396  ;   + 6: prompt<8
 9444 10396  ;   + 8: 0
 9445 10396  ;   +10: 0
 9446 10396  ;   +12: timer<8
 9447 10396  ;   +14: 0
 9448 10396  ;
 9449 10396  ; at entry the specified message may either be linked to the waiting queue
 9450 10396  ; of the specified main process or it may be out of queue.
 9451 10396  ;
 9452 10396  ; at entry the registers contains:
 9453 10396  ;
 9454 10396  ; w0: -
 9455 10396  ; w1: main 
 9456 10396  ; w2: message
 9457 10396  ; w3: -
 9458 10396  ;
 9459 10396  b. i10, j10 w.              ; <* data for terminal *>
 9460 10396  
 9460 10396  i0:  1 < 17                 ; param: function (always device operation)
 9461 10398       0                      ;    +2: source   (always message)
 9462 10400       0                      ;    +4: receiver of operation
 9463 10402  i1:  0                      ; save main
 9464 10404  h9:                         ; csp_terminal driver: setup
 9465 10404  c.l53   b.  f2  w.          ; ***** test 26 *****
 9466 10404       rs. w3     f1.         ;
 9467 10406       rs. w1     f0.         ;
 9468 10408       jl. w3     d150.       ;
 9469 10410       26                     ;
 9470 10412  f0:  0                      ; <main process>
 9471 10414  f1:  0                      ;
 9472 10416       jl.        f2.         ;
 9473 10418       al  w0  x2+a140        ; <dump message: +0 - +18>
 9474 10420       al  w1  x2+a155        ;
 9475 10422       jl. w3     d151.       ;
 9476 10424  f2:                         ;
 9477 10424  e.z.                        ; ***** end test 26 *****
 9478 10424                              ;
 9479 10424                              ; begin
 9480 10424       rl  w3  x2+a141        ;
 9481 10426       ac  w3  x3             ;
 9482 10428       rs. w3     i0.+4       ;   save receiver;
 9483 10430       rs. w1     i1.         ;   save main;
 9484 10432       zl  w0  x2+a138+1      ;   if message.state = stopped then
 9485 10434       sz  w0     2.0001000   ;   goto stop_message;
 9486 10436       jl.        j2.         ;
 9487 10438                              ;
 9488 10438       sz  w0     2.0010110   ;   if message.state <> not_transfered or
 9489 10440       jl        -1           ;      message.state = com_copy then panic;
 9490 10442       al  w3     2.0000100   ;   
 9491 10444       lo  w0     6           ;   message.state :=
 9492 10446       hs  w0  x2+a138+1      ;   message.state or transfer_completet;
 9493 10448                              ;
 9494 10448       al. w0     i0.         ;   
 9495 10450       jl. w3     d153.       ;   setup(param, main, message);
 9496 10452                              ;
 9497 10452       jl  w3     d5          ;   unlink(message);
 9498 10454       rl. w1     i0.+4       ;
 9499 10456       al  w1  x1+a54         ;
 9500 10458       jl  w3     d6          ;   link(message.receiver.event_queue, message);
 9501 10460       rl. w1     i1.         ;
 9502 10462                              ;
 9503 10462  j1:  jl. w3     d144.       ;   start_controller(main);
 9504 10464       jl. w3     d152.       ;+0: error: clean after buserror(message);
 9505 10466       jl         c99         ;+2: ok: goto return from interrupt;
 9506 10468                              ;
 9507 10468                              ;
 9508 10468                              ;
 9509 10468  j2:                         ; stop_message:
 9510 10468       al  w0  x3             ;
 9511 10470       jl. w3     d149.       ;   stop_message(receiver, main, message);
 9512 10472       jl        -1           ;+0: during transfer: not possible
 9513 10474                              ;+2: transfer completed:
 9514 10474       rl. w0     i0.+4       ;
 9515 10476       jl.        d154.       ;   regret(receiver, main, message);
 9516 10478                              ;   <* never reached *>
 9517 10478                              ;
 9518 10478  e.                          ; end;
 9519 10478  \f


 9519 10478  
 9519 10478  ;
 9520 10478  ; ------------------------------------------------------------------------------
 9521 10478  ;
 9522 10478  ;                               printer driver
 9523 10478  ;                     general sequential device driver
 9524 10478  ;                          part_1: message received
 9525 10478  ;
 9526 10478  ; Message send to a general sequential device/printer
 9527 10478  ;
 9528 10478  ; Control is transfered to this part of the driver from the monitor procedure
 9529 10478  ; 'send message' through the device driver entry table, part 1.
 9530 10478  ;
 9531 10478  ; In all operations which involve data transfer to or from the sending process'
 9532 10478  ; core area, the format of the message will be changed slightly in this part
 9533 10478  ; of the driver. When the message is transfered to the second part of the driver,
 9534 10478  ; the field 'last storage address' (message +4) will contain 'no of bytes'.
 9535 10478  ;
 9536 10478  ;      i/o message
 9537 10478  ;      -----------
 9538 10478  ; + 0: operation < 12 + mode
 9539 10478  ; + 2: first storage address
 9540 10478  ; + 4: no of 8-bits bytes
 9541 10478  ;
 9542 10478  ; All other operations will be transfered unchanged.
 9543 10478  ; The legality of the specified operation and mode are not tested.
 9544 10478  ;
 9545 10478  ; At entry the message must have been claimed and it must not be in any queues.
 9546 10478  ; The stopcount of the sender must not have been increased.
 9547 10478  ;
 9548 10478  ; At entry the registers contains:
 9549 10478  ;
 9550 10478  ;  w0 -
 9551 10478  ;  w1  receiver 
 9552 10478  ;  w2  message
 9553 10478  ;  w3  -
 9554 10478  ;
 9555 10478  
 9555 10478  b.  i10, j10  w.
 9556 10478  
 9556 10478  h14:                         ; printer
 9557 10478  h28:                         ; general sequential device
 9558 10478  c.l53 b. f2 w.               ; ***** test 24 *****
 9559 10478       rs. w3     f1.          ;
 9560 10480       rs. w1     f0.          ;
 9561 10482       jl. w3     d150.        ;
 9562 10484       24                      ;
 9563 10486  f0:  0                       ;   receiver 
 9564 10488  f1:  0                       ;
 9565 10490       jl.        f2.          ;
 9566 10492       al  w0  x2+a140         ;   < dump message: 0 - +16 >
 9567 10494       al  w1  x2+a154         ;
 9568 10496       jl. w3     d151.        ;
 9569 10498  f2:                          ;
 9570 10498  e.z.                         ; ***** end test 24 *****
 9571 10498                               ; begin
 9572 10498       zl  w3  x2+a138+1       ;   if message.operation = i/o then
 9573 10500       so  w3     2.0000001    ;   begin
 9574 10502       jl.        j1.          ;
 9575 10504                               ;
 9576 10504       rl  w3  x2+a152         ;     message.no of bytes :=
 9577 10506       al  w0  x3+2            ;     (last address - first address + 2) / 2 * 3;
 9578 10508       ws  w0  x2+a151         ;
 9579 10510       ls  w0    -1            ;
 9580 10512       wm  w0     g48          ;
 9581 10514       rs  w0  x2+a152         ;
 9582 10516       sl  w0 (x1+a86)         ;     if message.no_of_bytes>receiver.max_transfer
 9583 10518       jl.        j8.          ;     then goto return_result_3;
 9584 10520                               ;
 9585 10520       rl  w3  x2+a142         ;     message.sender.stopcount :=
 9586 10522       zl  w0  x3+a12          ;     message.sender.stopcount + 1;
 9587 10524       ba. w0     1            ;
 9588 10526       hs  w0  x3+a12          ;
 9589 10528  ;    jl.        j2.          ;   end
 9590 10528  j1:                          ;   else
 9591 10528                               ;   begin
 9592 10528                               ;     <other operations - do nothing>
 9593 10528                               ;   end;
 9594 10528  j2:                          ;
 9595 10528       al  w0     0            ;   force := no;
 9596 10530       jl.        d142.        ;   test_ready_and_setup(force, message); 
 9597 10532                               ;
 9598 10532  j8:                          ; return_result_3:
 9599 10532       al  w0     3            ; 
 9600 10534       al  w3     c99          ;   deliver_answer(message,result);
 9601 10536       jl.        d15.         ;   goto return_from_interrupt;
 9602 10538  e.                           ; end *** gsd/printer part_1 ***
 9603 10538  \f


 9603 10538  
 9603 10538  ;
 9604 10538  ;
 9605 10538  ; ------------------------------------------------------------------------
 9606 10538  ;
 9607 10538  ;                    magnetic tape driver, part 1
 9608 10538  ;                         (message received)
 9609 10538  ;
 9610 10538  ; message send to a magnetic tape which is mounted on a tape station con-
 9611 10538  ; nected through an ioc device controller.
 9612 10538  ;
 9613 10538  ; it is only possible to receive a message when the document state of the
 9614 10538  ; tape station is 'identified document mounted'. this is the only state
 9615 10538  ; in which the process has a name.
 9616 10538  ;
 9617 10538  ; control is transfered to this part of the magnetic tape driver from the
 9618 10538  ; monitor procedure 'send message' through the "intelligent" device driver
 9619 10538  ; entry table, part 1.
 9620 10538  ;
 9621 10538  ; in all operations which involve data transfer the format of the message
 9622 10538  ; will be changed slightly in this part of the driver. when the message is
 9623 10538  ; transfered to the second part of the magnetic tape driver the field
 9624 10538  ; 'last storage address' (message +4) will contain 'no of bytes':
 9625 10538  ;
 9626 10538  ;      i/o messages
 9627 10538  ;      ------------
 9628 10538  ; + 0: operation<12 + mode
 9629 10538  ; + 2: first storage address
 9630 10538  ; + 4: no of bytes
 9631 10538  ; + 6:
 9632 10538  ;
 9633 10538  ;
 9634 10538  ; for all other operations, the message will be transfered unchanged.
 9635 10538  ;
 9636 10538  ; at entry the message must have been claimed and it must not be in any
 9637 10538  ; queues. the stop count of the sender must not have been increased.
 9638 10538  ;
 9639 10538  ; at entry the registers contains:
 9640 10538  ;
 9641 10538  ; w0  -
 9642 10538  ; w1  receiver (magnetic tape process description)
 9643 10538  ; w2  message
 9644 10538  ; w3  -
 9645 10538  ;
 9646 10538  
 9646 10538  b.  i10, j10  w.
 9647 10538  
 9647 10538  h18:                        ; message received
 9648 10538  c.l53   b.  f2  w.          ; ***** test 11 *****
 9649 10538       rs. w3     f1.         ;
 9650 10540       rs. w1     f0.         ;
 9651 10542       jl. w3     d150.       ;
 9652 10544       11                     ;
 9653 10546  f0:  0                      ; < mag tape process >
 9654 10548  f1:  0                      ;
 9655 10550       jl.        f2.         ;
 9656 10552       al  w0  x2+a140        ; < dump message: +0 - +14 >
 9657 10554       al  w1  x2+a153        ;
 9658 10556       jl. w3     d151.       ;
 9659 10558  f2:                         ;
 9660 10558  e.z.                        ; ***** end test 11 *****
 9661 10558                              ;
 9662 10558                              ; begin
 9663 10558       rl. w0     i2.         ; 
 9664 10560       jl. w3     d148.       ;   test legal operation(message, operation mask);
 9665 10562                              ;
 9666 10562       zl  w0  x2+a138+1      ;
 9667 10564       so  w0     2.0000001   ;
 9668 10566       jl.        j2.         ;   if message.state.io then
 9669 10568                              ;   begin <* input, output, extract statistics, extended sense *>
 9670 10568       rl  w3  x2+a152        ;
 9671 10570       al  w0  x3+2           ;     message.no of bytes :=
 9672 10572       ws  w0  x2+a151        ;     (last address - first address + 2)/2*3;
 9673 10574       ls  w0    -1           ;
 9674 10576       wm  w0     g48         ;
 9675 10578       rs  w0  x2+a152        ;
 9676 10580       zl  w3  x2+a150        ;     if message.operation = output then
 9677 10582       se  w3     5           ;     begin
 9678 10584       jl.        j1.         ;
 9679 10586       zl  w3  x2+a150+1      ;       message.no of bytes :=
 9680 10588       ls  w3    -4           ;       message.no of bytes - message.mode.trail;
 9681 10590       la. w3     i0.         ;
 9682 10592       ac  w3  x3             ;
 9683 10594       wa  w3  x2+a152        ;
 9684 10596       rs  w3  x2+a152        ;     end;
 9685 10598  j1:                         ;
 9686 10598       rl  w3  x2+a152        ;     if message.no of bytes < 3 or
 9687 10600       sl  w3     3           ;        message.no of bytes > receiver.max_transfer then
 9688 10602       sl  w3 (x1+a86)        ;        return result('unintelligible');
 9689 10604       jl.        j4.         ;
 9690 10606       rl  w3  x2+a142        ;
 9691 10608       zl  w0  x3+a12         ;     increase stopcount(message.sender);
 9692 10610       ba. w0     1           ;
 9693 10612       hs  w0  x3+a12         ;
 9694 10614  ;    jl.        j3.         ;   end
 9695 10614  j2:                         ;   else 
 9696 10614                              ;   begin
 9697 10614                              ;     <* other operations - do nothing *>
 9698 10614                              ;   end;
 9699 10614                              ;
 9700 10614  j3:  al  w0     0           ;   force := no;
 9701 10616       jl.        d142.       ;   test_ready_and_setup(force, message);
 9702 10618                              ;
 9703 10618  j4:                         ; return result:
 9704 10618       al  w0     3           ;
 9705 10620       al  w3     c99         ;
 9706 10622       jl.        d15.        ;   deliver_answer(message,result); goto return_from_interrupt;
 9707 10624                              ;
 9708 10624                              ;
 9709 10624  i0:  2.111                  ;   mask for trail
 9710 10626                              ;
 9711 10626  ; magnetic tape operation mask (legal operations):
 9712 10626  ; sense, input, output, erase, move, extract statistics, output file mark,
 9713 10626  ; check mode, security erase:
 9714 10626  
 9714 10626  i2: a0>0 + a0>3 + a0>5 + a0>6 + a0>8 + a0>9 + a0>10 + a0>14 + a0>18
 9715 10628  
 9715 10628  e.                     ; end;
 9716 10628  \f


 9716 10628  
 9716 10628  ;
 9717 10628  ;
 9718 10628  ; ------------------------------------------------------------------------
 9719 10628  ; 
 9720 10628  ;                           printer driver
 9721 10628  ;
 9722 10628  ;                        magnetic tape driver
 9723 10628  ;
 9724 10628  ;                 general sequential device driver           
 9725 10628  ;
 9726 10628  ;                    part_2: controller ready
 9727 10628  ;
 9728 10628  ; this part of the magnetic tape/gsd driver is called when the controller
 9729 10628  ; is ready to receive the message.
 9730 10628  ; in this part of the driver, the communication area of the controller
 9731 10628  ; is initialized in accordance with the specified message.
 9732 10628  ;
 9733 10628  ; the message will be linked to the event queue of the receiver.
 9734 10628  ;
 9735 10628  ; the message will be delivered unchanged to the controller.
 9736 10628  ;
 9737 10628  ; at entry the specified message may either be in the waiting queue of
 9738 10628  ; the specified main process or it may be 'free'.
 9739 10628  ;
 9740 10628  ; at entry the registers contains:
 9741 10628  ;
 9742 10628  ; w0  -
 9743 10628  ; w1  main process
 9744 10628  ; w2  message
 9745 10628  ; w3  -
 9746 10628  ;
 9747 10628  
 9747 10628  b. i10, j10  w.             ; - - - data - - - 
 9748 10628                              ;
 9749 10628  i0:  1 < 17                 ; param: function (always device operation)
 9750 10630       0                      ;    +2: source   (always message)
 9751 10632       0                      ;    +4: receiver of operation
 9752 10634                              ;
 9753 10634  i1:  0                      ; save main;
 9754 10636  h15:                        ; printer driver: setup
 9755 10636  h19:                        ; magnetic tape driver: setup
 9756 10636  h29:                        ; general sequential device driver: setup 
 9757 10636  c.l53   b.  f2  w.          ; ***** test 12 *****
 9758 10636       rs. w3     f1.         ;
 9759 10638       rs. w1     f0.         ;
 9760 10640       jl. w3     d150.       ;
 9761 10642       12                     ;
 9762 10644  f0:  0                      ; < main process >
 9763 10646  f1:  0                      ;
 9764 10648       jl.        f2.         ;
 9765 10650       al  w0  x2+a138        ; < dump message: -4 - +14 >
 9766 10652       al  w1  x2+a153        ;
 9767 10654       jl. w3     d151.       ;
 9768 10656  f2:                         ;
 9769 10656  e.z.                        ; ***** end test 12 *****
 9770 10656                              ;
 9771 10656                              ; begin
 9772 10656       rl  w3  x2+a141        ;
 9773 10658       ac  w3  x3             ;
 9774 10660       rs. w3     i0.+4       ;   save receiver;
 9775 10662       rs. w1     i1.         ;   save main;
 9776 10664       zl  w0  x2+a138+1      ;   if message.state = stopped then
 9777 10666       sz  w0     2.0001000   ;   goto stop_message;
 9778 10668       jl.        j2.         ;
 9779 10670                              ;
 9780 10670       sz  w0     2.0010110   ;   if message.state <> not_transfered or
 9781 10672       jl        -1           ;      message.state = com_copy then panic;
 9782 10674       al  w3     2.0000100   ;   
 9783 10676       lo  w0     6           ;   message.state :=
 9784 10678       hs  w0  x2+a138+1      ;   message.state or transfer_completet;
 9785 10680                              ;
 9786 10680       al. w0     i0.         ;   
 9787 10682       jl. w3     d153.       ;   setup(param, main, message);
 9788 10684                              ;
 9789 10684       jl  w3     d5          ;   unlink(message);
 9790 10686       rl. w1     i0.+4       ;
 9791 10688       al  w1  x1+a54         ;
 9792 10690       jl  w3     d6          ;   link(message.receiver.event_queue, message);
 9793 10692       rl. w1     i1.         ;
 9794 10694                              ;
 9795 10694  c.l53   b.  f2  w.          ; ***** test 13 *****
 9796 10694       rs. w3     f1.         ;
 9797 10696       rs. w1     f0.         ;
 9798 10698       jl. w3     d150.       ;
 9799 10700       13                     ;
 9800 10702  f0:  0                      ; < main process >
 9801 10704  f1:  0                      ;
 9802 10706       jl.        f2.         ;
 9803 10708       al  w0  x2+a138        ; < dump message.count,state >
 9804 10710       al  w1  x2+a138        ;
 9805 10712       jl. w3     d151.       ;
 9806 10714  f2:                         ;
 9807 10714  e.z.                        ; ***** end test 13 *****
 9808 10714                              ;
 9809 10714                              ;
 9810 10714  j1:  jl. w3     d144.       ;   start_controller(main);
 9811 10716       jl. w3     d152.       ;+0: error: clean after buserror(message);
 9812 10718       jl         c99         ;+2: ok: goto return from interrupt;
 9813 10720                              ;
 9814 10720                              ;
 9815 10720                              ;
 9816 10720  j2:                         ; stop_message:
 9817 10720       al  w0  x3             ;
 9818 10722       jl. w3     d149.       ;   stop_message(receiver, main, message);
 9819 10724       jl        -1           ;+0: during transfer: not possible
 9820 10726                              ;+2: transfer completed:
 9821 10726       rl. w0     i0.+4       ;
 9822 10728       jl.        d154.       ;   regret(receiver, main, message);
 9823 10730                              ;   <* never reached *>
 9824 10730                              ;
 9825 10730  e.                          ; end;
 9826 10730  
 9826 10730  
 9826 10730  ; ****** stepping stones ******
 9827 10730  ;
 9828 10730  
 9828 10730       jl.  ( +2),  d141 ,  d141 = k - 4
 9829 10734       jl.  ( +2),  d142 ,  d142 = k - 4
 9830 10738       jl.  ( +2),  d143 ,  d143 = k - 4
 9831 10742       jl.  ( +2),  d144 ,  d144 = k - 4
 9832 10746       jl.  ( +2),  d145 ,  d145 = k - 4
 9833 10750       jl.  ( +2),  d146 ,  d146 = k - 4
 9834 10754       jl.  ( +2),  d147 ,  d147 = k - 4
 9835 10758       jl.  ( +2),  d148 ,  d148 = k - 4
 9836 10762       jl.  ( +2),  d149 ,  d149 = k - 4
 9837 10766       jl.  ( +2),  d150 ,  d150 = k - 4
 9838 10770       jl.  ( +2),  d151 ,  d151 = k - 4
 9839 10774       jl.  ( +2),  d152 ,  d152 = k - 4
 9840 10778       jl.  ( +2),  d153 ,  d153 = k - 4
 9841 10782       jl.  ( +2),  d154 ,  d154 = k - 4
 9842 10786       jl.  ( +2),  d155 ,  d155 = k - 4
 9843 10790       jl.  ( +2),  d156 ,  d156 = k - 4
 9844 10794  
 9844 10794  \f


 9844 10794  
 9844 10794  ;
 9845 10794  ;
 9846 10794  ; ------------------------------------------------------------------------
 9847 10794  ;
 9848 10794  ;                    ioc main process driver, part 2
 9849 10794  ;
 9850 10794  ;                    dlc main process driver, part 2
 9851 10794  ;
 9852 10794  ;                           (controller ready)
 9853 10794  ;
 9854 10794  ; this part of the ioc/dlc main process driver is called when the control-
 9855 10794  ; ler is ready to receive the message.
 9856 10794  ; the first part of the main process driver is implemented as a part
 9857 10794  ; of the common driver process (driverproc), and the control is transfered
 9858 10794  ; to this part of the driver through the monitor procedure 'start con-
 9859 10794  ; troller'.
 9860 10794  ;
 9861 10794  ; when this part of the driver is entered the format of the messages must
 9862 10794  ; be as follows:
 9863 10794  ;
 9864 10794  ; if the operation is 'create link' or 'remove link' the format must be:
 9865 10794  ;
 9866 10794  ;        create link (IOC):              create link (DLC):
 9867 10794  ;        -------------------------       -------------------------
 9868 10794  ;   + 0: 6<12 + mode                     6<12 + mode
 9869 10794  ;   + 2: control module/formatter        device type
 9870 10794  ;   + 4: slave device/station no         controller index/255
 9871 10794  ;   + 6: rc8000 process address (*)      rc8000 process address (*)
 9872 10794  ;   + 8: device kind, device type        controller name
 9873 10794  ;   +10:                                      - " -
 9874 10794  ;   +12:                                      - " -
 9875 10794  ;   +14:                                      - " -
 9876 10794  ;
 9877 10794  ;        remove link (IOC/DLC):
 9878 10794  ;        -------------------------
 9879 10794  ;   + 0: 10<12 + 0
 9880 10794  ;   + 2: rc8000 process address  (*)
 9881 10794  ;   + 4: controller device index (*)
 9882 10794  ;
 9883 10794  ; if the operation are answer create link/remove link request/attention the
 9884 10794  ; format of the message must be (local message, sender is driverproc):
 9885 10794  ;
 9886 10794  ;                                              answer attention
 9887 10794  ;          answer create link                  answer remove link request
 9888 10794  ;          -----------------------------       --------------------------
 9889 10794  ;   + 0:   -1<12+0                             att: -3<12 remove: -2<12 + 0
 9890 10794  ;   + 2:   detailed_status, status (param_0)   result     (param_0)
 9891 10794  ;   + 4:   external process        (param_1)   subproc    (param_1)
 9892 10794  ;   + 6:   controller device index (param_2)   DLCindex   (param_2)
 9893 10794  ;+8-+14:   name of reserver (if detailed       
 9894 10794  ;                            result = 1)      
 9895 10794  ;
 9896 10794  ;
 9897 10794  ; if the operation is 'prepare dump' then the format must be:
 9898 10794  ;
 9899 10794  ;        (entry part 2 format)               (controller format)
 9900 10794  ;        prepare dump:                       prepare dump:
 9901 10794  ;        ---------------------               --------------------
 9902 10794  ;   + 0: 2<12 + 0                            2<16 + 0
 9903 10794  ;   + 2: first address (low core)            first address
 9904 10794  ;   + 4: 0 (no of bytes)  (*)                no of bytes
 9905 10794  ;   + 6: first segm (area:log, disk:phys)    segment
 9906 10794  ;   + 8: no of segments (*)
 9907 10794  ;   +10: 0 (area: next logical segment)
 9908 10794  ;   +12: first address (high core) (*)
 9909 10794  ;   +14: no of segments (in high core) (*)
 9910 10794  ;
 9911 10794  ; the fields marked '(*)' must be set in the first part of the main
 9912 10794  ; process driver (they are not (always) user defined).
 9913 10794  ;
 9914 10794  ; all other operations must be received unchanged.
 9915 10794  ;
 9916 10794  ; in case of a prepare dump operation it may in certain cases be delivered
 9917 10794  ; to the controller as two or more chained operations. this depends on the
 9918 10794  ; physical locations of the specified segments.
 9919 10794  ;
 9920 10794  ; at entry the message must have been claimed and the stopcount of the sender
 9921 10794  ; must have been increased if nessesary.
 9922 10794  ;
 9923 10794  ; at entry the registers contains:
 9924 10794  ;
 9925 10794  ; w0  -
 9926 10794  ; w1  main process
 9927 10794  ; w2  message
 9928 10794  ; w3  -
 9929 10794  ;
 9930 10794  
 9930 10794  b. i10, j15, o40   w.
 9931 10794                            ; ========== DATA ==========
 9932 10794                            ;
 9933 10794  i0:  0                    ; param + 0: function
 9934 10796       0                    ;       + 2: source
 9935 10798       0                    ;       + 4: receiver (main)
 9936 10800  i1:  0                    ; save w1: main
 9937 10802  i2:  0                    ; save w2: message
 9938 10804                            ;
 9939 10804  h.                        ; function, operation tabel:
 9940 10804                            ;--------------------------
 9941 10804       12<5                 ; -4 : stop normal communucation(rc8000 only)
 9942 10805       4<5   + 1<4          ; -3 : answer attention
 9943 10806       8<5   + 1<4          ; -2 : answer remove link request
 9944 10807       2<5   + 1<4          ; -1 : answer create link
 9945 10808  i4:  10<5                 ;  0 : sense
 9946 10809       0                    ;  1 : -
 9947 10810      10<5                  ;  2 : prepare dump
 9948 10811      10<5                  ;  3 : input RC8000 specific
 9949 10812      11<5                  ;  4 : soft reset rc8000 specific
 9950 10813      10<5                  ;  5 : output RC8000 specific
 9951 10814       2<5                  ;  6 : create link
 9952 10815       0                    ;  7 : -
 9953 10816      10<5                  ;  8 : position RC8000 specific
 9954 10817       0                    ;  9 : - (extract statistics - part 1 only)
 9955 10818       3<5                  ; 10 : remove link
 9956 10819       0                    ; 11 : -
 9957 10820       0                    ; 12 : - (set mask - part 1 only)
 9958 10821       0                    ; 13 : -
 9959 10822      10<5                  ; 14 : dump
 9960 10823       0                    ; 15 : -
 9961 10824       0                    ; 16 : - (link logical disk - part 1 only)
 9962 10825       0                    ; 17 : -
 9963 10826       0                    ; 18 : - (unlink logical disk - part 1 only)
 9964 10827       0                    ; 19 : -
 9965 10828      10<5                  ; 20 : test
 9966 10829       0                    ; 21 : -
 9967 10830       9<5                  ; 22 : initialize controller
 9968 10831                            ; =========== end DATA ============
 9969 10831  
 9969 10831  w.
 9970 10832  h21:                      ; ioc main process driver: setup
 9971 10832  h27:                      ; dlc main process driver: setup
 9972 10832  c.l53   b.  f2  w.        ; ***** test 16 *****
 9973 10832       rs. w3     f1.       ;
 9974 10834       rs. w1     f0.       ;
 9975 10836       jl. w3     d150.     ;
 9976 10838       16                   ;
 9977 10840  f0:  0                    ; < main process >
 9978 10842  f1:  0                    ; 
 9979 10844       jl.        f2.       ;
 9980 10846       al  w0  x2+a138      ; < dump message: -4 - +22 >
 9981 10848       al  w1  x2+a157      ;
 9982 10850       jl. w3     d151.     ;
 9983 10852  f2:                       ;
 9984 10852  e.z.                      ; ***** end test 16 *****
 9985 10852  
 9985 10852       ds. w2     i2.       ;
 9986 10854       zl  w0  x2+a138+1    ;   if message.state = stopped then
 9987 10856       sz  w0     2.0001000 ;      goto stop_message;
 9988 10858       jl.        o27.      ;
 9989 10860                            ;
 9990 10860       sz  w0     2.0000110 ;   if message.state = not_transfered then
 9991 10862       jl.        j1.       ;   begin
 9992 10864       al  w3     0         ;
 9993 10866       rs. w3     i0.+2     ;     param.source   := message;
 9994 10868       rs. w1     i0.+4     ;     param.receiver := main;
 9995 10870                            ;     <* might be changed later on dependent on oper*>
 9996 10870       el  w3  x2+a150      ;
 9997 10872       zl. w0  x3+i4.       ;     param.function :=
 9998 10874       hs. w0     i0.+0     ;     function_table(message.operation);
 9999 10876                            ;
10000 10876       al  w3     2.0000010 ;     
10001 10878       lo  w3  x2+a138      ;     message.state := message.state or
10002 10880       hs  w3  x2+a138+1    ;                      during_transfer ;
10003 10882                            ;
10004 10882       jl.        j2.       ;   end
10005 10884  j1:                       ;   else
10006 10884       so  w0     2.0000010 ;   if message.state = during_transfer then
10007 10886       jl.       -1         ;   begin
10008 10888                            ;
10009 10888       al  w3     2         ;     param.source   := 
10010 10890       so  w0     2.0010000 ;     if message.state.com_save then
10011 10892       al  w3     1         ;          com_save
10012 10894       rs. w3     i0.+2     ;     else com_area;
10013 10896                            ;   end
10014 10896                            ;   else panic; <* message.state=transfer complete *>
10015 10896  j2:                       ;
10016 10896       al. w0     i0.       ;
10017 10898       jl. w3     d153.     ;   setup(param, main, message);
10018 10900                            ;
10019 10900                            ;   <* from now on use main.com_area: com_mes *>
10020 10900                            ;
10021 10900       el  w3  x1+a570+a150 ;
10022 10902       as  w3    -3         ;   goto case com_mes.operation of:
10023 10904       jl.    (x3+j3.)      ;
10024 10906                            ;
10025 10906       o34                  ; -4 : stop normal communication (rc8000 only)
10026 10908       o33                  ; -3 : answer attention
10027 10910       o32                  ; -2 : answer remove link request
10028 10912       o31                  ; -1 : answer create link
10029 10914  j3:   o0                  ;  0 : sense
10030 10916               -1           ;  1 : -
10031 10918       o2                   ;  2 : prepare dump
10032 10920       o3                   ;  3 : input: RC8000 specific
10033 10922       o4                   ;  4 : soft reset: rc8000 specific
10034 10924       o5                   ;  5 : output: RC8000 specific
10035 10926       o6                   ;  6 : create link
10036 10928               -1           ;  7 : -
10037 10930       o8                   ;  8 : position: RC8000 specific
10038 10932               -1           ;  9 : - (extract statistics)
10039 10934       o10                  ; 10 : remove link
10040 10936               -1           ; 11 : -
10041 10938               -1           ; 12 : -
10042 10940               -1           ; 13 : -
10043 10942       o14                  ; 14 : dump
10044 10944               -1           ; 15 : -
10045 10946               -1           ; 16 : - (link logical disk)
10046 10948               -1           ; 17 : - 
10047 10950               -1           ; 18 : - (unlink logical disk)
10048 10952               -1           ; 19 : -
10049 10954       o20                  ; 20 : test
10050 10956               -1           ; 21 : -
10051 10958       o22                  ; 22 : initialize controller
10052 10960                            ;
10053 10960  
10053 10960                            ;
10054 10960                            ;
10055 10960  o2:                       ; prepare dump:
10056 10960                            ; ---------------
10057 10960  b.  j5  w.                ; begin 
10058 10960       rl  w0  x1+a570+a154 ;
10059 10962       se  w0     0         ;   if com_mes.no_of_segments = 0 then
10060 10964       jl.        j1.       ;   begin
10061 10966       rs  w0  x1+a570+a152 ;     com_mes.no_of_bytes := 0;
10062 10968       dl  w0  x1+a570+a157 ;     com_mes.first_addr := com_mes.save_first_addr;
10063 10970       rs  w3  x1+a570+a151 ;     com_mes.no_of_segments :=
10064 10972       rs  w0  x1+a570+a154 ;     com_mes.save_no_of_segments;
10065 10974       al  w0     0         ;
10066 10976       rs  w0  x1+a570+a156 ;     com_mes.save_first_addr := 0;
10067 10978       rs  w0  x1+a570+a157 ;     com_mes.save_no_of_segments := 0;
10068 10980                            ;   end;
10069 10980  j1:                       ;
10070 10980       al  w3     0         ;
10071 10982       rl  w0  x1+a570+a152 ;   com_mes.first_address := 
10072 10984       ls  w0    +1         ;   com_mes.first_address + com_mes.no_of_bytes * 2/3;
10073 10986       wd  w0     g48       ;
10074 10988       wa  w0  x1+a570+a151 ;
10075 10990       rs  w0  x1+a570+a151 ;
10076 10992                            ;
10077 10992       rl  w3  x1+a201      ;   if main.dump_device.kind = area then
10078 10994       rl  w3  x3+a10       ;   begin
10079 10996       se  w3     q4        ;
10080 10998       jl.        j2.       ;
10081 11000       rl  w0  x1+a570+a155 ;
10082 11002       al  w2  x1+a570      ;     <* address of message structure in main.com *>
10083 11004       rl  w1  x1+a201      ;
10084 11006       jl. w3     d143.     ;     prepare_consecutive_transfer(nest_logical_segment,
10085 11008                            ;           area, com_mes);
10086 11008       rl. w1     i1.       ;     com_mes.next_logical_segment :=
10087 11010       rs  w0  x1+a570+a155 ;     next_logical_segment;
10088 11012       jl.        j3.       ;   end
10089 11014  j2:                       ;   else
10090 11014       rl  w0  x1+a570+a152 ;   begin
10091 11016       al  w3     0         ;     com_mes.first_segment :=
10092 11018       wd  w0     b222      ;     com_mes.first_segment +
10093 11020       wa  w0  x1+a570+a153 ;     com_mes.no_of_bytes / 768;
10094 11022       rs  w0  x1+a570+a153 ;
10095 11024                            ;
10096 11024       rl  w2  x1+a201      ;     no_of_segments := com_mes.remaining_segments;
10097 11026       rl  w3  x1+a570+a154 ;     if no_of_segments > disk.max_transfer then
10098 11028       sl  w3 (x2+a86)      ;        no_of_segments := disk.max_transfer;
10099 11030       rl  w3  x2+a86       ;
10100 11032                            ;
10101 11032       ac  w0  x3           ;     com_mes.remaining_segments :=
10102 11034       wa  w0  x1+a570+a154 ;     com_mes.remaining_segments -
10103 11036       rs  w0  x1+a570+a154 ;     no_of_segments;
10104 11038       al  w0  x3           ;
10105 11040       wm  w0     b222      ;     com_mes.no_of_bytes :=
10106 11042       rs  w0  x1+a570+a152 ;     no_of_segments * 768;
10107 11044                            ;
10108 11044       rl  w3  x1+a570+a154 ;
10109 11046                            ;   end;
10110 11046  j3:                       ;
10111 11046       wa  w3  x1+a570+a157 ;   if com_mes.remaining_segments = 0 and
10112 11048       se  w3     0         ;      com_mes.save_remaining_segments = 0 then
10113 11050       jl.        j4.       ;   begin
10114 11052       rl. w2     i2.       ;
10115 11054       jl  w3     d5        ;     unlink(message);
10116 11056       al  w1  x1+a54       ;
10117 11058       jl  w3     d6        ;     link(main.event_q, message);
10118 11060                            ;
10119 11060       rl. w1     i1.       ;
10120 11062       ac  w0     2.0001000+1;    main.com_state := 
10121 11064       la  w0  x1+a78       ;     main.com_state and not in_chain;
10122 11066       hs  w0  x1+a78+1     ;
10123 11068       ac  w0     2.0000110+1;
10124 11070       la  w0  x2+a138      ;     message.state :=
10125 11072       al  w3     2.0000100 ;     message.state and transfer_complete;
10126 11074       lo  w0     6         ;
10127 11076       hs  w0  x2+a138+1    ;
10128 11078       jl.        j5.       ;   end
10129 11080  j4:                       ;   else
10130 11080       al  w1  x1+a81       ;   begin
10131 11082       rl. w2     i2.       ;
10132 11084       sn  w2 (x2+a140)     ;     if not message.in_q then
10133 11086       jl  w3     d6        ;        link(main.waiting_q, message);
10134 11088                            ;
10135 11088       rl. w1     i1.       ;
10136 11090       al  w0     2.001000  ;     main.com_state :=
10137 11092       lo  w0  x1+a78       ;     main.com_state or in_chain;
10138 11094       hs  w0  x1+a78+1     ;
10139 11096                            ;   end;
10140 11096  j5:                       ;
10141 11096       rl  w3  x1+a201      ;   dump_dev :=
10142 11098       rl  w2  x3+a10       ;   if main.dump_device.kind = disk then
10143 11100       se  w2     q6        ;      main.dump_device 
10144 11102       rl  w3  x3+a50       ;   else
10145 11104                            ;      main.dump_device.main;
10146 11104       dl  w0  x3+a77       ;   main.device_id := dump_dev.device_id;
10147 11106       ds  w0  x1+a553      ;   main.proc_id := dump_dev.proc_id;
10148 11108                            ;
10149 11108       jl.        o26.      ;   goto no message; <* message has been linked *>
10150 11110                            ;
10151 11110  e.                        ; end; <* prepare dump *>
10152 11110  
10152 11110  o4:                       ; reset:
10153 11110                            ; ---------------------------------------
10154 11110  b.  j5  w.                ; begin
10155 11110                            ;
10156 11110       jl  w3     d5        ;   unlink(message);
10157 11112       al  w1  x1+a54       ;
10158 11114       jl  w3     d6        ;   link(main.event_q, message);
10159 11116       ac  w0   2.0000110+1 ;
10160 11118       la  w0  x2+a138      ;   messge.state :=
10161 11120       al  w3   2.0000100   ;   message.state or transfer_complete;
10162 11122       lo  w0     6         ;
10163 11124       hs  w0  x2+a138+1    ;
10164 11126       al  w1  x1-a54       ;
10165 11128                            ;
10166 11128       rl  w0  x1+a10       ;   if main.kind <> ifp_main then
10167 11130       se  w0     q26       ;      panic;
10168 11132       jl        -1         ;
10169 11134                            ;
10170 11134       jl. w3     d155.     ;      increase no_of_outstanding(main) 
10171 11136       al  w0     3         ;
10172 11138       rl  w3  x1+a235      ;
10173 11140       rs  w3     b58       ;   <* save device address in monitor table *>
10174 11142       do  w0  x3+0         ;   reset_controller(soft);
10175 11144       sx         2.111     ;   if no exception then
10176 11146       jl.        j1.       ;   begin
10177 11148       la  w3     b212      ;     <* clear bit 0 of device address *>
10178 11150       wa  w3     b65       ;     <* clear any pending interrupt *>
10179 11152       rl  w0  x3+a313      ;
10180 11154       gp  w0     b95       ;
10181 11156                            ;     <* forget about credit-counting *>
10182 11156       jl         c99       ;     goto return_from_interrupt;
10183 11158                            ;   end
10184 11158  j1:                       ;   else begin
10185 11158       rl. w2     i2.       ;
10186 11160       jl. w3     d152.     ;     clear_after_buserror(message);
10187 11162       jl         c99       ;     goto return_from_interrupt;
10188 11164                            ;   end;
10189 11164  e.                        ; end;
10190 11164  
10190 11164                            ;
10191 11164  o6:                       ; create link:
10192 11164                            ; ---------------
10193 11164  b.  j5  w.                ; begin
10194 11164       rl  w0  x1+a570+a153 ;
10195 11166       rs  w0  x1+a553      ;   main.proc_id := com_mes.proc_id;
10196 11168       jl.        o25.      ;   goto common_part;
10197 11170  e.                        ; end;
10198 11170                            ;
10199 11170                            ;
10200 11170  o10:                      ; remove_link:
10201 11170                            ; ---------------
10202 11170       rl  w0  x1+a570+a152 ; begin
10203 11172       rs  w0  x1+a552      ;   main.controller_id := com_mes.controller_id;
10204 11174       rl  w0  x1+a570+a151 ;
10205 11176       rs  w0  x1+a553      ;   main.proc_id := com_mes.proc_id;
10206 11178                            ;
10207 11178       jl.        o25.      ;   goto common_part;
10208 11180                            ; end;
10209 11180                            ;
10210 11180  o14:                      ; dump
10211 11180                            ; ---------------
10212 11180  b.   i5, j5  w.           ; begin
10213 11180                            ;
10214 11180       zl  w0  x1+a78+1     ;
10215 11182       so  w0     2.001000  ;   if main.com_state = in_chain then
10216 11184       jl.        j1.       ;   begin
10217 11186       rl  w3  x1+a551      ;
10218 11188       al  w0     2.0010000 ;     main.message.state :=
10219 11190       lo  w0  x3+a138      ;     main.message.state or com_save;
10220 11192       hs  w0  x3+a138+1    ;
10221 11194                            ;
10222 11194       ac  w0     2.001000+1;     main.com_state :=
10223 11196       la  w0  x1+a78       ;     main.com_state and not in_chain;
10224 11198       hs  w0  x1+a78+1     ;
10225 11200                            ;
10226 11200       dl  w0  x1+a550+2    ;     <* save the communication area *>
10227 11202       ds  w0  x1+a580+2    ;
10228 11204       dl  w0  x1+a550+6    ;
10229 11206       ds  w0  x1+a580+6    ;
10230 11208       dl  w0  x1+a550+10   ;
10231 11210       ds  w0  x1+a580+10   ;
10232 11212       dl  w0  x1+a550+14   ;
10233 11214       ds  w0  x1+a580+14   ;
10234 11216       dl  w0  x1+a550+18   ;
10235 11218       ds  w0  x1+a580+18   ;
10236 11220       dl  w0  x1+a550+22   ;
10237 11222       ds  w0  x1+a580+22   ;
10238 11224  j1:                       ;   end;
10239 11224       jl.      o25.        ;   goto common_part;
10240 11226  e.                        ; end;
10241 11226  ;
10242 11226  ;
10243 11226  o0:                       ; sense:
10244 11226  o20:                      ; test:
10245 11226                            ; ---------------
10246 11226                            ; begin
10247 11226       jl.        o25.      ;   goto common_part;
10248 11228                            ; end;
10249 11228                            ;
10250 11228  o22:                      ; initialize_controller:
10251 11228                            ; ----------------------
10252 11228                            ; begin
10253 11228       jl.        o25.      ;   goto common_part;
10254 11230                            ; end;
10255 11230                            ;
10256 11230                            ; ============= messages from driverproc =============
10257 11230                            ;
10258 11230  o31:                      ; answer_create_link:
10259 11230                            ; ----------------------
10260 11230       rl  w0  x1+a570+a151 ; begin
10261 11232       sz  w0     2.11111110; if result = 1 then
10262 11234       jl.        o33.      ;
10263 11236       rl  w2  x1+a570+a153 ; begin
10264 11238       zl  w3  x2+a78+1     ;   com_mes.proc_id.state := connected;
10265 11240       al  w3  x3+1         ;   <* dirty! it was during connect *>
10266 11242       hs  w3  x2+a78+1     ; end;
10267 11244                            ;   <* continue with the other answer setup *>
10268 11244                            ;
10269 11244  o33:                      ; answer_attention:
10270 11244  o32:                      ; answer_remove_link_request:
10271 11244                            ; ---------------------------
10272 11244                            ; begin
10273 11244       dl  w0  x1+a570+a153 ;   main.controller_id := com_mes.controller_id;
10274 11246       ds  w0  x1+a553      ;   main.proc_id := com_mes.proc_id;
10275 11248       rl  w0  x1+a570+a151 ;   main.gen_info.result := com_mes.result;
10276 11250       hs  w0  x1+a550+1    ;
10277 11252       ls  w0    -12        ;   <* place reserved/unknown results in right
10278 11254       rs  w0  x1+a570+a151 ;      part of mess_1 *>
10279 11256       al  w2     0         ;   message := main.m_b_a;
10280 11258       rx  w2  x1+a551      ;   main.m_b_a := 0;
10281 11260                            ;
10282 11260       rl  w1     b21       ;   <* increase bufferclaim of driverproc:
10283 11262       al  w0     1         ;      it was decreased by two: in send_message and
10284 11264       ba  w0  x1+a19       ;      in wait_event *>
10285 11266       hs  w0  x1+a19       ;
10286 11268       jl  w3     d109      ;   remove_and_release_buffer(driverproc, message);
10287 11270                            ;
10288 11270       jl.        o26.      ;   goto no_message;
10289 11272                            ; end;
10290 11272                            ; ====================================================
10291 11272                            ;
10292 11272                            ; ********** RC8000 specific **********
10293 11272  o3:                       ; input
10294 11272  o5:                       ; output
10295 11272  o8:                       ; position
10296 11272  o34:                      ; stop normal communication                   
10297 11272  ;    jl.        o25.      ;   goto common_part;
10298 11272                            ; ********** end RC8000 specific **********
10299 11272   
10299 11272  
10299 11272  o25:                      ; common_part:
10300 11272                            ; ---------------------------------------
10301 11272       jl  w3     d5        ;   unlink(message);
10302 11274       al  w1  x1+a54       ;
10303 11276       jl  w3     d6        ;   link(main.event_q, message);
10304 11278       ac  w0   2.0000110+1 ;
10305 11280       la  w0  x2+a138      ;   messge.state :=
10306 11282       al  w3   2.0000100   ;   message.state or transfer_complete;
10307 11284       lo  w0     6         ;
10308 11286       hs  w0  x2+a138+1    ;
10309 11288                            ;   <* continue with no_message *>
10310 11288                            ;
10311 11288  o26:                      ; no_message:
10312 11288                            ; ---------------------------------------
10313 11288       rl. w1     i1.       ;
10314 11290  c.l53   b.  f2  w.        ; ***** test 17 *****
10315 11290       rs. w3     f1.       ;
10316 11292       rs. w1     f0.       ;
10317 11294       jl. w3     d150.     ;
10318 11296       17                   ;
10319 11298  f0:  0                    ; < main process >
10320 11300  f1:  0                    ;
10321 11302       jl.        f2.       ;
10322 11304       al  w0  x2+a138      ; < dump message state >
10323 11306       al  w1  x2+a138      ;
10324 11308       jl. w3     d151.     ;
10325 11310  f2:                       ;
10326 11310  e.z.                      ; ***** end test 17 *****
10327 11310                            ;
10328 11310       jl. w3     d155.     ;   increase no_of_outstanding(main)
10329 11312       jl. w3     d144.     ;   start controller(main_proc);
10330 11314       jl. w3     d152.     ;+0: error: clean after buserror(message);
10331 11316       jl         c99       ;+2: ok - controller started; goto return from interrupt;
10332 11318                            ;
10333 11318                            ;
10334 11318  o27:                      ; stop_message:
10335 11318                            ; ------------------
10336 11318       al  w0  x1           ; begin
10337 11320       jl. w3     d149.     ;   stop_message(main, main, message);
10338 11322       am         0         ;+0: during transfer: 
10339 11324                            ;+2: transfer complete:
10340 11324       al  w0  x1           ;
10341 11326       jl.        d154.     ;   regret(main, main, message);
10342 11328                            ;   <* never reached *>
10343 11328                            ;
10344 11328  e.                        ; end;
10345 11328  ;
10346 11328  
10346 11328  
10346 11328  \f


10346 11328  c.-1 ; not used at RC8000
10347 11328  ;
10348 11328  ; ------------------------------------------------------------------------
10349 11328  ;
10350 11328  ;                    ssp main process driver, part 2
10351 11328  ;
10352 11328  ;                           (controller ready)
10353 11328  ;
10354 11328  ; this part of the ssp main process driver is called when the controller
10355 11328  ; is ready to receive the message.
10356 11328  ; the first part of the main process driver is implemented as a part
10357 11328  ; of the common driver process (driverproc), and the control is transfered
10358 11328  ; to this part of the driver through the monitor procedure 'start con-
10359 11328  ; troller'
10360 11328  ;
10361 11328  ; when this part of the driver is entered the format of the messages must
10362 11328  ; be as follows:
10363 11328  ;
10364 11328  ; if the operation is 'create link' the format must be:
10365 11328  ;
10366 11328  ;        create link (IOC):
10367 11328  ;        ------------------------- 
10368 11328  ;   + 0: 6<12 + mode
10369 11328  ;   + 2: device type
10370 11328  ;   + 4: -
10371 11328  ;   + 6: rc8000 process address (*)
10372 11328  ;
10373 11328  ; if the operation is answer attention the format of the message must be
10374 11328  ; (local message, sender is driverproc):
10375 11328  ;
10376 11328  ;          answer attention
10377 11328  ;          -----------------------------
10378 11328  ;   + 0:   -3<12+0
10379 11328  ;   + 2:   result
10380 11328  ;   + 4:   external process
10381 11328  ;   + 6:   controller device index
10382 11328  ;
10383 11328  ; the fields marked '(*)' must be set in the first part of the main
10384 11328  ; process driver (they are not (always) user defined).
10385 11328  ;
10386 11328  ; all other operations must be received unchanged.
10387 11328  ;
10388 11328  ; at entry the message must have been claimed and the stopcount of the sender
10389 11328  ; must have been increased if nessesary.
10390 11328  ;
10391 11328  ; at entry the registers contains:
10392 11328  ;
10393 11328  ; w0  -
10394 11328  ; w1  main process
10395 11328  ; w2  message
10396 11328  ; w3  -
10397 11328  ;
10398 11328  
10398 11328  b. i10, j15, o40   w.
10399 11328                            ; ========== DATA ==========
10400 11328                            ;
10401 11328  i0:  0                    ; param + 0: function
10402 11328       0                    ;       + 2: source
10403 11328       0                    ;       + 4: receiver (main)
10404 11328  i1:  0                    ; save w1: main
10405 11328  i2:  0                    ; save w2: message
10406 11328                            ;
10407 11328  h.                        ; function, operation tabel:
10408 11328                            ; - - - - - - - - - - - - -
10409 11328       4<5   + 1<4          ; -3 : answer attention
10410 11328       0                    ; -2 : -
10411 11328       0                    ; -1 : -
10412 11328  i4:  0                    ;  0 : -
10413 11328       0                    ;  1 : -
10414 11328       0                    ;  2 : -
10415 11328       0                    ;  3 : -
10416 11328       0                    ;  4 : -
10417 11328      13<5                  ;  5 : operator_output
10418 11328       2<5                  ;  6 : create link
10419 11328       0                    ;  7 : -
10420 11328       0                    ;  8 : -
10421 11328       0                    ;  9 : - (extract statistics - part 1 only)
10422 11328       0                    ; 10 : -
10423 11328       0                    ; 11 : -
10424 11328       0                    ; 12 : - (set mask - part 1 only)
10425 11328       0                    ; 13 : -
10426 11328       0                    ; 14 : -
10427 11328       0                    ; 15 : -
10428 11328       0                    ; 16 : - 
10429 11328       0                    ; 17 : -
10430 11328       0                    ; 18 : -
10431 11328       0                    ; 19 : -
10432 11328       0                    ; 20 : -
10433 11328       0                    ; 21 : -
10434 11328       9<5                  ; 22 : initialize controller
10435 11328       0                    ; 23 : -
10436 11328      14<5                  ; 24 : close_system
10437 11328       0                    ; 25 : -
10438 11328      15<5                  ; 26 : reload_system
10439 11328                            ; =========== end DATA ============
10440 11328  
10440 11328  w.
10441 11328  h25:                      ; ssp main process driver: setup
10442 11328  c.l53   b.  f2  w.        ; ***** test 16 *****
10443 11328       rs. w3     f1.       ;
10444 11328       rs. w1     f0.       ;
10445 11328       jl. w3     d150.     ;
10446 11328       16                   ;
10447 11328  f0:  0                    ; < main process >
10448 11328  f1:  0                    ; 
10449 11328       jl.        f2.       ;
10450 11328       al  w0  x2+a138      ; < dump message: -4 - +22 >
10451 11328       al  w1  x2+a157      ;
10452 11328       jl. w3     d151.     ;
10453 11328  f2:                       ;
10454 11328  e.z.                      ; ***** end test 16 *****
10455 11328  
10455 11328       ds. w2     i2.       ;
10456 11328       zl  w0  x2+a138+1    ;   if message.state = stopped then
10457 11328       sz  w0     2.0001000 ;      goto stop_message;
10458 11328       jl.        o29.      ;
10459 11328                            ;
10460 11328       sz  w0     2.0000110 ;   if message.state = not_transfered then
10461 11328       jl.        j1.       ;   begin
10462 11328       al  w3     0         ;
10463 11328       rs. w3     i0.+2     ;     param.source   := message;
10464 11328       rs. w1     i0.+4     ;     param.receiver := main;
10465 11328                            ;     <* might be changed later on dependent on oper*>
10466 11328       el  w3  x2+a150      ;
10467 11328       zl. w0  x3+i4.       ;     param.function :=
10468 11328       hs. w0     i0.+0     ;     function_table(message.operation);
10469 11328                            ;
10470 11328       al  w3     2.0000010 ;     
10471 11328       lo  w3  x2+a138      ;     message.state := message.state or
10472 11328       hs  w3  x2+a138+1    ;                      during_transfer ;
10473 11328                            ;
10474 11328       jl.        j2.       ;   end
10475 11328  j1:                       ;   else
10476 11328       jl.       -1         ;   panic; <* state = during_transfer/transver complete *>
10477 11328  j2:                       ;
10478 11328       al. w0     i0.       ;
10479 11328       jl. w3     d153.     ;   setup(param, main, message);
10480 11328                            ;
10481 11328                            ;   <* from now on use main.com_area: com_mes *>
10482 11328                            ;
10483 11328       el  w3  x1+a570+a150 ;   oper := com_mes.operation;
10484 11328       as  w3    -4         ;   
10485 11328       sn  w3     6         ;   if oper = create_link then
10486 11328       jl.        o6.       ;      goto   create_link else
10487 11328       sn  w3    -3         ;   if oper = answer_attention then
10488 11328       jl.        o33.      ;      goto   answer_attention else
10489 11328       jl.        o27.      ;      goto   common_end;
10490 11328                            ;
10491 11328                            ;
10492 11328  o6:                       ; create link:
10493 11328                            ; ---------------
10494 11328  b.  j5  w.                ; begin
10495 11328       rl  w0  x1+a570+a153 ;
10496 11328       rs  w0  x1+a553      ;   main.proc_id := com_mes.proc_id;
10497 11328       jl.        o27.      ;   goto common_part;
10498 11328  e.                        ; end;
10499 11328                            ;
10500 11328                            ;
10501 11328                            ;
10502 11328                            ; ============= messages from driverproc =============
10503 11328                            ;
10504 11328                            ;
10505 11328  o33:                      ; answer_attention:
10506 11328                            ; ---------------------------
10507 11328                            ; begin
10508 11328       dl  w0  x1+a570+a153 ;   main.controller_id := com_mes.controller_id;
10509 11328       ds  w0  x1+a553      ;   main.proc_id := com_mes.proc_id;
10510 11328       rl  w0  x1+a570+a151 ;   main.gen_info.result := com_mes.result;
10511 11328       hs  w0  x1+a550+1    ;
10512 11328       ls  w0    -12        ;   <* place reserved/unknown results in right
10513 11328       rs  w0  x1+a570+a151 ;      part of mess_1 *>
10514 11328       al  w2     0         ;   message := main.m_b_a;
10515 11328       rx  w2  x1+a551      ;   main.m_b_a := 0;
10516 11328                            ;
10517 11328       rl  w1     b21       ;   <* increase bufferclaim of driverproc:
10518 11328       al  w0     1         ;      it was decreased by two: in send_message and
10519 11328       ba  w0  x1+a19       ;      in wait_event *>
10520 11328       hs  w0  x1+a19       ;
10521 11328       jl  w3     d109      ;   remove_and_release_buffer(driverproc, message);
10522 11328                            ;
10523 11328       jl.        o28.      ;   goto no_message;
10524 11328                            ; end;
10525 11328                            ; ====================================================
10526 11328                            ;
10527 11328  o27:                      ; common_part:
10528 11328                            ; ---------------------------------------
10529 11328       jl  w3     d5        ;   unlink(message);
10530 11328       al  w1  x1+a54       ;
10531 11328       jl  w3     d6        ;   link(main.event_q, message);
10532 11328       ac  w0   2.0000110+1 ;
10533 11328       la  w0  x2+a138      ;   messge.state :=
10534 11328       al  w3   2.0000100   ;   message.state or transfer_complete;
10535 11328       lo  w0     6         ;
10536 11328       hs  w0  x2+a138+1    ;
10537 11328                            ;   <* continue with no_message *>
10538 11328                            ;
10539 11328  o28:                      ; no_message:
10540 11328                            ; ---------------------------------------
10541 11328       rl. w1     i1.       ;
10542 11328  c.l53   b.  f2  w.        ; ***** test 17 *****
10543 11328       rs. w3     f1.       ;
10544 11328       rs. w1     f0.       ;
10545 11328       jl. w3     d150.     ;
10546 11328       17                   ;
10547 11328  f0:  0                    ; < main process >
10548 11328  f1:  0                    ;
10549 11328       jl.        f2.       ;
10550 11328       al  w0  x2+a138      ; < dump message state >
10551 11328       al  w1  x2+a138      ;
10552 11328       jl. w3     d151.     ;
10553 11328  f2:                       ;
10554 11328  e.z.                      ; ***** end test 17 *****
10555 11328                            ;
10556 11328       jl. w3     d144.     ;   start controller(main_proc);
10557 11328       jl. w3     d152.     ;+0: error: clean after buserror(message);
10558 11328       jl         c99       ;+2: ok - controller started; goto return from interrupt;
10559 11328                            ;
10560 11328                            ;
10561 11328  o29:                      ; stop_message:
10562 11328                            ; ------------------
10563 11328       al  w0  x1           ; begin
10564 11328       jl. w3     d149.     ;   stop_message(main, main, message);
10565 11328       jl        -1         ;+0: panic
10566 11328                            ;+2: transfer complete:
10567 11328       al  w0  x1           ;
10568 11328       jl.        d154.     ;   regret(main, main, message);
10569 11328                            ;   <* never reached *>
10570 11328                            ;
10571 11328  e.                        ; end;
10572 11328  
10572 11328  
10572 11328  ;**************  e n d  o f  d e v i c e  d r i v e r s  *****************
10573 11328  z.
10574 11328  e.                        ; <* end of h - block *>
10575 11328  \f


10575 11328  
10575 11328  
10575 11328  
10575 11328  b.i0                    ; begin
10576 11328  w.i0: al. w2  i0.       ; make room:
10577 11330        jl      x3+0      ;   autoloader(end monitor procedures);
10578 11332        jl.     i0.       ; after loading:
10579 11334    j0=k - b127 + 2
10580 11334    k = i0                ;   goto make room;
10581 11328  e.                      ; end
10582 11328  
10582 11328  
10582 11328  e.    ; end of monitor segment
10583 11328  
10583 11328  
10583 11328  \f


10583 11328  ; segment 3: external processes
10584 11328  
10584 11328  s. k = k, h132
10585 11328  w.b127=k, g70, k=k-2
10586 11328  
10586 11328  m.
10586 11328                  driver proc save area - g,b names, reg dump (18, 16 hw)

10587 11328  
10587 11328  ; common driver central logic
10588 11328  ; compatible with old conventions
10589 11328  
10589 11328  ; save area for std g-names, b-names
10590 11328  b086: 0,r.5            ; g20, g21, g22, g23, g24
10591 11338       0, r.3            ; b18, b19, work
10592 11344       b085              ; b20 = address of wait-next action
10593 11346  
10593 11346  ; interrupt routine
10594 11346  b087:0, r.a180>1       ; save area for registers
10595 11362       jd        1<11+134; emergency stop:
10596 11364                         ;  in case of driverproc failure, stop all
10597 11364                         ; goto wait next;  to preserve situation
10598 11364  
10598 11364  b. e10 w.
10599 11364  b. i3 w.
10600 11364   b77:jl  w3     d80   ; lock monitor;
10601 11366  
10601 11366  b085:al  w2     0      ; wait next:
10602 11368  b084:jd         1<11+24;    wait event;
10603 11370       am        (0)     ;    result: 0=message, 1=answer,
10604 11372       jl.       +2      ;            2=interrupt, 4=immediate message
10605 11374       jl.        e2.    ;+2: message or answer:
10606 11376       jl      x2        ;+4: interrupt: goto service address;
10607 11378       jl          -123; go jump in water
10608 11380  
10608 11380  
10608 11380  i0:  0                 ; saved message buffer address
10609 11382  
10609 11382  ; message or answer:
10610 11382  ; entry: w0=result from wait event, w2=buf
10611 11382  e2:  rl  w1    b21     ;
10612 11384       rl  w3  x2+a140   ; next event;
10613 11386       sn  w3   x1+a15   ;    if more in queue then
10614 11388       jl.        i2.    ;    begin
10615 11390       rs. w3     i0.    ; 
10616 11392  i3:  sl  w3     (b8+4) ;      repeat <* scan of driverprocs queue for interrupt *>
10617 11394       sl  w3     (b8+6) ;        if -,buffer then
10618 11396       jl.        b084.  ;        goto wait next;
10619 11398       rl  w3  x3+a140   ;        next in queue;
10620 11400       se  w3   x1+a15   ; 
10621 11402       jl.        i3.    ;      until end of queue;
10622 11404                         ;    end;
10623 11404  i2:  rl  w1  x2+6      ;    sender := sender(buf);
10624 11406       sh  w1      0     ; if not regretted then
10625 11408       jl.        b084.  ;
10626 11410       jd         1<11+26;    get event(buf); (buffer contents is irrell if answer)
10627 11412       se  w0     1      ;    if result from wait event = 0 then
10628 11414       jl.        e3.    ;      goto message;
10629 11416  
10629 11416  ; answer:
10630 11416  ; entry: w0=1, w1=sender
10631 11416  ; skip the answer, unless message originated from a terminal
10632 11416        rl  w0  x1+a10   ;
10633 11418        la  w0  g50      ;
10634 11420        zl  w3  x1+a63   ;
10635 11422        sn  w0  q8       ;   if sender.kind = terminal then
10636 11424        jl.     i1.      ;      reset att buffer address
10637 11426        sn  w0  84       ;  if kind(sender) <> subprocess
10638 11428        se  w3  8        ;  or subkind(sender) <> terminal
10639 11430        jl.     b085.    ;   then ignore the answer;
10640 11432  i1:  al  w0  0         ; reset att buffer adr
10641 11434       sn  w2  (x1+a71)  ; if message = att message 
10642 11436       rs  w0  x1+a71    ;
10643 11438       jl.        b085.  ;    goto wait next;
10644 11440  
10644 11440  ; message:
10645 11440  ; entry: w1=sender, w2=buf
10646 11440  e3:                    ; lock monitor;
10647 11440       rl  w3     b21    ; w3 := driverproc;
10648 11442       bz  w0  x3+a19    ;    increase (bufclaim(cur));
10649 11444       ba. w0     1      ;
10650 11446       hs  w0  x3+a19    ;    i.e. unclaim the buffer again...
10651 11448       ac  w3 (x2+4)     ;    proc := -receiver(buf); (positive)
10652 11450       rs  w3  x2+4      ;    receiver(buf) := proc  (i.e. positive);
10653 11452       ds  w3     b19    ;    save(buf,proc) in std locations;
10654 11454  
10654 11454  ; before exit to the different drivers, the registers contain:
10655 11454  ;  w0=undef, w1=sender, w2=buf, w3=proc
10656 11454  
10656 11454       am     (x3+a10)   ;
10657 11456       jd.      (+2)     ;    goto case kind(proc) of:
10658 11458       h3                ;  (0: internal process
10659 11460       h4                ;   2: interval clock
10660 11462       h5                ;   4: backing store area
10661 11464       g2                ;   6:
10662 11466       h8                ;   8:
10663 11468       g2                ;  10:
10664 11470       g2                ;  12:
10665 11472       g2                ;  14:
10666 11474       g2                ;  16:
10667 11476       g2                ;  18:
10668 11478       h20               ;  20: ida main process
10669 11480       g2                ;  22:
10670 11482       g2                ;  24:
10671 11484       h26               ;  26: ifp main process
10672 11486       g2                ;  28:
10673 11488       g2                ;  30:
10674 11490       g2                ;  32:
10675 11492       g2                ;  34:
10676 11494       g2                ;  36:
10677 11496       g2                ;  38:
10678 11498       g2                ;  40:
10679 11500       g2                ;  42:
10680 11502       g2                ;  44:
10681 11504       g2                ;  46:
10682 11506       g2                ;  48:
10683 11508       g2                ;  50:
10684 11510       g2                ;  52:
10685 11512       h7                ;  54: errorlog process
10686 11514       h22               ;  56: remoter process
10687 11516       g2                ;  58:
10688 11518       g2                ;  60:
10689 11520       h6                ;  62: disc (logical- and physical disc)
10690 11522       h3                ;  64: pseudo process
10691 11524       g2                ;  66:
10692 11526       g2                ;  68:
10693 11528       g2                ;  70:
10694 11530       h72               ;  72: rc8602 (sscir)
10695 11532       h74               ;  74: rc8602 (isrpy)
10696 11534       h76               ;  76: rc8601 (sscir)
10697 11536       h78               ;  78: rc8601 (isrpy)
10698 11538       h80               ;  80: mainproc(fpa)
10699 11540       g2                ;  82: hostproc(fpa)
10700 11542       h84               ;  84: subproc(fpa)
10701 11544       g2                ;  86: receiver(fpa)
10702 11546       g2                ;  88: transmitter(fpa)
10703 11548       h90               ;  90: host);
10704 11550  
10704 11550  h3=g6                  ; internal process, pseudo process
10705 11550  g2=g3                  ; not defined
10706 11550  
10706 11550  e.                     ; end common part of central logic
10707 11550  e.                     ; end of driver central logic
10708 11550  
10708 11550  \f


10708 11550  ; pej 23.01.78    clock driver
10709 11550  
10709 11550  ; -----------------------------------------------------------------
10710 11550  
10710 11550  ;              c l o c k   d r i v e r   c o d e
10711 11550  
10711 11550  ; -----------------------------------------------------------------
10712 11550  
10712 11550  ; this section contains the code executed by driverproc for
10713 11550  ; processing messages to the clockdriver and for executing other
10714 11550  ; actions related to the real time clock.
10715 11550  ;
10716 11550  ; messages have the following format:
10717 11550  ;
10718 11550  ; delay                  0<12+mode
10719 11550  ;                        seconds   or   interval(0:23)
10720 11550  ;                                       interval(24:47)
10721 11550  ;
10722 11550  ; wait for clockchange   2<12+mode
10723 11550  ;                        seconds   or   interval(0:23)
10724 11550  ;                                       interval(24:47)
10725 11550  ;
10726 11550  ; wait for power restart 4<12+mode
10727 11550  ;                        seconds   or   interval(0:23)
10728 11550  ;                                       interval(24:47)
10729 11550  ;
10730 11550  ; a maximum delay is specified by seconds or interval equal to -1.
10731 11550  ;
10732 11550  ; mode consists of a sum of one or more of following values:
10733 11550  ;
10734 11550  ;   2   time interval in 0.1 msecs. if not used then seconds.
10735 11550  ;   4   real time delay, i.e. the message is returned when the
10736 11550  ;       clock reaches the value:
10737 11550  ;         curr value of real time clock + delay
10738 11550  ;       if not used, an effective delay is specified, i.e. the
10739 11550  ;       message will be returned when it has been in the event
10740 11550  ;       queue as long as specified.
10741 11550  ;
10742 11550  ; the answer has the following format:
10743 11550  ;   statusword, bit0 = intervention (see below)
10744 11550  ;   0
10745 11550  ;   0
10746 11550  ;
10747 11550  ; messages received are linked to the clock process in ascending
10748 11550  ; order with respect to calculated time for expiration of delay.
10749 11550  ; at each clock interrupt the queue is scanned and messages which
10750 11550  ; have reached the expiration time are returned. also at each
10751 11550  ; clock interrupt the timeout queue of devices is scanned.
10752 11550  ; timers which have run out cause the clock to reset the device
10753 11550  ; with timeout status.
10754 11550  ;
10755 11550  ; after power restart all devices are reset with power restart
10756 11550  ; result and messages waiting for power restart are returned with
10757 11550  ; status intervention.
10758 11550  ;
10759 11550  ; after a change of clock (monitor procedure set clock) messages
10760 11550  ; waiting for clockchange are returned with status intervention.
10761 11550  ; the same is performed at mode 4-messages if the new clockvalue
10762 11550  ; exceeds the calculated expiration time. messages not using mode
10763 11550  ; 4 will have the expected expiration time adjusted according to
10764 11550  ; the clockchange and the entire message queue is resorted.
10765 11550  
10765 11550  
10765 11550  
10765 11550  m.
10765 11550                  monclock (monitor interval clock driver)

10766 11550  
10766 11550  
10766 11550  b. i10, j60, a0=1<23, w. ; block including clock driver
10767 11550  \f


10767 11550  ; pej 23.01.78    clock driver
10768 11550  
10768 11550  ; m e s s a g e   r e c e i v e d
10769 11550  ; ---------------------------------------------------------------
10770 11550  ;
10771 11550  ; this routine is entered when driverproc receives a message for
10772 11550  ; the clock. the message is checked and time (clockvalue) for
10773 11550  ; expiration of delay is inserted into the buffer.
10774 11550  h4  : dl. w1     i0.    ;   c. w2 = curr buf;
10775 11552        jl  w3     g16    ;   check operation(mode mask,oper mask);
10776 11554        rs. w2     i8.    ; save received buffer
10777 11556        rl  w1     b19    ; check for clockchange c.w1=cur receiver
10778 11558        jl. w3     j24.   ; 
10779 11560        rl. w2     i8.    ; restore buffer
10780 11562        dl  w0  x2+a152   ;   delay:= interval(0:47).curr buf;
10781 11564        bz  w1  x2+a150+1 ;
10782 11566        sz  w1     2.10   ;   if time in secs.mode.curr buf then
10783 11568        jl.        j10.   ;   begin
10784 11570        al  w0  x3+0      ;     seconds:= delay(0:23);
10785 11572        sn  w0    -1      ;     if seconds = -1 then goto maxdelay
10786 11574        jl.        j14.   ;     else delay:= seconds * 10000;
10787 11576        wm. w0     i1.    ;   end;
10788 11578  j10 : sl  w3     0      ;   if delay >= 0
10789 11580        sl  w3     52     ;   and delay <= 872415231 then
10790 11582        jl.        j12.   ;   begin c. 24 hrs + 841.5231 secs;
10791 11584        sn  w0     0      ;     if delay = 0 then
10792 11586        se  w3     0      ;     begin
10793 11588        jl.        j16.   ;       bytes:= chars:= 0; goto result 1;
10794 11590        ds  w3     g22    ;     end;
10795 11592        jl         g7     ;   end
10796 11594  j12 : sn  w3    -1      ;   else
10797 11596        se  w0    -1      ;   if delay <> -1
10798 11598        jl         g5     ;   then goto result 3
10799 11600  j14 : dl. w0     i2.    ;   else
10800 11602        ss  w0     b13+2  ; maxdelay: delay:= max clock val - time;
10801 11604  j16 : aa  w0     b13+2  ;
10802 11606        ds  w0  x2+a152   ;   time.curr buf:= delay + time;
10803 11608  
10803 11608  ; insert the messagebuffer in eventqueue of the driver (the event
10804 11608  ; queue is sorted after delay expiration time) and continue at
10805 11608  ; waitnext in driverproc. please note that the messagebuffer is
10806 11608  ; not claimed.
10807 11608        rl  w3     b20    ;
10808 11610        jl.        j50.   ;   insert buf(curr buf);
10809 11612  \f


10809 11612  ; pej 23.01.78    clock driver
10810 11612  
10810 11612  ; i n t e r r u p t   r e c e i v e d
10811 11612  ; ---------------------------------------------------------------
10812 11612  ;
10813 11612  ; this routine is entered when driverproc receives an interrupt
10814 11612  ; operation for the clock.
10815 11612  ;
10816 11612  ; if a power restart has been executed, all devices are reset
10817 11612  ; and messages queued to wait for power restart returned.
10818 11612  c35 : al  w0     0      ;   c. w1 = curr receiver;
10819 11614        al. w3     j38.   ; set continue adr
10820 11616        rx  w0     b75    ;   p:= after power; after power:= 0;
10821 11618        sn  w0     0      ;   if p <> 0 then
10822 11620        jl.        j24.   ;   begin
10823 11622        rl  w2     b67    ;     entry:= 1st controller tab entry;
10824 11624  j18 : rl  w3  x2+a311   ;     repeat
10825 11626       sn  w3     0      ;       if deviceadr = 0 then
10826 11628       jl.        j19.   ;       goto next entry; <*cpu-element*>
10827 11630        rl  w1  x3+a235-a230;     device:=
10828 11632        al  w0     0      ;       deviceaddr.proc.entry;
10829 11634        jd         1<11+2 ;       reset device(device,power);
10830 11636  j19:                   ;       next entry:
10831 11636        al  w2  x2+a314   ;       entry:= entry + entry length
10832 11638        se  w2    (b68)   ;     until entry = top entry;
10833 11640        jl.        j18.   ;
10834 11642        rl  w1     b19    ;     buf:=
10835 11644        al  w2  x1+a54    ;     addr of mess q head.curr receiver;
10836 11646  j20 : rl  w2  x2+a140   ; rep: buf:= next.buf;
10837 11648  j22 : al. w3     j38.   ; prepare continue adr
10838 11650        sn  w2  x1+a54    ; rep1: if buf<>addr mqhead.curr rec then
10839 11652        jl.        j24.   ;     begin
10840 11654        bz  w0  x2+a150   ;       if operation.buf <> 4
10841 11656        se  w0     4      ;       then goto rep;
10842 11658        jl.        j20.   ;       deliver intervention(buf);
10843 11660        al. w3     j22.   ;       goto rep1;
10844 11662        jl.        j51.   ;     end;
10845 11664                          ;   end;
10846 11664  \f


10846 11664  ; pej 23.01.78    clock driver
10847 11664  
10847 11664  ; if the clock has been changed some messages may be returned
10848 11664  ; (those waiting for clockchange and those waiting in real time
10849 11664  ; delay). expiration time in messages waiting in effective time
10850 11664  ; delay is adjusted and the message queue is resorted.
10851 11664  ; called when a message or an interrupt is received
10852 11664  ; called with w1=cur receiver  and w3 holding the return adr
10853 11664  j24 : rl  w0     b15    ;   c. w1 = curr receiver;
10854 11666        lo  w0     b15+2  ;
10855 11668        sn  w0     0      ;   if clockchange <> 0 then
10856 11670        jl         x3     ;   begin
10857 11672        rs. w3     i9.    ; save return adr
10858 11674        al  w2  x1+a54    ;
10859 11676        sn  w2 (x1+a54)   ;     if mess q.curr rec -,empty then
10860 11678        jl.        j36.   ;     begin
10861 11680        dl  w0  x1+a55    ;       help q head:=
10862 11682        ds. w0     i4.    ;       mess q head.curr receiver;
10863 11684        rs  w2  x1+a54    ;
10864 11686        rs  w2  x1+a55    ;       mess q head.curr receiver:= empty;
10865 11688        al. w0     i3.    ;       next.last.help q head:=
10866 11690        rs. w0    (i4.)   ;       addr of help q head;
10867 11692        rl. w2     i3.    ;       buf:= next.help q head;
10868 11694        rs  w0  x2+2      ;       last.buf:= addr of help q head;
10869 11696  j26 : sn. w2    (i5.)   ; rep:  if buf <> addr of help q head then
10870 11698        jl.        j36.   ;       begin
10871 11700        bz  w0  x2+a150   ;
10872 11702        se  w0     2      ;         if operation.buf = 2 then
10873 11704        jl.        j30.   ;         begin
10874 11706  j28 : jl. w3     j51.   ; send:     deliver intervention(buf);
10875 11708        jl.        j26.   ;           goto rep;
10876 11710  j30 : dl  w0  x2+a152   ;         end;
10877 11712        bz  w1  x2+a150+1 ;
10878 11714        so  w1     2.100  ;         if real time.mode.buf then
10879 11716        jl.        j32.   ;         begin
10880 11718        ss  w0     b13+2  ;           if time > time.buf
10881 11720        sx         2.1    ;           then goto send;
10882 11722        jl.        j34.   ;         end
10883 11724        jl.        j28.   ;         else
10884 11726  j32 : sn. w3    (i7.)   ;
10885 11728        se. w0    (i2.)   ;         if time.buf <> max clock val
10886 11730        aa  w0     b15+2  ;         then time.buf:= time.buf
10887 11732        ds  w0  x2+a152   ;                         + clockchange;
10888 11734  j34 : rl  w0  x2+0      ;         next:= next.buf;
10889 11736        rs. w0     i6.    ;
10890 11738        jl  w3     d5     ;         remove(buf); c. from help q;
10891 11740        jl. w3     j50.   ;         insert buf(buf);
10892 11742        rl. w2     i6.    ;         buf:= next;
10893 11744        jl.        j26.   ;         goto rep;
10894 11746                          ;       end;
10895 11746  j36 : ld  w0    -100    ;     end;
10896 11748        ds  w0     b15+2  ;     clockchange:= 0;
10897 11750        rl  w1     b19    ;   end;
10898 11752        jl.      (i9.)    ;
10899 11754  \f


10899 11754  \f


10899 11754  ; pej 23.01.78    clock driver
10900 11754  
10900 11754  ; scan the message queue and return buffers with delays expired.
10901 11754  j38 : rl  w2  x1+a54    ;   c. w1 = curr receiver;
10902 11756        sn  w2  x1+a54    ; rep: buf:= next.mess q head.curr rec;
10903 11758        jl.        j40.   ;   if buf = addr of mess q head.curr rec
10904 11760        dl  w0  x2+a152   ;   then goto check timeouts;
10905 11762        ss  w0     b13+2  ;
10906 11764        sx         2.1    ;   if time < time.buf
10907 11766        jl.        j40.   ;   then goto check timeouts;
10908 11768        rs  w2     b18    ;   curr buf:= buf;
10909 11770        al. w3     j38.   ;   no operation; c. result 1, status 0;
10910 11772        jl         g26    ;   goto rep;
10911 11774  
10911 11774  ; scan the timeout queue of devices and reset with timeout result
10912 11774  ; for timers which have run out. return to waitnext in driverproc.
10913 11774  j40 : dl  w2     b13+2  ; check timeouts:
10914 11776        dl  w0     b70+2  ;   timeused:= time - last inspected;
10915 11778        ds  w2     b70+2  ;   last inspected:= time;
10916 11780        ss  w2     0      ;   if timeused >= 1<24
10917 11782        se  w1     0      ;   then timeused:= maximum;
10918 11784        al  w2    -1      ;   c. timeused is unsigned integer;
10919 11786        al  w3     b69    ;   dev:= addr of timeout q head;
10920 11788  j42 : rl  w3  x3+0      ; rep: dev:= next.dev;
10921 11790  j44 : sn  w3     b69    ; rep1: if dev = addr of timeout q head
10922 11792        jl        (b20)   ;   then goto waitnext; c. in driverproc;
10923 11794        rl  w0  x3-a242+a244;
10924 11796        ws  w0     4      ;   timer.dev:=
10925 11798        rs  w0  x3-a242+a244; timer.dev - timeused;
10926 11800        sx         2.1    ;   if timer.dev was > timeused
10927 11802        jl.        j42.   ;   then goto rep; c. unsigned comparison;
10928 11804        rl  w1  x3-a242+a235; device:= deviceaddr.timeout op;
10929 11806        rl  w3  x3+0      ;   dev:= next.dev;
10930 11808        al  w0     1      ;
10931 11810        jd         1<11+2 ;   reset device(device,timeout);
10932 11812        jl.        j44.   ;   goto rep1;
10933 11814  
10933 11814  ; variables
10934 11814        a0>0+a0>2+a0>4    ; operation and mode masks
10935 11816  i0  : a0>0+a0>2+a0>4+a0>6
10936 11818  i1  : 10000             ; constant 10000
10937 11820  i7  : 8.37777777        ; max clock value (doubleword)
10938 11822  i2  : 8.77777777        ; 
10939 11824  i3  : 0                 ; doubleword used for help q head
10940 11826  i4  : 0                 ;
10941 11828  i5  : i3                ; addr of help q head
10942 11830  i6  : 0                 ; work, saved buf in loop
10943 11832  i8  : 0                 ; saved buffer from message received
10944 11834  i9  : 0                 ; return adr for j24
10945 11836  \f


10945 11836  ; pej 23.01.78    clock driver
10946 11836  
10946 11836  ; procedure insert buf(buf);
10947 11836  ; ---------------------------------------------------------------
10948 11836  ; inserts a messagebuffer in the eventqueue in front of a buffer
10949 11836  ; with higher delay expiration time.
10950 11836  ;
10951 11836  ; registers: call              exit
10952 11836  ; w0                           destroyed
10953 11836  ; w1                           destroyed
10954 11836  ; w2         buf               unchanged
10955 11836  ; w3         link              destroyed
10956 11836  ;
10957 11836  ; entry: j50; return: link+0
10958 11836  b. i3 w.
10959 11836  j50 : rl  w1     b19    ; insert buf:
10960 11838        al  w1  x1+a54    ;   elem:= endq:=
10961 11840        rs. w1     i0.    ;   addr of mess q head.curr receiver;
10962 11842        rs. w3     i1.    ;
10963 11844  i2  : rl  w1  x1+0      ; rep: elem:= next.elem;
10964 11846        sn. w1    (i0.)   ;   if elem <> endq
10965 11848        jl.        i3.    ;
10966 11850        dl  w0  x2+a152   ;
10967 11852        ss  w0  x1+a152   ;
10968 11854        sx         2.1    ;   and time.buf <= time.elem
10969 11856        jl.        i2.    ;   then goto rep;
10970 11858  i3  : rl. w3     i1.    ;
10971 11860        jl         d6     ;   link(elem,buf); c. return from there;
10972 11862  
10972 11862  
10972 11862  
10972 11862  ; procedure deliver intervention(buf)
10973 11862  ; ---------------------------------------------------------------
10974 11862  ; the procedure answers buf with status intervention and returns
10975 11862  ; with the value of next.buf at calltime.
10976 11862  ;
10977 11862  ; registers: call              exit
10978 11862  ; w0                           destroyed
10979 11862  ; w1                           curr receiver
10980 11862  ; w2         buf               next.buf
10981 11862  ; w3         link              destroyed
10982 11862  ;
10983 11862  ; entry: j51; return: link+0
10984 11862  j51 : rs. w3     i1.    ; deliver intervention:
10985 11864        rs  w2     b18    ;   curr buf:= buf;
10986 11866        rl  w0  x2+0      ;
10987 11868        rs. w0     i0.    ;   save next.buf;
10988 11870        rl  w0     g49    ;
10989 11872        rs  w0     g20    ;   status.i/o answer:= bit 0;
10990 11874        al  w0     1      ;   result:= 1;
10991 11876        al  w1     0      ;   bytes:= characters:= 0;
10992 11878        jl  w3     g28    ;   no operation;
10993 11880        rl. w2     i0.    ;   w2:= saved next.buf;
10994 11882        jl.       (i1.)   ;   return;
10995 11884  
10995 11884  ; variables
10996 11884  i0  : 0                 ; for saving next.buf or endq
10997 11886  i1  : 0                 ; saved link
10998 11888  e.
10999 11888  
10999 11888  e.                      ; end of block containing clock driver
11000 11888  \f


11000 11888  
11000 11888  
11000 11888  ; remoter process.
11001 11888  ; jr 79.02.28
11002 11888  
11002 11888  m.
11002 11888                  remoter

11003 11888  
11003 11888  b.i4,j4 w.
11004 11888  
11004 11888  h22: al  w1  x3+a54    ; remoter:
11005 11890       jl  w3  d6        ;   link event(event queue(proc), buf);
11006 11892       zl  w3  x2+a150   ;   if message.operation=wait for mt-online then
11007 11894       se  w3  0         ;
11008 11896       jl      (b20)     ;
11009 11898       rl  w1  b3        ;
11010 11900  j0:  al  w1  x1+2      ;   for dev:=first dev in name table until last do
11011 11902       sl  w1 (b5)       ;    begin
11012 11904       jl     (b20)      ;
11013 11906       rl  w3  x1        ;     proc:=proc(dev);
11014 11908       rl  w0  x3+a10    ;     kind:=kind(proc);
11015 11910       sn  w0  18        ;     main:=main(proc);
11016 11912       jl.     j1.       ;     if kind=18
11017 11914       rl  w2  x3+a50    ;     or (kind=84,85 and main<>0 and subkind=18) then
11018 11916       se  w0  84        ;
11019 11918       sn  w0  85        ;
11020 11920       sn  w2  0         ;
11021 11922       jl.     j0.       ;
11022 11924       bl  w2  x3+a63    ;
11023 11926       se  w2  18        ;
11024 11928       jl.     j0.       ;
11025 11930  j1:  rl  w2  x3+a70    ;     if proc.stat=2 and
11026 11932       se  w2  2         ;
11027 11934       jl.     j0.       ;        ((message.mode = wait specific main and
11028 11936       am      (b18)     ;          message.main = proc.main) or
11029 11938       zl  w2  +a150+1   ;          message.mode = all main) then
11030 11940       so  w2  2.1       ;     begin
11031 11942       jl.     j2.       ;
11032 11944       am      (b18)     ;       message.status := 0;
11033 11946       rl  w2  +a151     ;       message.mt-addr := proc;
11034 11948       se  w2  (x3+a50)  ;
11035 11950       jl.     j0.       ;
11036 11952  j2:  al  w2  0         ;       deliver result(1);
11037 11954       ds  w3  g21       ;       goto exit;
11038 11956       jl  w3  g18       ;     end;
11039 11958       jl     (b20)      ; exit: return;
11040 11960  e.
11041 11960  \f


11041 11960  ; errorlog process
11042 11960  ; hsi 80.07.22
11043 11960  m.
11043 11960                  errorlog process

11044 11960  b. i10, j10 w.
11045 11960  i0=1<23
11046 11960      i0>19
11047 11962  j0: i0>0
11048 11964  
11048 11964  h7:  al  w0  0            ; reset interrupt adr. (set by remove process)
11049 11966       rs  w0  x3+a56       ;
11050 11968  
11050 11968  
11050 11968       dl. w1  j0.          ; check operation
11051 11970       jl  w3  g16          ; 
11052 11972       rl  w2  b18          ; if buffer size < max record size
11053 11974       rl  w1  x2+a138      ;  then answer unintelligble
11054 11976       ls  w1     -1        ;  buf.state := buf.state -i/o-bit
11055 11978       ls  w1     +1        ;
11056 11980       rs  w1  x2+a138      ; (allowing it to be regertted)
11057 11982       rl  w1  x2+a151      ; then send answer: unintelligble
11058 11984       al  w1  x1+74        ; 
11059 11986       sh  w1  (x2+a152)    ; else link operation and retur to driverproc
11060 11988       jl.     j1.       ;
11061 11990       ld  w1  -100         ; buffer too small : send answer
11062 11992       ds  w1  g22          ;
11063 11994       al  w1  8            ;
11064 11996       rs  w1  g20          ; status: 1 shift 3
11065 11998       jl      g5           ;
11066 12000   j1: jl  w3  g17          ; link up (return if first in queue )
11067 12002       rl  w0  x2+a153     ; if first in queue then
11068 12004       rs  w0  b32          ; set pd of special watched receiver
11069 12006       jl      (b20)        ; return via wait event in driverproc
11070 12008  e.
11071 12008  
11071 12008  ; rc8601 driver.
11072 12008  ; jr, 78.04.28
11073 12008  
11073 12008  c.(:a80>11a.1:)-1
11074 12008  
11074 12008  m.
11074 12008                  rc8601/02 (cdc1604/gier emulator)

11075 12008  
11075 12008  b.i15,m6,p6,s6 w.
11076 12008  
11076 12008  ; the rc8601 and rc8602 are a rc800 cpu used for emulating the cdc 1604 and gier.
11077 12008  ; the device responds two devicenumbers, and it is then controlled
11078 12008  ; from two external processes -
11079 12008  ;   sscir, stop-start control and io-request,
11080 12008  ; and
11081 12008  ;   isrpy, io-status reply.
11082 12008  ; these processes are working totally independent, but as they should be
11083 12008  ; driven in almost the same way they are using the same driver-code.
11084 12008  ;ations-
11085 12008  ;   sscir :  sense         0<12+0   , dummy    , dummy
11086 12008  ;            autoload      1<12+0   , base addr, dummy (rc8601)
11087 12008  ;                          1<12+0   , first    , last  (rc8602)
11088 12008  ;            restart       2<12+0   , dummy    , dummy
11089 12008  ;                          3<12+0   , first    , last  (rc8602)
11090 12008  ;   isrpy:  (sense         0<12+0   , dummy    , dummy
11091 12008  ;only rc8601(stop          2<12+0   , dummy    , dummy
11092 12008  ;           (ready         4<12+mode, dummy    , dummy    , channelnumber
11093 12008  ; where
11094 12008  ;   base addr-448, base addr+131072 must be inside the sender process,
11095 12008  ;   and channelnumber <256,
11096 12008  ; and
11097 12008  ;   mode holds any combination of the mode bits
11098 12008  ;            1<0        channel ready
11099 12008  ;            1<1        equipment ready
11100 12008  ;            1<2        equipment error
11101 12008  ;
11102 12008  ; the format of the answer-
11103 12008  ;   event status
11104 12008  ;   function
11105 12008  ;   unitno<18+exf addr (only autoload)
11106 12008  ;  (io-result)
11107 12008  ; where
11108 12008  ;   event status is the status delivered from the hardware,
11109 12008  ; and
11110 12008  ;   function     -2  power up
11111 12008  ;                -1  monitor timeout
11112 12008  ;                 0  stopped
11113 12008  ;                 1  ok after immidiate operation
11114 12008  ;                 2  error stop
11115 12008  ;                 3  exfer request
11116 12008  ;
11117 12008  ; format of the privat part of the process description-
11118 12008  
11118 12008  s0=a56+2               ; current sender ident. bit
11119 12008  s1=s0+2                ; state
11120 12008  s2=s1+2                ; stopped(sender) (only sscir)
11121 12008  
11121 12008  ; state -
11122 12008  ;   0    device ready
11123 12008  ;   2    sscir busy with sense operation
11124 12008  ;   4    sscir busy with autoload operation
11125 12008  ;   6    sscir busy with rc8601 restart operation
11126 12008  ;   8    sscir busy with rc8602 restart operation
11127 12008  ;   10   isrpy busy with sense operation
11128 12008  ;   12   isrpy busy with stop operation
11129 12008  ;   14   isrpy busy with ready operation
11130 12008  ;
11131 12008  ; stopped -
11132 12008  ;   =  0    running
11133 12008  ;   <> 0    stopped
11134 12008  ;
11135 12008  ; parameters:
11136 12008  
11136 12008  p0=76                  ; kind of sscir process
11137 12008  p1=78                  ; kind of isrpy process
11138 12008  
11138 12008  p2=-448                ; rel first (start of sim area relative to base addr)
11139 12008  p3=131072              ; rel last (last of sim area relative to base addr)
11140 12008  
11140 12008  ; channelprogram:
11141 12008  
11141 12008  i0:  0<12+0<8+0        ; address code (sender), operation
11142 12010       0                 ; base addr
11143 12012       0                 ; channelnumber
11144 12014  
11144 12014           15<8          ; stop
11145 12016       0                 ; dummy
11146 12018  i11: 0                 ; timeout (in units of 0.1 millisec)
11147 12020  
11147 12020  
11147 12020  i1:  p3                ;
11148 12022       a0=1<23
11149 12022       a0>0+a0>1+a0>2+a0>3    ; mask0
11150 12024  i2:  a0>0              
11151 12026       a0>0+a0>2+a0>4    ; mask1
11152 12028  i3:  a0>0
11153 12030       a0>0+a0>2+a0>4    ; mask2
11154 12032  i4:  a0>1+a0>2+a0>3+a0>4+a0>5+a0>6+a0>7+a0>8+a0>9+a0>10+a0>11+a0>12+a0>13+a0>14+a0>15
11155 12034  
11155 12034  ; table concerning channel program.
11156 12034  
11156 12034  i5=k-2,  2<12+0<8, 0<12+1<8, 0<12+3<8, 0<12+1<8, 2<12+0<8, 0<12+1<8, 0<12+3<8
11157 12048  i6=k-2,        12,        0,        1,        0,       12,        1, i7:    0
11158 12062  i12: 120*10000         ; timeout f. 8601
11159 12064  i13:  15*10000         ; timeout f. 8602
11160 12066  
11160 12066  ; dummy status area.
11161 12066  i8:  0, r.4            ;
11162 12074  
11162 12074  i9:  1<3               ;
11163 12076  
11163 12076  ; start.
11164 12076  b.j6 w.
11165 12076  h76: jl  w3  g15       ; start(sscir): check reservation;
11166 12078  h72: bz  w3  x2+8      ;   if rc8602 then skip user/reserver check;
11167 12080       ls  w3  1         ;   index:=operation*2+2;
11168 12082       al  w3  x3+2      ;
11169 12084       jl.     j0.       ;   goto checkmess;
11170 12086  
11170 12086  h78: jl  w3  g15       ; start(isrpy): check reservation;
11171 12088       bz  w3  x2+8      ;   index:=operation+10;
11172 12090       al  w3  x3+10     ;   goto checkmess;
11173 12092  
11173 12092  ; check message.
11174 12092  ; the message buffer is checked and the content is changed to -
11175 12092  ;   mess+8   command, mode(mess)
11176 12092  ;       +10  first address
11177 12092  ;       +12  last address
11178 12092  ;       +14  channelnumber(mess)
11179 12092  ;       +16  address code<12+command<8+mode
11180 12092  ;       +18  address
11181 12092  ;       +20  character count
11182 12092  ;       +22  index
11183 12092  j0:                    ; checkmess:
11184 12092       rl  w0  x1+a182   ;   if sender.base <> 0 then
11185 12094       se  w0     0      ;   goto result3;
11186 12096       jl         g5     ;   <*sender was relocated*>
11187 12098       rs  w3  x2+22     ;   mess(22):=index;
11188 12100       sl  w3  2         ;   if index<2
11189 12102       sl  w3  14+1      ;   or index>14 or (isrpy and rc8602) then
11190 12104  h74: jl      g5        ;     goto result3;
11191 12106       jl.    (x3+i10.)  ;   goto case index of
11192 12108  i10=k-2
11193 12108       j1                ;     (check1,   2: sscir-sense
11194 12110       j2                ;      check2,   4: sscir-autoload
11195 12112       j4                ;      check4,   6: sscir-restart
11196 12114       j2                ;      check2,   8: sscir-restart (rc8602)
11197 12116       j1                ;      check1,  10: isrpy-sense
11198 12118       j4                ;      check4,  12: isrpy-stop
11199 12120       j3                ;      check3); 14: isrpy-ready
11200 12122  
11200 12122  j1:  al. w1  i8.       ; check1: addr:=addr(dummy status area);
11201 12124       jl.     j5.       ;   goto cont;
11202 12126  
11202 12126  j2:  rl  w1  b19       ; check2:
11203 12128       rl  w0  x1+a10    ;
11204 12130       se  w0  p0        ;   if proc=rc8601 then
11205 12132       jl.     j6.       ;
11206 12134       al  w0  1         ;     size:=1;
11207 12136       rs. w0  x3+i6.    ;
11208 12138       rl  w1  x2+10     ;
11209 12140       al  w0  x1+p2     ;
11210 12142       wa. w1  i1.       ;     first:=first(mess)+rel first;
11211 12144       ds  w1  x2+12     ;     last:=first(mess)+rel last;
11212 12146       ws. w1  i1.       ;     addr:=first(mess);
11213 12148       jl.     j5.       ;     goto cont;
11214 12150  j6:  al  w1  2         ;   else
11215 12152       wa  w1  x2+12     ;
11216 12154       ws  w1  x2+10     ;     size:=2+last-first;
11217 12156       al  w0  x1        ;
11218 12158       ls  w0  -1        ;     size:=size.2*3;
11219 12160       wa  w1  0         ;
11220 12162       rs. w1  x3+i6.    ;
11221 12164       rl  w1  x2+10     ;     addr:= first(mess)
11222 12166       jl.     j5.       ;     goto cont;
11223 12168  
11223 12168  j3:  rl  w0  x2+14     ; check3:
11224 12170       sl  w0  1         ;   if channelno<1
11225 12172       sl  w0  1<8       ;   or channelno>=256 then
11226 12174       jl      g5        ;     goto result3;
11227 12176       rs. w0  i7.       ;   char count(10):=channelno;
11228 12178  j4:  am     (x2+6)     ; check4:
11229 12180       rl  w1  +a17      ;   addr:=first(core(sender));
11230 12182       rs  w1  x2+10     ;   first address:=address;
11231 12184       al  w0  x1+256    ;   last address:=address+max size(:max channelnumber);
11232 12186       rs  w0  x2+12     ;
11233 12188  
11233 12188  ; w1: addr, w2: buffer, w3: index.
11234 12188  j5:  rl. w0  x3+i5.    ; cont:
11235 12190       ba  w0  x2+9      ;   command:=command(index)+mode(mess);
11236 12192       ds  w1  x2+18     ;   mess(16:18):=command, addr;
11237 12194       rl. w0  x3+i6.    ;   char count:=char count(index);
11238 12196       rs  w0  x2+20     ;   mess(20):=char count;
11239 12198       dl. w1  i2.       ;   mask:=mask0;
11240 12200       sl  w3  10        ;   if index>=10 then
11241 12202       dl. w1  i3.       ;     mask:=mask1;
11242 12204       sl  w3  14        ;   if index>=14 then
11243 12206       dl. w1  i4.       ;     mask:=mask2;
11244 12208       jl  w3  g16       ;   check operation;
11245 12210       rl  w1  b19       ;
11246 12212       jl  w3  g17       ;   link operation;
11247 12214                         ;   goto next;
11248 12214  e.
11249 12214  
11249 12214  ; execute operation.
11250 12214  b.j4 w.
11251 12214  
11251 12214  m0:  rl  w3  x2+a142   ; next:  get current sender
11252 12216       sh  w3  0         ;   if -parent then
11253 12218       ac  w3  x3        ;   sender := - sender
11254 12220       rl  w3  x3+a14    ;   get ident(sender);
11255 12222       rs  w3  x1+s0     ;   store current sender ident in device descr;
11256 12224  
11256 12224       rl  w3  x2+22     ;   get index;
11257 12226       sl  w3  4         ;   if -,operation = sense
11258 12228       sl  w3  10        ;   and kind(proc) = sscir (<=>index < 8) then
11259 12230       jl.     j1.
11260 12232       rl  w0  x1+s2
11261 12234       se  w3  4         ;     if index(mess) = autoload then
11262 12236       jl.     j0.
11263 12238       lo  w0  x1+s0     ;     stopped(sender) := 0
11264 12240       lx  w0  x1+s0
11265 12242       rs  w0  x1+s2     ;   else
11266 12244       jl.     j1.
11267 12246  j0:  so  w0 (x1+s0)    ;   if stopped(sender) then
11268 12248       jl.     j1.
11269 12250       al  w0  0
11270 12252       rs  w0  g20       ;     status (mess) := 0
11271 12254       rs  w0  g21       ;       function(mess):=0;
11272 12256           rs w0 g23     ;***
11273 12258       jl.     m3.       ;       goto result1;
11274 12260  j1:  rs  w3  x1+s1     ;   state:=index;
11275 12262       al  w0  2.111<8   ;
11276 12264       la. w0  x3+i5.    ;   operation(mess):=command;
11277 12266       ls  w0  -8        ;
11278 12268       hs  w0  x2+8      ;
11279 12270  
11279 12270  ; setup channelprogram.
11280 12270       dl  w0  x2+18     ;   command(chpg):=command(mess);
11281 12272       ds. w0  i0.+2     ;   addr(chpg):=addr(mess);
11282 12274       rl  w0  x2+20     ;   char count(chpg):=char count(mess);
11283 12276       rs. w0  i0.+4     ;
11284 12278       rl  w3  b19        ;
11285 12280       rl  w3  x3+a10     ; timeout:
11286 12282       rl. w0  i12.       ;
11287 12284       se  w3  p0         ; if kind(rec) = rc8601 then
11288 12286       sn  w3  p1         ; timeout:= 120 m.sec else
11289 12288       jl.     j2.        ; timeout:= 15 m.sec;
11290 12290       rl. w0  i13.       ;
11291 12292  j2:  rs. w0  i11.
11292 12294  
11292 12294  ; start channelprogram.
11293 12294  ; if the device is isrpy the device addr in the call must have value
11294 12294  ; io device number + 1.
11295 12294       rl  w3  x1+a235   ;     iodev addr:=iodev addr(proc);
11296 12296       al  w0  1<2+1     ;   function select:=start chpg, standard return;
11297 12298       al. w1  i0.       ;   start:=start of chpg;
11298 12300       jd      1<11+100  ;   start io;
11299 12302           rs w0 g23     ;***
11300 12304       se  w0  2         ;   if io-result<>2 then
11301 12306       jl.     m4.       ;     goto result3;
11302 12308       ld  w0  -100      ; sender stopped:
11303 12310       ds  w0  g21       ;   status, function:=0,0;
11304 12312       jl.     m3.       ;   goto result1;
11305 12314  e.
11306 12314  
11306 12314  
11306 12314  ; after interrupt.
11307 12314  b.j6 w.
11308 12314  c38:                   ; service int(sscir):
11309 12314  c39:                   ; service int(isrpy):
11310 12314       rl  w0  x1+s1     ;
11311 12316       sn  w0  0         ;   if state=0 then
11312 12318       jl.     j3.       ;     goto get next;
11313 12320       rl  w3  x1+a230+6 ;
11314 12322       rl  w0  x1+a230+2 ;   status(answer):=event status(std status);
11315 12324       ds  w0  g21       ;   function(answer):=rem char count(std status);
11316 12326       rl  w3  x1+a230+4 ;   unitno<18+exf addr(answer):=curr status(std status);
11317 12328       rs  w3  g22       ;
11318 12330       rl  w3  x1+a244   ;
11319 12332           rs w3 g23     ;***
11320 12334       se  w3  0         ;   if io-result<>ok then
11321 12336       jl.     j0.       ;     goto error;
11322 12338       se  w0  2         ;   if function=2 then
11323 12340       jl.     m3.
11324 12342       rl  w0  x1+s2     ;     stopped(sender):= 1;
11325 12344       lo  w0  x1+s0
11326 12346       rs  w0  x1+s2
11327 12348  
11327 12348  ; return answer to sender of messsage.
11328 12348  m3:  am      1-3       ; result1: result:=1;
11329 12350  m4:  am      3-4       ; result3: result:=3;
11330 12352  m5:  al  w0  4         ; result4: result:=4;
11331 12354           rl w3 x2+16   ;***
11332 12356           rs w3 g24     ;***
11333 12358       jl  w3  g19       ;   deliver result;
11334 12360       al  w0  0         ;
11335 12362       rs  w0  x1+s1     ;   state:=ready;
11336 12364  j3:  jl  w3  g25       ; getnext: next operation;
11337 12366       jl.     m0.       ;   goto next;
11338 12368  
11338 12368  ; after io-error.
11339 12368  j0:  rl  w0  x1+s2     ; error:
11340 12370       lo  w0  x1+s0     ;   stopped(sender):= 1;
11341 12372       rs  w0  x1+s2
11342 12374       sn  w3  6         ;   if io-result=6 then
11343 12376       jl.     j2.       ;     goto power up;
11344 12378       se  w3  3         ;   if io-result<>3 then
11345 12380       jl.     m5.       ;     goto result4;
11346 12382  j1:  am      -1+2      ; timeout: function:=-1;
11347 12384  j2:  al  w0  -2        ; power up: function:=-2;
11348 12386       al  w3  0         ;
11349 12388       ds  w0  g21       ;   status:=0;
11350 12390       jl.     m3.       ;   goto result1;
11351 12392  e.
11352 12392  
11352 12392  e.                     ; end of rc8601.
11353 12392  
11353 12392  z.
11354 12392  
11354 12392  h72=g2, h74=g2, h76=g2, h78=g2
11355 12392  \f


11355 12392  
11355 12392  m.
11355 12392                  mondisc - disc driver 17.0 beta

11356 12392  ;--------------------------------------------------------------------------
11357 12392  ;                      REVISION HISTORY 
11358 12392  ;--------------------------------------------------------------------------
11359 12392  ; DATE      TIME OR            DESCRIPTION
11360 12392  ;           RELEASE
11361 12392  ;--------------------------------------------------------------------------
11362 12392  ;88.03.24 14.1A HSI  start of description
11363 12392  ;                      regret csp-att mess when ifp is reset
11364 12392  ;                      connect csp-terminals and -printers: set kind
11365 12392  ;                      ifp-mess disconnect:  dont disconnect the mainprocess
11366 12392  ;                      ifp-mess setmask: dont send operation to ifp
11367 12392  ;                      ifp-mess copy: check that w1 is a legal address
11368 12392  ;                      ifp-interrupt disconnect csp-terminal: send att-mess to user of remoter
11369 12392  ;                      ifp-interrupt csp-attention: if terminal reserved then ignore
11370 12392  ;
11371 12392  ;                      ----- " -------- " --------: if att-receiver is unknown 
11372 12392  ;                      then send 6<12+1 operation to adp
11373 12392  ; 
11374 12392  ;88.04.19  15.0  TSH   mainprocess driver/interrupt rewritten for RC9000.
11375 12392  ;88.05.04  10.0  KAK   power interrupt at ifpmain cause return at once to
11376 12392  ;                      driverproc's wait event
11377 12392  ;88.05.16  13.21 kak   reset ifp/ida re-inserted with a few modification
11378 12392  ;88.06.20  10.15 TSH   sspmain included
11379 12392  ;88 06 24 20.06  hsi   max transfer in ifp devices set to 32000
11380 12392  ;88 08 08  14.17 kak   sense operation to ifpmain  inserted
11381 12392  ;88 08 16 14.43  hsi   timeout on main operations
11382 12392  ;88 09 05 12.47  hsi   ifp mess: connect: start search for free linkproc
11383 12392  ;                      from the highest devicenumber
11384 12392  ;                      csp-term: set base on link when created.
11385 12392  ;88 09 14 14.19  hsi   monitor must send a hard reset not a soft
11386 12392  ;88 09 15 15.14        IFP/ADP: change default timeout to 60 sec.
11387 12392  ;88 11 24 13.31  kak      -     timeout value inserted in sense message.mess_3
11388 12392  ;89 01 30 07.51  kak   tape state inserted after answer create link
11389 12392  ;89 03 08 09.33  kak   at interrupt received, the queue of waiting operation are checked
11390 12392  ;                      before return to driverproc.wait_event
11391 12392  ;                      if the interrupt is delivered from a IOC/LAN controller
11392 12392  ;89 03 15 15.28 kak    decrease no_of_outstanding at commen end in driverprocs nterrupt procedure
11393 12392  ;                      two new testpoint inserted in timeout and power interrup;89 03 17 11.20 kak    no_of_outstanding is set to one after reset, it will be decreased at commen end
11394 12392  ;89 03 26 10 21 kak    when driverproc receive an attention message from a controller, it is checked that
11395 12392  ;                      driverproc.bufferclaim > 5 before the message is sent to the receiver,
11396 12392  ;                      otherwise only the answer to the controller is sent
11397 12392  ;--------------------------------------------------------------------------
11398 12392  ;                      START OF RELEASE 16.0
11399 12392  ;89 04 11 13.38 hsi    unlink logical disk not allowed if part of logical vol.
11400 12392  ;89 04 26 12.12  hsi   check name in createlink from lan (correction from 15.1)
11401 12392  ;89 05 02 14.48 hsi    insert procfunc as user of new terminal link (15.1)
11402 12392  ;--------------------------------------------------------------------------
11403 12392  ;90 05 30 11.40 kak    START OF RELEASE 17.0
11404 12392  ;90 05 30 11.40 kak    prepare dump excluded
11405 12392  ;90 08 09 13.12 kak    the two attention events testbuffer full and error correction performed included as legal events
11406 12392  ;90 10 12 1.14 kak     when excluding preparedump set timeout(ida/ifp) was excluded too this is corrected
11407 12392  
11407 12392  b.i30 w.
11408 12392  i0=90 08 09 
11409 12392  i1=13 14 00 
11410 12392  ;
11411 12392  ; if newtime (i0,i1) > oldtime (a133,a134) then oldtime:=newtime;
11412 12392  c.i0-a133
11413 12392    c.i0-a133-1, a133=i0, a134=i1, z.
11414 12392    c.i1-a134-1,          a134=i1, z.
11415 12392  z.
11416 12392  
11416 12392  i10=i0, i20=i1
11417 12392  
11417 12392  i15=i10/100000 , i10=i10-i15*100000 , i25=i20/100000 , i20=i20-i25*100000 
11418 12392  i14=i10/10000  , i10=i10-i14*10000  , i24=i20/10000  , i20=i20-i24*10000 
11419 12392  i13=i10/1000   , i10=i10-i13*1000   , i23=i20/1000   , i20=i20-i23*1000
11420 12392  i12=i10/100    , i10=i10-i12*100    , i22=i20/100    , i20=i20-i22*100
11421 12392  i11=i10/10     , i10=i10-i11*10     , i21=i20/10     , i20=i20-i21*10
11422 12392  
11422 12392  i2:  <:                              date  :>
11423 12416       (:i15+48:)<16+(:i14+48:)<8+46
11424 12418       (:i13+48:)<16+(:i12+48:)<8+46
11425 12420       (:i11+48:)<16+(:i10+48:)<8+32
11426 12422  
11426 12422       (:i25+48:)<16+(:i24+48:)<8+46
11427 12424       (:i23+48:)<16+(:i22+48:)<8+46
11428 12426       (:i21+48:)<16+(:i20+48:)<8+ 0
11429 12428  
11429 12428  i3:  al. w0  i2.       ; write date:
11430 12430       rs  w0  x2+0      ;   first free:=start(text);
11431 12432       al  w2  0         ;
11432 12434       jl      x3        ;   return to slang(status ok);
11433 12436  
11433 12436       jl.     i3.       ;
11434 12438  e.
11435 12438  j.
11435 12392                                date  90.08.09 13.14.00

11436 12392  
11436 12392  
11436 12392  ; ---------------------------------------------------------------
11437 12392  
11437 12392  ;                 d i s c   d r i v e r   c o d e
11438 12392  ;                            (dsc 801)
11439 12392  ;
11440 12392  ;                a r e a   p r o c e s s   c o d e
11441 12392  
11441 12392  ; ---------------------------------------------------------------
11442 12392  
11442 12392  ; this section contains the code executed by driverproc for pro-
11443 12392  ; cessing messages to an area process or a disc driver.
11444 12392  ;
11445 12392  ; messages have the following format:
11446 12392  ;
11447 12392  ; sense          0<12 + mode         initialize 2<12
11448 12392  ;                irrel                          no of heads
11449 12392  ;                irrel                          disp. on odd cyl.
11450 12392  ;                irrel                          disctype
11451 12392  ;
11452 12392  ; clean track    6<12 + mode         position   8<12 + mode
11453 12392  ;                irrel                          irrel
11454 12392  ;                irrel                          irrel
11455 12392  ;                segment no                     segment no
11456 12392  ;
11457 12392  ; read           3<12 + mode         write      5<12 + mode
11458 12392  ;                first address                  first address
11459 12392  ;                last address                   last address
11460 12392  ;                first segment no               first segment no
11461 12392  ;
11462 12392  ; get statistics 9<12 
11463 12392  ;                first address
11464 12392  ;                last address
11465 12392  ;                irrel
11466 12392  ;
11467 12392  ; set regretted  10<12                continue  12<12   ; (used by testprograms) 
11468 12392  ;                irrel                          irrel
11469 12392  ;                irrel                          irrel
11470 12392  ;                irrel                          irrel
11471 12392  ; mode consists of a sum of one or more of following values:
11472 12392  ;
11473 12392  ; transput mode     0 transput of data
11474 12392  ;                   1 transput of address marks
11475 12392  ; error recovery    0 repeat at error
11476 12392  ;                   2 do not repeat at error
11477 12392  ; requeue           4 answer message after best repetitions
11478 12392  ;                   0 requeue message after best repetitions
11479 12392  ;                     and try later again
11480 12392  ; read after write  0 no read after write
11481 12392  ;                   8 read after write mode
11482 12392  ;
11483 12392  ; disctype 0 = dsm801, disctype 1 = dsm802 with variable offset.
11484 12392  ;
11485 12392  ; the answer to a message has the following format:
11486 12392  ;
11487 12392  ;                statusword
11488 12392  ;                0 or number of bytes transferred
11489 12392  ;                0 or number of chars transferred
11490 12392  ;                i/o result, from start i/o
11491 12392  ;                current status from controller
11492 12392  ;                event status from controller
11493 12392  ;                technical status from controller
11494 12392  ;
11495 12392  ; the following bits may be set in a statusword:
11496 12392  ;
11497 12392  ; bit  0 intervention, no disc driver at area process message
11498 12392  ; bit  1 parity      , event status bit 1 or 4 (data-, hard err.)
11499 12392  ; bit  2 sync.error  , event status bit 5 (position error)
11500 12392  ; bit  3 data overrun, event status bit 3 (data overrun)
11501 12392  ; bit  4 blocklength , buffer too small at get statistics
11502 12392  ; bit  5 end medium  , 1st segm outside or curr stat b5 (seek err)
11503 12392  ; bit 11 discerror   , requeue mode = 4 and repetitions < max
11504 12392  ;
11505 12392  ; the message may be sent to an area process, a logical disc
11506 12392  ; driver (one physical disc may be split into more logical devi-
11507 12392  ; ces) or to a physical disc driver. in either case the message is
11508 12392  ; linked to the physical driver unless it concerns an area on a
11509 12392  ; remote disc, in which case the code for processing such messages
11510 12392  ; is entered.
11511 12392  ;
11512 12392  ; initialize, clean track, and write addr mark can only be sent to
11513 12392  ; a reserved physical disc driver. get statistics can only be sent
11514 12392  ; to a disc driver.
11515 12392  ;
11516 12392  ; segment numbers in message correspond to absolute segments
11517 12392  ; when sent to a physical driver, to segmentno relative to start
11518 12392  ; of logical disc when sent to a logical driver, and relative
11519 12392  ; to areastart when sent to an area process.
11520 12392  ;
11521 12392  ; before linking the message to the physical disc driver it is
11522 12392  ; reformatted and will contain sufficient information for exe-
11523 12392  ; cuting the first part of the transfer corresponding to the
11524 12392  ; largest number of consecutive segments starting at first seg-
11525 12392  ; ment wanted. the buffer is updated at each portion of conse-
11526 12392  ; cutive segments transferred until the entire number of segments
11527 12392  ; have been transferred.
11528 12392  ;
11529 12392  ; when the message is linked to the physical driver it is not
11530 12392  ; possible to see if it was sent to an area process or directly
11531 12392  ; to a driver. however, when sent to a driver, all segments
11532 12392  ; wanted can be processed in the first transfer, whereas an
11533 12392  ; area process message may be processed in more transfers as
11534 12392  ; the slices of an area need not be consecutive.
11535 12392  ;
11536 12392  ; the driver will automatically examine the number of heads on
11537 12392  ; the disc, the displacement of sector zero on odd cylinders,
11538 12392  ; and the disctype (dsm801-2) when the first message (after
11539 12392  ; intervention) is received unless this first message is the
11540 12392  ; initialize message.
11541 12392  \f


11541 12392  
11541 12392  
11541 12392  ; pej 04.10.77    disc driver, contents
11542 12392  
11542 12392  ; c o n t e n t s
11543 12392  ; ---------------------------------------------------------------
11544 12392  
11544 12392  ; definitions
11545 12392  ; -----------
11546 12392  ;
11547 12392  ; constant definitions
11548 12392  ; format of transformed message
11549 12392  ; process description format
11550 12392  ;
11551 12392  ; main routines ( in sequential order)
11552 12392  ; -------------
11553 12392  ;
11554 12392  ; message received by area process
11555 12392  ; message received by disc driver
11556 12392  ; link message to disc driver
11557 12392  ; message not accepted
11558 12392  ;
11559 12392  ; process next message
11560 12392  ; start device
11561 12392  ;
11562 12392  ; interrupt received
11563 12392  ; successful transfer
11564 12392  ; deliver answer routines
11565 12392  ;
11566 12392  ; error routine
11567 12392  ;
11568 12392  ; procedures (in alphabetical order)
11569 12392  ; ----------
11570 12392  ;
11571 12392  ; check area process
11572 12392  ; check message
11573 12392  ; clean
11574 12392  ; compound status
11575 12392  ; copy statistics
11576 12392  ; correct data
11577 12392  ; initialize disc
11578 12392  ; prepare consecutive segments
11579 12392  ; setup channel program and start
11580 12392  ; set errorkind
11581 12392  ; set result and status
11582 12392  ; transform first segment
11583 12392  ; update buf
11584 12392  ; update buf on error
11585 12392  ; update on corrected error
11586 12392  ; update retryinformation
11587 12392  
11587 12392  b. j170, m10, p50, q70 ; disc driver and area process
11588 12392  \f


11588 12392  
11588 12392  
11588 12392  ; pej 30.09.77    disc driver, constant definitions
11589 12392  
11589 12392  ; c o n s t a n t   d e f i n i t i o n s
11590 12392  ; ---------------------------------------------------------------
11591 12392  
11591 12392  ; operation codes, control = even, transput = odd codes. if the
11592 12392  ; codes are changed, also a table in proc setup channel program
11593 12392  ; and start must be changed as well as error segment table
11594 12392  ; updating in action 7a of error actions and proc. update buf.
11595 12392  q30 = 0                 ; sense
11596 12392  q31 = 2                 ; initialize
11597 12392  q32 = 3                 ; read
11598 12392  q33 = 5                 ; write
11599 12392  q34 = 6                 ; clean track
11600 12392  q35 = 8                 ; position
11601 12392  q36 = 9                 ; get statistics
11602 12392  q39 = 10                ; set regretted
11603 12392  q38 = 12                ; continue
11604 12392  
11604 12392  ; mode codes
11605 12392  q40 =     1             ; transput mode, = addr mark mode
11606 12392  q41 = 1 < 1             ; error recovery, = no repetition
11607 12392  q42 = 1 < 2             ; requeue, = do not reque
11608 12392  q43 = 1 < 3             ; read after write, = true
11609 12392  
11609 12392  ; segment units
11610 12392  q50 = 8                 ; no of bytes per addr mark
11611 12392  q51 = 12                ; -  -  chars -   -    -
11612 12392  q52 = 512               ; -  -  bytes -   data segment
11613 12392  q53 = 768               ; -  -  chars -   -    -
11614 12392  
11614 12392  ; process kinds
11615 12392  q60 = 84                ; subproc
11616 12392  q61 = 62                ; disc driver
11617 12392  
11617 12392  ; power restart parameters (time units: 0.1 msec)
11618 12392  q10 =  1 * 1000 * 10    ; time between sense in power rest. loop
11619 12392  q11 = 40 * 1000 * 10    ; maxtime to become ready at power rest.
11620 12392  q12 = q10               ; -       -  -      -     -  -     down
11621 12392  q13 = q11 / q10 + 1     ; no of times to sense at power restart
11622 12392  q14 = q12 / q10 + 1     ; no of times to sense at power down
11623 12392  q15 = 500               ; no of times to repeat at data overrun
11624 12392  
11624 12392  ; no of times to repeat at error
11625 12392  ; repeats = 3           ; not defined as a constant due to imple-
11626 12392                          ; mentation details. to change strategy,
11627 12392                          ; correct proc update retryinformation
11628 12392                          ; and action 8a and 10 in error routine.
11629 12392  
11629 12392  ; assembly options
11630 12392  q0  = (:a80>1a.1:)-1    ; disc driver included, 0=yes, -1=no
11631 12392  q1  = (:a82>1a.1:)-1    ; statistics included, 0=yes, -1=no
11632 12392  q2  = 10                ; no of entries in error segment table
11633 12392  \f


11633 12392  
11633 12392  ; pej 04.10.77    disc driver, format of transformed message
11634 12392  
11634 12392  ; f o r m a t   o f   t r a n s f o r m e d   m e s s a g e
11635 12392  ; ---------------------------------------------------------------
11636 12392  
11636 12392  ; format of messagebuffer when linked to driver (after checking)
11637 12392  m0  = a145, m1 = m0+1   ; operation      , mode
11638 12392  m2  = m1+1,             ; first address
11639 12392  m3  = m2+2              ; last address
11640 12392  m4  = m3+2              ; first segment
11641 12392  m5  = m4+2, m6 = m5+1   ; no of segments , retryinformation
11642 12392  m7  = m6+1              ; next segment
11643 12392  m8  = m7+2, m9 = m8+1   ; segments wanted, remaining segments
11644 12392  m10 = m9+1              ; device
11645 12392  ; operation  : not changed
11646 12392  ; mode       : not changed
11647 12392  ; firstaddr  : in curr transfer
11648 12392  ; lastaddr   : not changed, used by start i/o for checking
11649 12392  ; first segm : in curr transfer, rel. to start of disc
11650 12392  ; no of segms: in curr transfer
11651 12392  ; retryinf   : at read data, read addr mark:
11652 12392  ;                 modeindex<8 + offsetindex<3 + tries
11653 12392  ;                 modeindex  : index to modetable
11654 12392  ;                 offsetindex: index to offset table
11655 12392  ;                 tries      : no of tries at given modeindex
11656 12392  ;                              and offset index
11657 12392  ;              at read after write:
11658 12392  ;                 writetries<3 + readtries
11659 12392  ;                 writetries: no of times write has been tried
11660 12392  ;                 readtries : no of times read has been tried
11661 12392  ;                             after a write
11662 12392  ;              at other operations:
11663 12392  ;                 no of times the transfer has been tried
11664 12392  ; next segm  : will be first segment in next transfer
11665 12392  ; segms want : total no of segments wanted by sender
11666 12392  ; rem segms  : no of segments remaining to be transferred
11667 12392  ; device     : addr of disc driver containing sliceinformation
11668 12392  ;              and physical segment no of first segment
11669 12392  \f


11669 12392  
11669 12392  ; pej 04.10.77    disc driver, proc descr format
11670 12392  
11670 12392  ; p r o c e s s   d e s c r i p t i o n   f o r m a t
11671 12392  ; ---------------------------------------------------------------
11672 12392  
11672 12392  ; variables required for physical and logical disc.
11673 12392      ; a250    ; driver descr addr
11674 12392      ; a48     ; interval
11675 12392      ; a49     ; -
11676 12392      ; a10     ; kind
11677 12392      ; a11     ; name
11678 12392  p2  = a50     ; mainproc, phys.=0, log.=addr of physical
11679 12392      ; a52     ; reserver
11680 12392      ; a53     ; users
11681 12392      ; a54     ; next message
11682 12392      ; a55     ; last message
11683 12392      ; a56     ; regretted, often called interrupt address
11684 12392      ; a70     ; not used
11685 12392  p0  = a71     ; chaintable
11686 12392  p1  = a72     ; slicelength
11687 12392  p3  = p1+2    ; first segment, phys.=0, log.= segm no of log. 0
11688 12392  p4  = p3+2    ; no of segments, phys.=on disc, log.=on log. disc
11689 12392  
11689 12392  ; disc characteristics (only required for physical disc).
11690 12392  p6  = p4+2    ; no of segments per track
11691 12392  p7  = p6+2    ; flags, used in address marks
11692 12392  p8  = p7+2    ; no of segments per cylinder (set by driver)
11693 12392  p10 = p8      ; cylinder, used during define disc
11694 12392  p9  = p8+2    ; displ. of sector 0 on odd cyl. (set by driver)
11695 12392  p11 = p9      ; head, used during define disc
11696 12392  p5  = p9+2    ; disctype, 0=dsm801, 1=dsm802 (var.offset)
11697 12392  
11697 12392  ; variables concerning state of disc (only physical disc).
11698 12392  p12 = p5+2    ;state, 0=after intervention, 1=defining disc,
11699 12392                ;   2=ready
11700 12392  p13 = p12+2   ; transfer state, kind of transfer in progress
11701 12392                ;   bit 0 = idle (initial state)
11702 12392                ;       1 = define disc
11703 12392                ;       2 = power restart
11704 12392                ;       3 = sense
11705 12392                ;       4 = position
11706 12392                ;       5 = clean track
11707 12392                ;       6 = read data
11708 12392                ;       7 = read addr mark
11709 12392                ;       8 = write data
11710 12392                ;       9 = write addr mark
11711 12392                ;      10 = read after write data
11712 12392                ;      11 = read after write addr mark
11713 12392  p14 = p13+2   ; initdisc, 1=init at next start, 0=no
11714 12392  p15 = p14+1   ; retryinformation, used at driver initiated
11715 12392                ;   transfers; see m6 of message buffer
11716 12392  
11716 12392  ; areas used by channelprograms (only physical disc).
11717 12392  p16 = p15+1   ; statusarea1, statusarea for first sense
11718 12392                ; +0 : channel program counter
11719 12392                ; +2 : remaining bytecount
11720 12392                ; +4 : current status
11721 12392                ; +6 : event status
11722 12392                ; +8 : last read addr mark (4 words)
11723 12392                ; +16: ecc, error correction information (2 words)
11724 12392                ; +20: technical status
11725 12392  p18 = p16+22  ; statusarea2, statusarea for second sense, for-
11726 12392                ;   matted as statusarea1
11727 12392  p22 = p18+8   ; addr mark, input area at define disc (4 words)
11728 12392  p36 = p18+16  ; actionkey, used in error actions
11729 12392  p37 = p18+18  ; actionindex, used in error actions
11730 12392  p38 = p18+20  ; write ok, used at read after write error
11731 12392  p20 = p18+22  ; seek parameter
11732 12392                ; +0: cylinder<8 + head
11733 12392                ; +2: sector<16 + flags
11734 12392  p21 = p20+4   ; setmode parameter, bit16-17:strobe,
11735 12392                ;   bit18-19:offset, bit20-23:offset magnitude
11736 12392                ;   (set to zero if strobe-offset not used)
11737 12392  
11737 12392  ; other variables (only physical disc).
11738 12392  p31 = p21+2   ; +0: curr status  (sum of all statusareas)
11739 12392                ; +2: event status (-   -  -   -          )
11740 12392  p33 = p31+4   ; technical status (-   -  -   -          )
11741 12392  p34 = p33+2   ; compound status, formed from p31,p32,i/o result
11742 12392  p35 = p34+2   ; segment unit in curr transfer:
11743 12392                ; +0: bytes per segment
11744 12392                ; +2: chars per segment
11745 12392  
11745 12392  ; statistical information (only physical disc).
11746 12392  p40 = p35+4   ; no of transfers
11747 12392  p41 = p40+2   ; no of transfers not successful in first attempt
11748 12392                ;   (intervention, power restart, power down,
11749 12392                ;    write protect are not counted)
11750 12392  p42 = p41+2   ; no of errors corrected by ecc without repetition
11751 12392  p43 = p42+2   ; no of errors corrected within 3 retries
11752 12392                ; strobe offset table, no of errors corrected by:
11753 12392  p44 = p43+2   ;   strobe 0 & offset n , strobe 0 & offset p
11754 12392                ;                       , strobe l & offset 0
11755 12392                ;   strobe l & offset n , strobe l & offset p
11756 12392                ;                       , strobe e & offset 0
11757 12392                ;   strobe e & offset n , strobe e & offset p
11758 12392                ;   (e=early, l=late, p=positive, n=negative)
11759 12392  p45 = p44+10  ; no of errors corrected by offset magnitude  -,  1
11760 12392                ;                                             2,  3
11761 12392                ;                                             4,  5
11762 12392                ;                                             .   .
11763 12392                ;                                             .   .
11764 12392                ;                                            14, 15
11765 12392                ;   (first byte not used, magnitude 0 unexistent)
11766 12392  p47 = p45+16  ; counters for compound status bit  0, 1
11767 12392                ;                                   2, 3
11768 12392                ;                                   .  .
11769 12392                ;                                   .  .
11770 12392                ;                                  22,23
11771 12392  p48 = p47+24  ; counters for technic. status bit  0, 1
11772 12392                ;                                   2, 3
11773 12392                ;                                   .  .
11774 12392                ;                                   .  .
11775 12392                ;                                  22,23
11776 12392  p46 = p48+24  ; table of error segments, an entry contains
11777 12392                ; +0: segment no. (physical)
11778 12392                ; +2: no of reads ok   +3: no of reads with rep.
11779 12392                ; +4: no of writes ok  +5: no of writes with rep.
11780 12392  p50=p46+q2*6-p40; size of statistics in bytes
11781 12392  
11781 12392  ; ***** please note that:
11782 12392  ;       - declarations of p10 and p8 are equal.
11783 12392  ;       - declarations of p11 and p9 are equal.
11784 12392  ;       - p22, p36, p37, and p38 are declared inside p18.
11785 12392  ;       conflicts in use will not occur as overlapping locations
11786 12392  ;       are not used simultanously.
11787 12392  \f


11787 12392  
11787 12392  
11787 12392  ; pej 21.09.77    area process, message received
11788 12392  
11788 12392  ; m e s s a g e   r e c e i v e d   b y   a r e a   p r o c e s s
11789 12392  ; ---------------------------------------------------------------
11790 12392  
11790 12392  m.
11790 12392                  area process

11791 12392  
11791 12392  ; this routine is entered when driverproc receives a message for
11792 12392  ; an area process. curr receiver (b19) = area process descr.
11793 12392  
11793 12392  b. i10 w.               ; block containing area proc driver
11794 12392  
11794 12392  ; check if sender ok and if specified operation legal.
11795 12392  h5  : bz  w0  x2+m0     ; area process: c. w2 = curr buf;
11796 12394        sn  w0     q33    ;   if operation.curr buf = output
11797 12396        am         g15-g14;   then check reservation
11798 12398        jl  w3     g14    ;   else check user;
11799 12400        dl. w1     i0.    ;
11800 12402        jl  w3     g16    ;   check operation(oper mask,mode mask);
11801 12404  
11801 12404  ; check the area process.
11802 12404        jl. w3     j1.    ;   check area process;
11803 12406        jl.        j37.   ;   if area segms < 0 then goto outside;
11804 12408        jl.        j35.   ;   if no doc then goto doc not found;
11805 12410  
11805 12410  ; now curr receiver = disc driver (physical or logical). check
11806 12410  ; if the disc is a remote disc or that disc driver included.
11807 12410        rs  w1  x2+m7     ;   save area process addr in curr buf;
11808 12412        rl  w0  x3+a10    ;
11809 12414        la  w0     g50    ;
11810 12416        se  w0     q60    ;   if kind.curr receiver = subproc then
11811 12418        jl.        i10.   ;   begin c. remote disc;
11812 12420        rs  w1  x3+a56    ;      interrupt addr.curr rec:= area proc;
11813 12422        jl.       (2), h84;      goto subproc driver;
11814 12426  i10 :                   ;   end;
11815 12426        c.        -q0-1   ;   if disc driver not included
11816 12426        jl         g3     ;   then goto result 5; c. unknown;
11817 12426        z.                ;
11818 12426        c.         q0     ;
11819 12426  
11819 12426  ; check contents of the message
11820 12426        rl  w0  x1+a61    ;   top:= no of segments.area proc;
11821 12428        al  w1     q52    ;   bytes:= no of bytes in data segments;
11822 12430        jl. w3     j2.    ;   check message(top,bytes);
11823 12432        jl.        j37.   ;   if outside then goto outside;
11824 12434  
11824 12434  ; convert first segment into a segment no relative to discstart
11825 12434  ; and prepare first portion of consecutive segments
11826 12434        bz  w0  x2+m0     ;
11827 12436        sn  w0     q30    ;   if operation.curr buf <> sense then
11828 12438        jl.        j30.   ;   begin
11829 12440        rl  w1  x2+m7     ;     area proc:= saved area proc;
11830 12442        jl. w3     j3.    ;     transform first segm(area proc);
11831 12444        bz  w0  x2+m0     ;
11832 12446        se  w0     q35    ;     if operation.curr buf <> position
11833 12448        jl. w3     j4.    ;     then prepare consec segms(curr rec);
11834 12450                          ;   end;
11835 12450        jl.        j30.   ;   goto link message;
11836 12452        z.                ;
11837 12452  
11837 12452  ; legal mode combinations:
11838 12452  ;          read after write
11839 12452  ;              requeue
11840 12452  ;                  error recovery
11841 12452  i1  = a0>(:        q41:)
11842 12452  i2  = a0>(:    q42    :)
11843 12452  i3  = a0>(:    q42+q41:)
11844 12452  i4  = a0>(:q43        :)
11845 12452  i5  = a0>(:q43    +q41:)
11846 12452  i6  = a0>(:q43+q42    :)
11847 12452  i7  = a0>(:q43+q42    :)
11848 12452  
11848 12452  ; oper and mode masks for area process message
11849 12452        a0>q30+a0>q32+a0>q33+a0>q35
11850 12454                          ; oper mask: sense, read, write, pos.
11851 12454  i0  : a0>0+i1+i2+i3+i4+i5+i6+i7
11852 12456                          ; mode mask: no addr mark transput
11853 12456  
11853 12456  e.                      ; end of area process driver
11854 12456  \f


11854 12456  ; pej 21.09.77    disc driver, message received
11855 12456  
11855 12456  ; m e s s a g e   r e c e i v e d   b y   d i s c   d r i v e r
11856 12456  ; ---------------------------------------------------------------
11857 12456  
11857 12456  b. i50 w.               ; block including disc driver
11858 12456  h6  :                   ;
11859 12456                          ;
11860 12456        c.         q0     ;
11861 12456  m.
11861 12456                  dsc 801

11862 12456  
11862 12456  ; this routine is entered when driverproc receives a message for
11863 12456  ; a disc driver. curr receiver (b19) = (logical or physical) disc
11864 12456  ; driver process description.
11865 12456  
11865 12456  ; check if sender ok and if specified operation legal
11866 12456        bz  w0  x2+m0     ; disc driver: c. w2 = curr buf;
11867 12458        sn  w0     q33    ;   if operation.curr buf = output
11868 12460        jl.        j20.   ;
11869 12462        se  w0     q31    ;   or operation.curr buf = initialize
11870 12464        sn  w0     q34    ;   or operation.curr buf = clean track
11871 12466  j20 : am         g15-g14;   then check reservation
11872 12468        jl  w3     g14    ;   else check user;
11873 12470        dl. w1     i0.    ;   use oper/mode mask for phys. driver;
11874 12472        am        (b19)   ;
11875 12474        rl  w3     p2     ;
11876 12476        sn  w3     0      ;   if mainproc.curr receiver <> 0 then
11877 12478        jl.        j25.   ;   begin c. logical disc driver;
11878 12480        rl. w0     i1.    ;     use oper mask for logical driver;
11879 12482        bz  w3  x2+m0     ;     if operation.curr buf = output
11880 12484        sn  w3     q33    ;     then use  mode mask for output;
11881 12486        rl. w1     i2.    ;   end;
11882 12488  j25 : jl  w3     g16    ;   check operation(oper mask,mode mask);
11883 12490  ; check if message is continnue.
11884 12490  ; such a message should not be linked up to the physical driver.
11885 12490  ; if regretted is set by the command "set regretted " the message 
11886 12490  ; is answered ok and the physical disc is started in rutine process
11887 12490  ; next message. otherwise the message is answered with result 3 and 
11888 12490  ; and no action is performed.
11889 12490  
11889 12490        bz  w3  x2+m0     ; if operation.curr buf = continue then
11890 12492        se  w3     q38    ; begin
11891 12494        jl.        j28.   ; if regretted not set by "set regret"
11892 12496        am        (b19)   ; ( regretted.curr receiver=3)
11893 12498        rl  w1    +a56    ; then deliver result 3 else
11894 12500        se  w1     3      ; deliver result 1 and continue with 
11895 12502        jl         g5     ; process next message
11896 12504        jl.        j101.  ; end 
11897 12506  
11897 12506  ; check contents of the message
11898 12506  j28 : bz  w0  x2+m1     ;
11899 12508        al  w1     q52    ;   if transput mode.curr buf = 0
11900 12510        sz  w0     q40    ;   then bytes:= bytes in data segments
11901 12512        al  w1     q50    ;   else bytes:= bytes in addr marks;
11902 12514        am        (b19)   ;
11903 12516        rl  w0     p4     ;   top:= no of segments.curr receiver;
11904 12518        jl. w3     j2.    ;   check message(top,bytes);
11905 12520        jl.        j37.   ;   if outside then goto outside;
11906 12522        jl.        j30.   ;   goto link message;
11907 12524  
11907 12524  ; legal mode combinations:
11908 12524  ;          read after write
11909 12524  ;              requeue
11910 12524  ;                  error recovery
11911 12524  ;                      transput of addr marks
11912 12524  i3  = a0>(:            q40:)
11913 12524  i4  = a0>(:        q41    :)
11914 12524  i5  = a0>(:        q41+q40:)
11915 12524  i6  = a0>(:    q42        :)
11916 12524  i7  = a0>(:    q42    +q40:)
11917 12524  i8  = a0>(:    q42+q41    :)
11918 12524  i9  = a0>(:    q42+q41+q40:)
11919 12524  i10 = a0>(:q43            :)
11920 12524  i11 = a0>(:q43        +q40:)
11921 12524  i12 = a0>(:q43    +q41    :)
11922 12524  i13 = a0>(:q43    +q41+q40:)
11923 12524  i14 = a0>(:q43+q42        :)
11924 12524  i15 = a0>(:q43+q42    +q40:)
11925 12524  i16 = a0>(:q43+q42+q41    :)
11926 12524  i17 = a0>(:q43+q42+q41+q40:)
11927 12524  
11927 12524  ; get statistics operation only allowed if statistics wanted
11928 12524  c. q1                   ;
11929 12524  i18 = a0>q36            ; statistics wanted
11930 12524  z.                      ;
11931 12524  c. -q1-1                ;
11932 12524  i18 = 0                 ; statistics not wanted
11933 12524  z.                      ;
11934 12524  
11934 12524  ; oper and mode masks for disc driver message
11935 12524  
11935 12524  ; op: sense  init.  read   write  clean  pos.   stat.  regr.   cont.
11936 12524  i1  : a0>q30       +a0>q32+a0>q33       +a0>q35+i18; logical
11937 12526        a0>q30+a0>q31+a0>q32+a0>q33+a0>q34+a0>q35+i18+a0>q39+a0>q38; physical
11938 12528      ; physical driver modes (all):
11939 12528  i0  : a0>0+i3+i4+i5+i6+i7+i8+i9+i10+i11+i12+i13+i14+i15+i16+i17
11940 12530      ; logical driver modes at output (all except addrmarks):
11941 12530  i2  : a0>0   +i4   +i6   +i8   +i10    +i12    +i14    +i16
11942 12532  \f


11942 12532  
11942 12532  \f


11942 12532  ; pej 22.09.77    disc driver, link message
11943 12532  
11943 12532  ; l i n k   m e s s a g e   t o   d i s c   d r i v e r
11944 12532  ; ---------------------------------------------------------------
11945 12532  
11945 12532  ; this routine is entered when a message received by an area
11946 12532  ; process or a disc driver has been checked. the message is
11947 12532  ; linked to the physical disc driver and curr receiver will
11948 12532  ; be changed accordingly.
11949 12532  ; 
11950 12532  ; please note that the buffer is not claimed by the driver during
11951 12532  ; the processing. the claiming takes place when the answer is re-
11952 12532  ; turned, see procedure deliver result.
11953 12532  
11953 12532  ; change curr receiver into physical driver.
11954 12532  j30 : rl  w1     b19    ; link message: c. w2 = curr buf;
11955 12534        rs  w1  x2+m10    ;   device.curr buf:= curr receiver;
11956 12536        rl  w1  x1+p2     ;   if mainproc.curr receiver <> 0 then
11957 12538        sn  w1     0      ;   begin c. curr rec = logical driver;
11958 12540        jl.        j32.   ;     curr receiver:= mainproc.curr rec;
11959 12542        rs  w1     b19    ;   end;
11960 12544  
11960 12544  ; link the message by calling procedure link operation which
11961 12544  ; will continue in case the driver is idle or otherwise will
11962 12544  ; jump to waitnext in driver proc.
11963 12544  j32 : jl  w3     g17    ;   link operation(curr buf);
11964 12546        jl.        j50.   ;   goto process next message;
11965 12548        z.                ;
11966 12548  \f


11966 12548  ; pej 22.09.77    disc driver, message not accepted
11967 12548  
11967 12548  ; m e s s a g e   n o t   a c c e p t e d
11968 12548  ; ---------------------------------------------------------------
11969 12548  
11969 12548  ; the routines are entered when a message received by an area
11970 12548  ; process or a disc driver can not be accepted. the message
11971 12548  ; is answered and continuation takes place at waitnext in driver
11972 12548  ; proc.
11973 12548  
11973 12548  j35 : rl  w0     g49    ; document not found:
11974 12550        jl.        j41.   ;   status:= bit 0; c. intervention;
11975 12552  
11975 12552  j37 : rl  w0     g62    ; outside:
11976 12554                          ;   status:= bit 5; c. end medium;
11977 12554  
11977 12554  j41 : rs  w0     g20    ;   status.i/o answer:= status; c. w0;
11978 12556        ld  w1    -100    ;   bytes.i/o answer:=
11979 12558        ds  w1     g22    ;   chars.i/o answer:= 0;
11980 12560        jl         g7     ;   goto result 1; c. cont. at waitnext;
11981 12562  \f


11981 12562  
11981 12562  ; pej 20.09.77    disc driver, check area process
11982 12562  
11982 12562  ; procedure check area process
11983 12562  ; ---------------------------------------------------------------
11984 12562  ;
11985 12562  ; the procedure performs:
11986 12562  ; - checks if no of segments.curr receiver (= area proc) >= 0.
11987 12562  ; - searches for document.curr receiver if device addr.curr
11988 12562  ;   receiver = 0 and initializes device addr.curr receiver.
11989 12562  ; - changes curr receiver to device addr.curr receiver .
11990 12562  ;    (i.e. to disc driver).
11991 12562  ;
11992 12562  ; registers: call              exit
11993 12562  ; w0                           destroyed
11994 12562  ; w1                           area proc (= curr receiver at call)
11995 12562  ; w2                           curr buf
11996 12562  ; w3         link              curr receiver
11997 12562  ;
11998 12562  ; entry    : j1
11999 12562  ;
12000 12562  ; return   : link+0: no of segments.area proc < 0
12001 12562  ;            link+2: document not found
12002 12562  ;            link+4: normal return
12003 12562  b. i2 w.
12004 12562  j1  : rs. w3     i0.    ; check area proc: save link;
12005 12564        rl  w1     b19    ;
12006 12566        rl  w3  x1+a61    ;
12007 12568        sh  w3    -1      ;   if no of segms.curr receiver < 0
12008 12570        jl.       (i0.)   ;   then outside return; c. link;
12009 12572        rl  w3  x1+a50    ;
12010 12574        se  w3     0      ;   if device addr.curr receiver = 0 then
12011 12576        jl.        i1.    ;   begin
12012 12578        al  w2  x1+a62    ;     name:= document.curr receiver;
12013 12580        dl  w1     d72    ;     base:= max interval;
12014 12582        jl  w3     d71    ;     search name(name,entry,base);
12015 12584        rl  w1     b19    ;
12016 12586        sn  w3    (b7)    ;     if entry = nametable end
12017 12588        jl.        i2.    ;     then goto doc not found return;
12018 12590        rl  w3  x3+0      ;     device addr.curr receiver:=
12019 12592        rs  w3  x1+a50    ;     core(entry);
12020 12594  i1  : rl  w2     b18    ;   end;
12021 12596        rs  w3     b19    ;   curr receiver:=device addr.curr receiver;
12022 12598        am.       (i0.)   ;
12023 12600        jl         4      ;   normal return; c. link+4;
12024 12602  i2  : am.       (i0.)   ; doc not found return;
12025 12604        jl         2      ;   goto link+2;
12026 12606  
12026 12606  ; variables
12027 12606  i0  : 0                 ; saved link
12028 12608  e.
12029 12608        c.         q0     ;
12030 12608  \f


12030 12608  ; pej 21.09.77    disc driver, check message
12031 12608  
12031 12608  ; procedure check message(top segment,bytes per segment)
12032 12608  ; ---------------------------------------------------------------
12033 12608  ; top segment      : highest allowed segment no + 1.
12034 12608  ; bytes per segment: no of bytes to be transferred per segment.
12035 12608  ;
12036 12608  ; the procedure performs:
12037 12608  ; - zeroizes retryinformation.curr buf.
12038 12608  ; - checks that 0 <= first segment.curr buf < top segment (not
12039 12608  ;   for sense, initialize, get statistics).
12040 12608  ; - sets segms wanted.curr buf and remaining segms.curr buf
12041 12608  ;   and no of segments.curr buf to:
12042 12608  ;   (lastaddr.curr buf + 2 - firstaddr.curr buf)/bytes per segm.
12043 12608  ;   (undefined for sense, initialize, get statistics).
12044 12608  ;
12045 12608  ; registers: call              exit
12046 12608  ; w0         top segment       destroyed
12047 12608  ; w1         bytes per segm.   unchanged
12048 12608  ; w2         curr buf          unchanged
12049 12608  ; w3         link              destroyed
12050 12608  ;
12051 12608  ; entry    : j2
12052 12608  ;
12053 12608  ; return   : link+0: first segment.curr buf outside limits
12054 12608  ;            link+2: normal return
12055 12608  b. i2  w.
12056 12608  j2  : rs. w3     i0.    ; check message: save link;
12057 12610        al  w3     0      ;
12058 12612        hs  w3  x2+m6     ;   retryinformation.curr buf:= 0;
12059 12614        rl  w3  x2+m4     ;
12060 12616        sl  w3     0      ;   if first segment.curr buf >= 0
12061 12618        sl  w3    (0)     ;   and first segm.curr buf < top segment
12062 12620        jl.        i2.    ;   then
12063 12622        rl  w3  x2+m3     ;   begin
12064 12624        al  w3  x3+2      ;     segments wanted:=
12065 12626        ws  w3  x2+m2     ;     (lastaddr.curr buf + 2
12066 12628        al  w2     0      ;      - first addr.curr buf)
12067 12630        wd  w3     2      ;     / bytes per segment;
12068 12632        rl  w2     b18    ;     segments possible:=
12069 12634        ws  w0  x2+m4     ;     top segment - first segm.curr buf;
12070 12636        sh  w0  x3+0      ;
12071 12638        rl  w3     0      ;     s:= min(segms wanted,segms poss.);
12072 12640        hs  w3  x2+m5     ;     no of segments.curr buf:=
12073 12642        hs  w3  x2+m8     ;     segments wanted.curr buf:=
12074 12644        hs  w3  x2+m9     ;     remaining segments.curr buf:= s;
12075 12646  i1  : am.       (i0.)   ; normal: normal return; c. link+2;
12076 12648        jl         2      ;   end
12077 12650  i2  : bz  w3  x2+m0     ;   else
12078 12652       se  w3  q39       ; if operation.curr = set regret or
12079 12654        sn  w3     q30    ;    operation.curr buf = sense
12080 12656        jl.        i1.    ;
12081 12658        se  w3     q31    ;   or operation.curr buf = initialize
12082 12660        sn  w3     q36    ;   or operation.curr buf = get statist.
12083 12662        jl.        i1.    ;   then goto normal
12084 12664        jl.       (i0.)   ;   else outside return; c. link+0;
12085 12666  
12085 12666  ; variables
12086 12666  i0  : 0                 ;
12087 12668  e.
12088 12668  \f


12088 12668  ; pej 21.09.77    disc driver, transform first segment
12089 12668  
12089 12668  ; procedure transform first segment(area process)
12090 12668  ; ---------------------------------------------------------------
12091 12668  ; area process: addr of area proc which received curr buf.
12092 12668  ;
12093 12668  ; the procedure performs:
12094 12668  ; - transforms first segment.buf from being a segment no relative
12095 12668  ;   to bs-area start into being a segment no relative to start
12096 12668  ;   of (physical or logical) disc.
12097 12668  ;
12098 12668  ; registers: call              exit
12099 12668  ; w0                           destroyed
12100 12668  ; w1         area process      curr receiver
12101 12668  ; w2         curr buf          unchanged
12102 12668  ; w3         link              destroyed
12103 12668  ;
12104 12668  ; entry    : j3
12105 12668  ;
12106 12668  ; return   : link+0
12107 12668  b. i0 w.
12108 12668  j3  : rs. w3     i0.    ; transform first segment: save link;
12109 12670        al  w3     0      ;
12110 12672        rl  w0  x2+m4     ;   no of slices:=
12111 12674        am        (b19)   ;   first segment.curr buf
12112 12676        wd  w0     p1     ;   / slicelength.curr receiver;
12113 12678        rs  w3  x2+m4     ;   first segment.curr buf:= remainder;
12114 12680        rl  w2  x1+a60    ;   index:=
12115 12682        rl  w1     b19    ;   first slice.area proc
12116 12684        wa  w2  x1+p0     ;   + chaintable.curr receiver;
12117 12686        jl  w3     d74    ;   follow chain(noof slices,index,slice);
12118 12688        ws  w2  x1+p0     ;   slice:= slice - chaintable.curr rec;
12119 12690        al  w0  x2+0      ;
12120 12692        rl  w2     b18    ;
12121 12694        wm  w0  x1+p1     ;   first segment.curr buf:=
12122 12696        wa  w0  x2+m4     ;   slice * slicelength.curr receiver
12123 12698        rs  w0  x2+m4     ;   + first segment.curr buf;
12124 12700        jl.       (i0.)   ;   return;
12125 12702  
12125 12702  ; variables
12126 12702  i0  : 0                 ; saved link
12127 12704  e.
12128 12704  \f


12128 12704  ; pej 21.09.77    disc driver, prepare consecutive segments
12129 12704  
12129 12704  ; procedure prepare consecutive segments(proc)
12130 12704  ; ---------------------------------------------------------------
12131 12704  ; proc: addr of disc proc descr containing sliceinformation.
12132 12704  ;
12133 12704  ; the procedure performs:
12134 12704  ; - initializes no of segments.curr buf by the largest possible
12135 12704  ;   number of adjecent segments which can be transferred from
12136 12704  ;   first segment.curr buf and on.
12137 12704  ; - sets next segment.curr buf to a value which may be used as
12138 12704  ;   first segment in the next call of this procedure.
12139 12704  ;
12140 12704  ; note: must only be called in connection with message origi-
12141 12704  ;       nating from an area process.
12142 12704  ;
12143 12704  ; registers: call               exit
12144 12704  ; w0                            destroyed
12145 12704  ; w1         proc               unchanged
12146 12704  ; w2         curr buf           unchanged
12147 12704  ; w3         link               destroyed
12148 12704  ;
12149 12704  ; entry    : j4
12150 12704  ;
12151 12704  ; return   : link+0
12152 12704  b. i3 w.
12153 12704  j4  : rs. w3     i0.    ; prepare consecutive segments:
12154 12706        bz  w3  x2+m9     ;   save link;
12155 12708        rs. w3     i1.    ;   remaining:= remaining segms.curr buf;
12156 12710        rl  w3  x2+m4     ;
12157 12712        al  w2     0      ;   slice:= first segment.curr buf
12158 12714        wd  w3  x1+p1     ;           / slicelength.proc
12159 12716        wa  w3  x1+p0     ;           + chaintable.proc;
12160 12718        ws  w2  x1+p1     ;   segments possible:= slicelength.proc
12161 12720        ac  w0  x2+0      ;   - first segm.curr buf mod slicel.proc;
12162 12722  i2  : bl  w2  x3+0      ;   while core(slice) = 1
12163 12724        sn  w2     1      ;   and segments possible < remaining do
12164 12726        sl. w0    (i1.)   ;   begin
12165 12728        jl.        i3.    ;     slice:= slice + 1;
12166 12730        al  w3  x3+1      ;     segments possible:=
12167 12732        wa  w0  x1+p1     ;     segments possible+slicelength.proc;
12168 12734        jl.        i2.    ;   end;
12169 12736  i3  : ba  w3  x3+0      ;
12170 12738        ws  w3  x1+p0     ;   next segment.curr buf:=
12171 12740        wm  w3  x1+p1     ;   (slice + core(slice) - chaintab.proc)
12172 12742        rl  w2     b18    ;   * slicelength.proc;
12173 12744        rs  w3  x2+m7     ;
12174 12746        sl. w0    (i1.)   ;   if segments possible >= remaining
12175 12748        rl. w0     i1.    ;   then segments possible:= remaining;
12176 12750        hs  w0  x2+m5     ;   no of segms.curr buf:= segms possible;
12177 12752        jl.       (i0.)   ;   return;
12178 12754  
12178 12754  ; variables
12179 12754  i0  : 0                 ; saved link
12180 12756  i1  : 0                 ; remaining (from rem.segms.curr buf)
12181 12758  e.
12182 12758  \f


12182 12758  
12182 12758  ; pej 04.10.77    disc driver, proc copy statistics
12183 12758  
12183 12758  ; procedure copy statistics(result,words)
12184 12758  ; ---------------------------------------------------------------
12185 12758  ; result: see proc copy to buffer.
12186 12758  ; words : no of words copied.
12187 12758  ;
12188 12758  ; the procedure performs:
12189 12758  ; - copies the number of words specified in curr buf from
12190 12758  ;   statistics of curr receiver.
12191 12758  ; - zeroizes the statistics area if copy ok.
12192 12758  ;
12193 12758  ; registers: call              exit
12194 12758  ; w0                           result if result <> ok return
12195 12758  ; w1         curr receiver     destroyed
12196 12758  ; w2         curr buf          curr receiver if normal return
12197 12758  ; w3         link              words if normal return
12198 12758  ;
12199 12758  ; entry    : j5
12200 12758  ;
12201 12758  ; return   : link+0: not enough room in buf for statistics
12202 12758  ;            link+2: result <> ok
12203 12758  ;            link+4: normal return
12204 12758  c. q1
12205 12758  b. i8 w.
12206 12758  j5  : al  w0     2      ; copy statistics:
12207 12760        wa  w0  x2+m3     ;   bytes:= 2 + lastaddr.curr buf
12208 12762        ws  w0  x2+m2     ;           - firstaddr.curr buf;
12209 12764        la  w0     g50    ;   make bytes even;
12210 12766        sl  w0     p50    ;   if bytes < length of statistics
12211 12768        jl.        i2.    ;
12212 12770        jl      x3+0      ;   then no room return;
12213 12772  i2  : al  w3  x3+2      ;   link:= link + 2;
12214 12774        rs. w3     i0.    ;   save link;
12215 12776        rs. w0     i1.    ;   save bytes;
12216 12778        al  w1  x1+p40    ;   first:= addr of statistics.curr rec;
12217 12780        rs. w1     i6.     ;
12218 12782        wa  w1     0       ;
12219 12784        al  w1  x1-2       ;
12220 12786        rs. w1     i7.     ;
12221 12788        al. w1     i5.     ;
12222 12790        jd         1<11+84 ;
12223 12792        se  w0     0      ;   if result <> 0
12224 12794        jl.       (i0.)   ;   then return; c. link + 2;
12225 12796        rl  w2     b19    ;
12226 12798        al  w1  x2+p40    ;   i:= addr of statistics.curr rec;
12227 12800        al  w3  x1+p50    ;
12228 12802        al  w0     0      ;   repeat
12229 12804  i3  : rs  w0  x1+0      ;     curr receiver(i):= 0;
12230 12806        al  w1  x1+2      ;     i:= i + 2
12231 12808        se  w1  x3+0      ; 
12232 12810        jl.        i3.    ;   until i = top of statistics;
12233 12812        al  w0    -1      ;   entry:= 1st error segment.curr rec;
12234 12814        al  w3  x2+p46    ;   repeat
12235 12816  i4  : rs  w0  x3+0      ;     segment no.entry:= -1;
12236 12818        al  w3  x3+6      ;     entry:= entry + 1
12237 12820        se  w3  x2+p46+q2*6;
12238 12822        jl.        i4.    ;   until entry = top entry;
12239 12824        rl. w3     i1.    ;
12240 12826        ls  w3    -1      ;   words:= bytes / 2;
12241 12828        am.       (i0.)   ;
12242 12830        jl         2      ;   return; c. link + 4;
12243 12832  
12243 12832  ; variables
12244 12832  i0  : 0                 ; saved link
12245 12834  i1  : 0                 ; saved bytes
12246 12836  
12246 12836  i5:   2<1+1              ; function
12247 12838  i6:   0                  ; first
12248 12840  i7:   0                  ; last
12249 12842        0                  ; relative
12250 12844  e.
12251 12844  z.
12252 12844  
12252 12844  \f


12252 12844  
12252 12844  ; pej 30.09.77    disc driver, initialize disc
12253 12844  
12253 12844  ; procedure initialize disc
12254 12844  ; ---------------------------------------------------------------
12255 12844  ;
12256 12844  ; the procedure performs:
12257 12844  ; - sets no of segments per cylinder and displacement of sector
12258 12844  ;   zero on odd cylinders and the disctype in the driver process
12259 12844  ;   description from information supplied in curr buf.
12260 12844  ; - sets state.curr receiver to ready indicating that define disc
12261 12844  ;   should not be executed.
12262 12844  ; - sets initdisc.curr receiver = 1.
12263 12844  ;
12264 12844  ; registers: call              exit
12265 12844  ; w0                           destroyed
12266 12844  ; w1         curr receiver     unchanged
12267 12844  ; w2         curr buf          unchanged
12268 12844  ; w3         link              destroyed
12269 12844  ;
12270 12844  ; entry    : j6
12271 12844  ;
12272 12844  ; return   : link+0
12273 12844  b. i0 w.
12274 12844  j6  : rs. w3     i0.    ; initialize disc:
12275 12846        rl  w0  x2+m2     ;
12276 12848        wm  w0  x1+p6     ;   no of segments per cyl.curr rec:=
12277 12850        rs  w0  x1+p8     ;   no of heads.curr buf
12278 12852        rl  w0  x2+m3     ;   * no of segments per track.curr rec;
12279 12854        rs  w0  x1+p9     ;   displacement.curr rec:= disp.curr buf;
12280 12856        rl  w0  x2+m4     ;   disctype.curr receiver:=
12281 12858        rs  w0  x1+p5     ;   disctype.curr buf;
12282 12860        al  w0     2      ;
12283 12862        rs  w0  x1+p12    ;   state.curr receiver:= ready;
12284 12864        al  w0     1      ;
12285 12866        hs  w0  x1+p14    ;   initdisc.curr receiver:= 1;
12286 12868        jl.       (i0.)   ;   return;
12287 12870  
12287 12870  ; variables
12288 12870  i0  : 0                 ; saved link
12289 12872  e.
12290 12872  \f


12290 12872  
12290 12872  ; pej 19.09.77    disc driver, setup channelprogram and start
12291 12872  
12291 12872  ; procedure setup channel program and start(kind,result);
12292 12872  ; ---------------------------------------------------------------
12293 12872  ; kind  : 0 : setup channel pg according to curr buf.
12294 12872  ;         q39: define disc, setup read.       (has no connection to
12295 12872  ;         q39+2: power rest., setup sense.     the commands set regretted and continue )
12296 12872  ; result: result from procedure start i/o.
12297 12872  ;
12298 12872  ; the procedure performs:
12299 12872  ; - sets up a channelprogram according to either the contents
12300 12872  ;   of curr buf, a channel program for reading addr mark at
12301 12872  ;   define disc or a channel program for sensing the disc at
12302 12872  ;   power restart.
12303 12872  ;
12304 12872  ;   please note that if a channelprogram for reading or writing
12305 12872  ;   is set up according to curr buf, and no of segments.curr buf
12306 12872  ;   equals zero then firstaddr.curr buf is not used in the
12307 12872  ;   transfer command as procedure update buf on error may have
12308 12872  ;   incremented firstaddr.curr buf beyond lastaddr.curr buf.
12309 12872  ;   instead, to avoid result 3 from start i/o, the transfer
12310 12872  ;   command will contain a first address pointing into drivers
12311 12872  ;   process description.
12312 12872  ; - calls procedure start i/o to start the transfer. the device
12313 12872  ;   is reset if initdisc.curr receiver <>0, and initdisc:= 0.
12314 12872  ; - sets segment units.curr receiver at read or write to
12315 12872  ;   bytes-chars per segment.
12316 12872  ; - zeroizes remaining bytes, curr status, event status, and
12317 12872  ;   technical status in the two statusareas.
12318 12872  ; - zeroizes setmode param.curr receiver if setmode is not used
12319 12872  ;   (read, write, clean, position).
12320 12872  ; - continues at waitnext in driver proc if the device is started
12321 12872  ;   or, if not, returns with a result (see proc start i/o).
12322 12872  ;
12323 12872  ; registers: call              exit
12324 12872  ; w0                           result
12325 12872  ; w1         kind              channel pg start
12326 12872  ; w2                           0 or buf
12327 12872  ; w3         link              device address
12328 12872  ;
12329 12872  ; entry    : j0
12330 12872  ; 
12331 12872  ; return   : waitnext if ok
12332 12872  ;            link+0 if error
12333 12872  
12333 12872  b. c74, i110, l1, n10 w.
12334 12872  \f


12334 12872  ; pej 19.09.77    disc driver, setup channelprogram and start
12335 12872  
12335 12872  j0  :                   ; setup channel program and start:
12336 12872        rs. w3     i0.    ;   save link;
12337 12874  
12337 12874  ; initialize according to most frequently used channel pg
12338 12874        rl. w0     i4.    ;   command.mode.channel pg:= noop;
12339 12876        rs. w0     c1.    ;   c. do not use strobe-offset;
12340 12878        rl. w0     i5.    ;   command.first stop.channel pg:= stop;
12341 12880        rs. w0     c5.    ;   c. not read after write;
12342 12882        al. w0     c2.    ;
12343 12884        rs. w0     i1.    ;   startaddr:= first seek.channel pg;
12344 12886        rl  w2     b18    ;
12345 12888        sn  w1     0      ;   if kind = 0
12346 12890        bz  w1  x2+m0     ;   then kind:= operation.curr buf;
12347 12892        la  w1     g50    ;
12348 12894        wm  w1     g48    ;   i:= (kind >> 1) << 1 * 3;
12349 12896        dl. w0  x1+l0.    ;   command.first transfer.channel pg:=
12350 12898        rs. w3     c3.    ;   operation table(i);
12351 12900        am        (b19)   ;   transfer state.curr receiver:=
12352 12902        rs  w0     p13    ;   operation table(i + 2);
12353 12904        rl. w0  x1+l1.    ;
12354 12906        rs. w0     i2.    ;   actionaddr:= operation table(i + 4);
12355 12908  
12355 12908  ; enter next action with w1 = curr receiver, w2 = curr buf
12356 12908  i20:  rl  w1     b19    ; central action: w1:= curr receiver;
12357 12910        rl  w2     b18    ;   w2:= curr buf;
12358 12912        am.       (i2.)   ;   actionaddr:= actionaddr + 1;
12359 12914        al  w3     1      ;
12360 12916        rs. w3     i2.    ;
12361 12918        ba  w3  x3        ;
12362 12920        jl      x3        ;   goto actiontable(actionaddr);
12363 12922  
12363 12922  ; actiontable
12364 12922  h.  ;  0   1   2   3   4   5   6   7   8   9   10
12365 12922  i101:                             n7.,    n9.      ; sense
12366 12924  i102: n0.,    n2.,        n5.,        n8.,    n10. ; read
12367 12929  i103: n0.,    n2.,            n6.,    n8.,    n10. ; write
12368 12934  i104: n0.,        n3.,                n8.,n9.      ; clean
12369 12938  i105: n0.,                            n8.,n9.      ; position
12370 12941  i106:     n1.,        n4.,            n8.,n9.      ; define disc
12371 12945  i107:                             n7.,    n9.      ; power rest.
12372 12947  w.
12373 12948  \f


12373 12948  ; pej 19.09.77    disc driver, setup channelprogram and start
12374 12948  
12374 12948  ; action 0, calculate seekinformation (read,write,clean,pos.).
12375 12948  n0  : rl  w0  x2+m4     ; action 0:
12376 12950        am     (x2+m10)   ;   s:= first segment.curr buf
12377 12952        wa  w0     p3     ;   + first segment.device.curr buf;
12378 12954        ld  w3    -100    ;
12379 12956        rs  w3  x1+p21    ;   setmode param.curr receiver:= 0;
12380 12958        wd  w0  x1+p8     ;   cyl:= s / segments per cyl.curr rec;
12381 12960                          ;   r:= s mod segments per cyl.curr rec;
12382 12960        wd  w3  x1+p6     ;   head:= r / segms per track.curr rec;
12383 12962                          ;   sect:= r mod segms per track.curr r;
12384 12962        sz  w0     2.1    ;   if cyl odd
12385 12964        wa  w2  x1+p9     ;   then sect:=
12386 12966        sl  w2 (x1+p6)    ;   (sect + displacement.curr receiver)
12387 12968        ws  w2  x1+p6     ;   mod segments per track.curr receiver;
12388 12970  i25:  ls  w0     8      ; insert seekinformation:
12389 12972        wa  w3     0      ;   c. w0=cyl,w1=curr,w2=sect,w3=head;
12390 12974        rs  w3  x1+p20    ;   seek param(0).curr receiver:=
12391 12976        ls  w2     16     ;   cyl << 8 + head;
12392 12978        wa  w2  x1+p7     ;   seek param(2).curr receiver:=
12393 12980        rs  w2  x1+p20+2  ;   sect < 16 + flags.curr receiver;
12394 12982        jl.        i20.   ;   goto central action;
12395 12984  
12395 12984  ; action 1, calculate transfer - and seekinformation (define disc)
12396 12984  n1  : al  w3     p22    ; action 1:
12397 12986        al  w0     q51    ;   first addr.1st transfer.channel pg:=
12398 12988        ds. w0     c34.   ;   addr mark.curr receiver;
12399 12990        rl  w0  x1+p10    ;   charcount.1st transfer.ch pg:=chars;
12400 12992        rl  w3  x1+p11    ;   cyl:= define disc cyl.curr receiver;
12401 12994        rl  w2  x1+p6     ;   head:= define disc head.curr rec;
12402 12996        al  w2  x2-1      ;   sect:= segms per track.curr rec - 1;
12403 12998        jl.        i25.   ;   goto insert seekinformation;
12404 13000  
12404 13000  ; action 2, calculate transferinformation (read,write).
12405 13000  n2  : dl. w0     i10.   ; action 2:
12406 13002        ds  w0  x1+p35+2  ;   segment units.curr receiver:=
12407 13004        bz  w0  x2+m1     ;   chars-bytes per data segment;
12408 13006        so  w0     q40    ;   if transput mode.curr buf = 1 then
12409 13008        jl.        i30.   ;   begin c. addr mark mode;
12410 13010        rl. w0     c3.    ;
12411 13012        lo. w0     i8.    ;     command.1st transfer.channel pg:=
12412 13014        rs. w0     c3.    ;     command.1st transfer.channel pg
12413 13016        rl  w0  x1+p13    ;     +modif;
12414 13018        ls  w0     -1     ;     transfer state.curr receiver:=
12415 13020        rs  w0  x1+p13    ;     transfer state.curr receiver >> 1;
12416 13022        dl. w0     i9.    ;     segment units.curr receiver:=
12417 13024        ds  w0  x1+p35+2  ;     chars-bytes per addr mark;
12418 13026                          ;   end;
12419 13026  i30 : bz  w0  x2+m5     ;
12420 13028        wm  w0  x1+p35+2  ;   charcount.1st transfer.channel pg:=
12421 13030        rs. w0     c34.   ;   chars * no of segments.curr buf;
12422 13032        rl  w1  x2+m2     ;   firstaddr.1st transfer.channel pg:=
12423 13034        rs. w1     c32.   ;   firstaddr.curr buf;
12424 13036        se  w0     0      ;   if charcount.1st transfer.ch pg=0 then
12425 13038        jl.        i20.   ;   begin c. see procedure description;
12426 13040        rl. w0     c3.    ;
12427 13042        lo. w0     i11.   ;     addrcode.1st transfer.channel pg:=
12428 13044        rs. w0     c3.    ;     drivers process;
12429 13046        al  w0     p20    ;     firstaddr.1st transfer.channel pg:=
12430 13048        rs. w0     c32.   ;     rel of seek param;
12431 13050        jl.        i20.   ;   end;
12432 13052                          ;   goto central action;
12433 13052  
12433 13052  ; action 3, insert dummy transfer information (clean track).
12434 13052  n3  : dl. w1     c24.   ; action 3:
12435 13054        ds. w1     c34.   ;   parameters.1st transfer.channel pg:=
12436 13056                          ;   parameters.1st seek.channel pg;
12437 13056                          ;   c. because of checking in start i-o;
12438 13056        jl.        i20.   ;   goto central action;
12439 13058  
12439 13058  ; action 4, test if strobe-offset used (define disc).
12440 13058  n4  : bz  w3  x1+p15    ; action 4:
12441 13060                          ;   retryinf:= retryinf.curr receiver;
12442 13060        jl.        i35.   ;   goto test mode;
12443 13062  
12443 13062  ; action 5, test if strobe-offset used (read).
12444 13062  n5  : bz  w3  x2+m6     ; action 5: retryinf:= retryinf.curr buf;
12445 13064                          ; test mode: c. ac3 = retryinf;
12446 13064  i35 : sh  w3     2.111  ;   if retryinf(0:20) = 0
12447 13066        jl.        i20.   ;   then goto central action;
12448 13068        rl. w0     i6.    ;
12449 13070        rs. w0     c1.    ;   command.mode.channel pg:= setmode;
12450 13072        ls  w3    -3      ;
12451 13074        rl. w2     i3.    ;
12452 13076        la  w2     6      ;   i:= modeindex.retryinf;
12453 13078        ls  w3    -5      ;   i1:= offset index.retryinf;
12454 13080        al  w3  x3-1      ;
12455 13082        bz. w0  x3+q20.   ;
12456 13084        ba. w0  x2+q21.   ;   setmode param.curr receiver:=
12457 13086        rs  w0  x1+p21    ;   modetable(i-1)+ offsettable(i1);
12458 13088        jl.        i20.   ;   goto central action;
12459 13090  
12459 13090  ; action 6, test if read after write (write).
12460 13090  n6  : bz  w3  x2+m1     ; action 6:
12461 13092        so  w3     q43    ;   if -, read after write.mode.curr buf
12462 13094        jl.        i20.   ;   then goto central action;
12463 13096        rl  w0  x1+p13    ;
12464 13098        ls  w0    -2      ;   transfer state.curr receiver:=
12465 13100        rs  w0  x1+p13    ;   transfer state.curr receiver >> 2;
12466 13102        rl. w0     i4.    ;
12467 13104        rs. w0     c5.    ;   command.1st stop.channel pg:= noop;
12468 13106        rl. w0     i7.    ;   command:= read with no transfer;
12469 13108        sz  w3     q40    ;   if transput mode.curr buf = 1
12470 13110        rl. w0     i7.    ;*  then command:= command + modif;
12471 13112        rs. w0     c7.    ;   command.2nd transfer.channel pg:=
12472 13114                          ;   command;
12473 13114        dl. w0     c34.   ;   parameters.2nd transfer.channel pg:=
12474 13116        ds. w0     c74.   ;   parameters.1st transfer.channel pg;
12475 13118        se  w0     0      ;   if charcount.2nd transfer.ch pg=0 then
12476 13120        jl.        j37.   ;
12477 13122        rl. w0     c7.    ;   addrcode.2nd transfer.channel pg:=
12478 13124        lo. w0     i11.   ;   drivers process;
12479 13126        rs. w0     c7.    ;   c. see action 2;
12480 13128  i37 : bz  w0  x2+m6     ;
12481 13130        al  w3     0      ;   c. test if write is to be skipped;
12482 13132        sz  w0     2.111  ;   if readtries.retryinf.curr buf <> 0
12483 13134        rs. w3     c34.   ;   then charcount.1st transfer.channel pg
12484 13136        jl.        i20.   ;   := 0;
12485 13138                          ;   goto central action;
12486 13138  
12486 13138  ; action 7, determine startaddress (sense,power restart).
12487 13138  n7  : zl  w0  x2+m1     ; action 7:
12488 13140        ls  w0    -3      ;    get mess.mode
12489 13142        ea  w0  x1+p14    ;
12490 13144        al. w3     c4.    ;   startaddr:= 1st sense.channel pg;
12491 13146        se  w0     0      ;   if initdisc.curr receiver <> 0 or mess.mode = 8
12492 13148        al. w3     c3.    ;   then startaddr :=
12493 13150        rs. w3     i1.    ;   1st transfer.channel pg; c. init;
12494 13152        jl.        i20.   ;   goto central action;
12495 13154  
12495 13154  ; action 8, determine startaddr (read,write,clean,pos,define).
12496 13154  n8  : bz  w0  x1+p14    ; action 8:
12497 13156        al. w3     c0.    ;
12498 13158        se  w0     0      ;   if initdisc.curr receiver <> 0
12499 13160        rs. w3     i1.    ;   then startaddr:= init.channel pg;
12500 13162        jl.        i20.   ;   goto central action;
12501 13164  
12501 13164  ; action 9, perform start with buf = 0 (all except read,write)
12502 13164  n9  : al  w2     0      ; action 9: buf:= 0;
12503 13166        jl.        i40.   ;   goto start;
12504 13168  
12504 13168  ; action 10, perform start with buf = curr buf:
12505 13168  n10 :                   ; action 10: c. buf = curr buf;
12506 13168  
12506 13168  ; call start i/o to start the transfer. w1,w2 = curr rec.,buf.
12507 13168  i40 : ld  w0    -100    ; start:
12508 13170        ds  w0  x1+p16+4  ;   zeroize rembytes, curr status,
12509 13172        rs  w0  x1+p16+6  ;     event status, technical status
12510 13174        rs  w0  x1+p16+20 ;     in statusarea1.curr receiver
12511 13176        ds  w0  x1+p18+4  ;     and statusarea2.curr receiver;
12512 13178        rs  w0  x1+p18+6  ;
12513 13180        rs  w0  x1+p18+20 ;
12514 13182        hs  w0  x1+p14    ;   initdisc.curr receiver:= 0;
12515 13184        al  w0     1<2+1  ;   + std exit + start channel pg;
12516 13186        rl  w3  x1+a235   ;   device addr:= device addr.curr rec;
12517 13188        rl. w1     i1.    ;
12518 13190        jd         1<11+100;  start i/o(func,startad,buf,devicead);
12519 13192        jl.       (i0.)   ;   return;
12520 13194  
12520 13194  ; pej 19.09.77    disc driver, setup channelprogram and start
12521 13194  
12521 13194  ; variables
12522 13194  i0  : 0                 ; saved link
12523 13196  i1  : 0                 ; start addr, in channel pg
12524 13198  i2  : 0                 ; action addr, index to actiontable
12525 13200  i3  : 2.11111           ; for masking out offsetindex.retryinf
12526 13202  i4  : 4095              ; channel pg command = noop
12527 13204  i5  : 15<8              ;                    = stop
12528 13206  i6  : 4<12+2<8+1        ;                    = setmode
12529 13208  i7  : 4095              ;*                   = read, no transfer
12530 13210  i8  : 1                 ; modifier for addr mark (read,write)
12531 13212        q50               ;                   bytes per addr mark
12532 13214  i9  : q51               ; segment unit: +0: chars per addr mark
12533 13216        q52               ;                   bytes per data segm
12534 13218  i10 : q53               ; segment unit: +0: chars per data segm
12535 13220  i11 : 4<12              ; addrcode = drivers process
12536 13222  
12536 13222  ; operation table.
12537 13222  ; the table contains: +0: command for 1st transfer.channel pg
12538 13222  ;                     +2: transfer state
12539 13222  ;                     +4: action table base
12540 13222  ; a row in the table is indexed by: (operation>1)<1*3
12541 13222  ;   addrcode+command+modif, state, actionbase
12542 13222  i100: 0<12  +  6<8  +  0,l0:1<20,l1:i101-1   ; + 0: sense
12543 13228        0<12  +  1<8  +  0  , 1<17 ,  i102-1   ; + 6: read
12544 13234        0<12  +  3<8  +  0  , 1<15 ,  i103-1   ; +12: write
12545 13240        4<12  +  3<8  +  3  , 1<18 ,  i104-1   ; +18: clean track
12546 13246                     4095   , 1<19 ,  i105-1   ; +24: position
12547 13252        4<12  +  1<8  +  1  , 1<22 ,  i106-1   ; +30: define disc
12548 13258        0<12  +  6<8  +  0  , 1<21 ,  i107-1   ; +36: power restart
12549 13264  ;              1 read
12550 13264  ;                      0 data
12551 13264  ;                      1 addr mark
12552 13264  ;              3 write
12553 13264  ;                      0 data
12554 13264  ;                      1 addr mark
12555 13264  ;                      3 clean
12556 13264  ;              6 init
12557 13264  ;     0 data area in senders process
12558 13264  ;     4 data area in drivers process descr
12559 13264  \f


12559 13264  ; pej 19.09.77    disc driver, channel program
12560 13264  
12560 13264  ; c h a n n e l   p r o g r a m
12561 13264  
12561 13264  ;                                 addrcode  command  params
12562 13264  
12562 13264  ; init after error
12563 13264  c0  :       6<8   ; init          irrel     init
12564 13266        0           ;                                  irrel
12565 13268        0           ;                                  irrel
12566 13270  
12566 13270  ; normal starting point
12567 13270  c2  : 4<12+ 2<8   ; 1st seek      device    seek
12568 13272  c22 : p20         ;                                  paramaddr
12569 13274  c24 : 6           ;                                  charcount
12570 13276  c1  : 4<12+ 2<8+1 ; mode          device    setmode
12571 13278        p21         ;                                  paramaddr
12572 13280        3           ;                                  charcount
12573 13282  c3  : 0           ; 1st transfer
12574 13284  c32 : 0           ;
12575 13286  c34 : 0           ;
12576 13288  c4  : 4<12+ 0<8   ; 1st sense     device    sense
12577 13290        p16         ;                                  statusarea1
12578 13292        33          ;                                  max charcount
12579 13294  
12579 13294  ; stop unless read after write
12580 13294  c5  :      15<8   ; 1st stop      irrel     stop
12581 13296        0           ;                                  irrel
12582 13298        40000       ;                                  timer, 0.1 ms
12583 13300  
12583 13300  ; checkread
12584 13300  c6  : 4<12+ 2<8   ; 2nd seek      device    seek
12585 13302        p20         ;                                  paramaddr
12586 13304        6           ;                                  charcount
12587 13306  c7  : 0           ; 2nd transfer
12588 13308  c72 : 0           ;
12589 13310  c74 : 0           ;
12590 13312  c8  : 4<12+ 0<8   ; 2nd sense     device    sense
12591 13314        p18         ;                                  statusarea2
12592 13316        33          ;                                  max charcount
12593 13318  
12593 13318  ; stop
12594 13318  c9  :      15<8   ; 2nd stop      irrel     stop
12595 13320        0           ;                                  irrel
12596 13322        40000       ;                                  timer, 0.1 ms
12597 13324  
12597 13324  e.
12598 13324  \f


12598 13324  
12598 13324  ; pej 22.09.77    disc driver, process next message
12599 13324  
12599 13324  ; p r o c e s s   n e x t   m e s s a g e
12600 13324  ; ---------------------------------------------------------------
12601 13324  
12601 13324  ; this routine is entered when the next message is to be proces-
12602 13324  ; sed by the disc driver. the routine is entered either from link
12603 13324  ; message routine (driver able to process a received message
12604 13324  ; immediately) or when an answer to a processed message has been
12605 13324  ; delivered and more messages are queued to the driver. curr buf
12606 13324  ; contains addr of buffer to be processed.
12607 13324  
12607 13324  ; check if message is get statistics message
12608 13324                          ; process next message:
12609 13324  j50 : al  w0     0      ;   c. w1 = curr receiver, w2 = curr buf;
12610 13326        hs  w0  x1+p15    ;   retryinf.curr receiver:= 0;
12611 13328        bz  w0  x2+m0     ;
12612 13330        c.         q1     ;   if statistics wanted
12613 13330        se  w0     q36    ;   and operation.curr buf = get stat then
12614 13332        jl.        j52.   ;   begin
12615 13334        jl. w3     j5.    ;     copy statistics(result,words);
12616 13336        jl.        j90.   ;     if no room then goto deliv. blockl;
12617 13338        jl.        j102.  ;     if -, ok then goto status/segms 0;
12618 13340        jl.        j94.   ;     goto deliver words wanted;
12619 13342        z.                ;   end;
12620 13342  
12620 13342  ; check if message is initialize message
12621 13342  j52 : se  w0     q31    ;   if operation.curr buf = init then
12622 13344        jl.        j53.   ;   begin
12623 13346        jl. w3     j6.    ;     initialize disc;
12624 13348        jl.        j101.  ;     goto deliver size zero;
12625 13350                          ;   end;
12626 13350  
12626 13350  
12626 13350  ; check if message is set regretted
12627 13350  j53 : se  w0     q39    ;   if operation.curr buf = set regretted then
12628 13352        jl.        j55.   ;   begin
12629 13354        al  w0     3      ;     set regretted.curr receiver = 3
12630 13356        rs  w0  x1+a56    ;     deliver result 1
12631 13358        al  w0  0         ;
12632 13360        rs  w0  g20       ; deliver status 0
12633 13362  
12633 13362        jl         g7     ;   end
12634 13364  \f


12634 13364  ; pej 22.09.77    disc driver, start device
12635 13364  
12635 13364  ; s t a r t   d e v i c e
12636 13364  ; ---------------------------------------------------------------
12637 13364  
12637 13364  ; this routine is executed to start the device and is entered
12638 13364  ; from process next message routine or when an operation is to
12639 13364  ; be repeated. the disc is started according to the contents of
12640 13364  ; curr buffer.
12641 13364  ;
12642 13364  ; if the disc is not yet defined (state.curr receiver <> ready)
12643 13364  ; then a special transfer is activated to check number of heads
12644 13364  ; and displacement of sector zero on odd cylinders. curr buf is
12645 13364  ; left in the head of the queue and will be processed when the
12646 13364  ; disc has been defined. regretted.curr receiver will be odd
12647 13364  ; during define disc so as to avoid a start (this might happen if
12648 13364  ; curr buf is regretted and the queue turns empty).
12649 13364  ;
12650 13364  ; continuation takes place at waitnext in driverproc.
12651 13364  
12651 13364  ; set up channel program for contents of curr buf
12652 13364  j55 : rl  w1     b19    ; start:
12653 13366        rl  w0  x1+p12    ;
12654 13368        se  w0     2      ;   if state.curr receiver = ready then
12655 13370        jl.        j57.   ;   begin
12656 13372        c.         q1     ;     if statistics wanted
12657 13372        am     (x1+p40)   ;
12658 13374        al  w0     1      ;     then no of transfers.curr rec:=
12659 13376        rs  w0  x1+p40    ;     no of transfers.curr rec + 1;
12660 13378        z.                ;
12661 13378        al  w1     0      ;     kind:= 0; c. use curr buf;
12662 13380        jl. w3     j0.    ;     setup channel pg and start(kind);
12663 13382        se  w0     3      ;     if result <> 3
12664 13384        jl.        j101.  ;     then goto deliver size zero
12665 13386        jl.        j99.   ;     else goto deliver unintilligible;
12666 13388                          ;   end;
12667 13388  
12667 13388  ; setup channel program for define disc
12668 13388  j57 : se  w0     0      ;   if state.curr rec = after interv then
12669 13390        jl.        j59.   ;   begin
12670 13392        rs  w0  x1+p10    ;     define disc cyl.curr receiver:= 0;
12671 13394        rs  w0  x1+p11    ;     define disc head.curr receiver:= 0;
12672 13396        hs  w0  x1+p15    ;     retryinformation.curr receiver:= 0;
12673 13398        al  w0     1      ;     state.curr receiver:= defining disc;
12674 13400        rs  w0  x1+p12    ;     regretted.curr receiver:= 1;
12675 13402        rs  w0  x1+a56    ;     disctype.curr receiver:= 1;
12676 13404        rs  w0  x1+p5     ;     initdisc.curr receiver:= 1;
12677 13406        hs  w0  x1+p14    ;   end;
12678 13408  j59 : al  w1     q39    ;
12679 13410        jl. w3     j0.    ;   setup channel pg and start(kind);
12680 13412  \f


12680 13412  ; pej 26.09.77    disc driver, interrupt received
12681 13412  
12681 13412  ; i n t e r r u p t   r e c e i v e d
12682 13412  ; ---------------------------------------------------------------
12683 13412  ;
12684 13412  ; this routine is entered when driver proc receives an interrupt
12685 13412  ; operation for a disc driver. the i/o result stored in the
12686 13412  ; device description indicates the event leading to generation of
12687 13412  ; the interrupt operation:
12688 13412  ;
12689 13412  ; i/o result 0: normal termination, interrupt from device.
12690 13412  ;            1: bus reject, busy  , device not started.
12691 13412  ;            2: bustimeout, discon, -      -   -
12692 13412  ;            3: software timeout  , software generated.
12693 13412  ;            4: abnormal terminat., interrupt from device.
12694 13412  ;            5: wait pg. terminat., -         -    -
12695 13412  ;            6: power restart     , software generated.
12696 13412  
12696 13412  ; form the compoundstatus from i/o result and all statuswords
12697 13412  ; (curr status, event status) generated by the device.
12698 13412  c34 : rl  w3     b19    ; interrupt received:
12699 13414        rl  w0  x3+a230   ;   if channel pg count.std status = 0
12700 13416        sn  w0     0      ;   then
12701 13418        am      p16+6-a233;   curr-event:= curr-event.statusarea1
12702 13420        dl  w1  x3+a233   ;   else curr-event:=curr-event.stdstatus;
12703 13422        lo  w0  x3+p16+4  ;   curr:= curr or curr.statusarea1;
12704 13424        lo  w1  x3+p16+6  ;   event:= event or event.statusarea1;
12705 13426        rl  w2  x3+p16+20 ;   tech:= techn status.statusarea1;
12706 13428        lo  w0  x3+p18+4  ;   curr:= curr or curr.statusarea2;
12707 13430        lo  w1  x3+p18+6  ;   event:= event or event.statusarea2;
12708 13432        lo  w2  x3+p18+20 ;   tech:= tech or tech.statusarea2;
12709 13434        ds  w1  x3+p31+2  ;   curr-event.curr rec:= curr-event;
12710 13436        rs  w2  x3+p33    ;   technical status.curr rec:= tech;
12711 13438        jl. w3     j8.    ;   compoundstatus(curr,event,compound);
12712 13440        rs  w0  x1+p34    ;   compound status.curr rec:= compound;
12713 13442  
12713 13442  ; check if compound status is ok with respect to actual transfer.
12714 13442        rl  w3  x1+p13    ;
12715 13444        ls  w3    -1      ;   i:= transfer state.curr rec >> 1;
12716 13446        ns. w3     3      ;   sh:= no of shifts to normalize i;
12717 13448        ac  w3  ; -sh     ;
12718 13450        ls  w3     2      ;   sh:= sh * 4;
12719 13452        rl  w2     b18    ;   c. w1 = curr rec, w2 = curr buf;
12720 13454        sz. w0 (x3+i20.)  ;   if compound and table(sh) <> 0
12721 13456        jl.        j125.  ;   then goto error
12722 13458        jl.    (x3+i21.)  ;   else goto table(sh+2);
12723 13460  
12723 13460  ; table to determine if transfer was successful. an entry corre-
12724 13460  ; sponds to a transfer state and contains:
12725 13460  ; +0: mask which anded to compound status must give zero.
12726 13460  ; +2: addr where to continue.
12727 13460  ;     mask        addr    transfer state
12728 13460  i20 :  -1 , i21 : j125  ; bit  0, idle (will always go to error)
12729 13464        i23 ,       j85   ;      1, define disc
12730 13468        i25 ,       j87   ;      2, power restart
12731 13472        i23 ,       j75   ;      3, sense
12732 13476        i23 ,       j75   ;      4, position
12733 13480        i24 ,       j75   ;      5, clean track
12734 13484        i23 ,       j77   ;      6, read data
12735 13488        i23 ,       j77   ;      7, read addr mark
12736 13492        i24 ,       j77   ;      8, write data
12737 13496        i24 ,       j77   ;      9, write addr mark
12738 13500        i24 ,       j77   ;     10, read after write data
12739 13504        i24 ,       j77   ;     11, read after write addr mark
12740 13508  
12740 13508  ; masks, normal term (bit 19) not checked. must be 1.
12741 13508  i23 = 8.77617757        ; input ok, bits not checked: 8,9,10
12742 13508                          ;  (write protect, high density, mode)
12743 13508  i24 = 8.77737757        ; output ok, bits not checked: 9
12744 13508                          ;  (high density)
12745 13508  i25 = 8.37617757        ; power ok, bits not checked: 0,8,9,10
12746 13508                          ;  (intervention, write protect, high
12747 13508                          ;   density, mode)
12748 13508  \f


12748 13508  ; pej 26.09.77    disc driver, successful transfer
12749 13508  
12749 13508  ; s u c c e s s f u l   t r a n s f e r
12750 13508  ; ---------------------------------------------------------------
12751 13508  
12751 13508  ; these routines are entered when a transfer is regarded success-
12752 13508  ; ful. w1 = curr receiver, w2 = curr buf.
12753 13508  
12753 13508  ; c o n t r o l   s u c c e s s f u l
12754 13508  j75 : rl  w0  x1+a56    ; control ok:
12755 13510        se  w0     0      ;   if regretted.curr receiver
12756 13512        jl.        j110.  ;   then goto examine queue;
12757 13514        c.         q1     ;   if statistics wanted
12758 13514        bz  w0  x2+m6     ;
12759 13516        se  w0     0      ;   and retryinf.curr buf <> 0
12760 13518        jl. w3     j17.   ;   then update on corrected error;
12761 13520        z.                ;
12762 13520        jl.        j101.  ;   goto deliver size zero;
12763 13522  
12763 13522  ; t r a n s p u t   s u c c e s s f u l
12764 13522  j77 : al  w0     0      ; transput ok:
12765 13524        sn  w0 (x1+p16+2) ;   if rembytes.statusarea1.curr rec <> 0
12766 13526        se  w0 (x1+p18+2) ;   or rembytes.statusarea2.curr rec <> 0
12767 13528        jl.        j125.  ;   then goto error;
12768 13530        al  w3     1      ;
12769 13532        rl  w0  x1+p21    ;   if setmode param.curr receiver <> 0
12770 13534        se  w0     0      ;   then initdisc.curr receiver:= 1;
12771 13536        hs  w3  x1+p14    ;   c. force heads back to nominal pos;
12772 13538        c.         q1     ;   if statistics wanted
12773 13538        bz  w0  x2+m6     ;
12774 13540        se  w0     0      ;   and retryinf.curr buf <> 0
12775 13542        jl. w3     j16.   ;   then update on corrected error;
12776 13544        z.                ;
12777 13544        bz  w0  x2+m5     ;   segments:= no of segments.curr buf;
12778 13546        jl. w3     j11.   ;   update buf(segments,bytes);
12779 13548  
12779 13548  ; check if more segments are to be transferred at transput
12780 13548  j80 : bz  w0  x2+m9     ;
12781 13550        sn  w0     0      ;   if remaining segms.curr buf = 0
12782 13552        jl.        j103.  ;   then goto deliver wanted;
12783 13554        al  w0     0      ;   c. jumps always at direct disc msg;
12784 13556        hs  w0  x2+m6     ;   retryinformation.curr buf:= 0;
12785 13558        rl  w0  x2+m7     ;   first segment.curr buf:=
12786 13560        rs  w0  x2+m4     ;   next segment.curr buf;
12787 13562        rl  w1  x2+m10    ;   proc:= device.curr buf;
12788 13564        jl. w3     j4.    ;   prepare consecutive segms(proc);
12789 13566        jl.        j55.   ;   goto start;
12790 13568  
12790 13568  ; d e f i n e   d i s c   s u c c e s s f u l
12791 13568  j85 : rl  w0  x1+p16+2  ; define disc ok:
12792 13570        se  w0     0      ;   if rembytes.statusarea1.curr rec <> 0
12793 13572        jl.        j125.  ;   then goto error;
12794 13574        rl  w0  x1+p34    ;   type:=
12795 13576        ls  w0    -14     ;   hi dens.compound status.curr rec;
12796 13578        la  w0     g3     ;   c. 0=dsm801, 1=dsm802;
12797 13580        rs  w0  x1+p5     ;   disctype.curr receiver:= type;
12798 13582        al  w0     1      ;   initdisc.curr receiver:= 1;
12799 13584        hs  w0  x1+p14    ;   c. ensures nominal head position;
12800 13586        wa  w0  x1+p11    ;   define disc head.curr receiver:=
12801 13588        rs  w0  x1+p11    ;   define disc head.curr receiver + 1;
12802 13590        al  w3     8.377  ;   c. test if last addr mark on cylind.;
12803 13592        sz  w3 (x1+p22+4) ;   if nexthead.addrmark.curr rec <> 0
12804 13594        jl.        j55.   ;   then goto start;
12805 13596        wm  w0  x1+p6     ;   segments per cyl.curr receiver:=
12806 13598        rs  w0  x1+p8     ;   define disc head.curr receiver
12807 13600        rl  w0  x1+p22+6  ;   * segments per track.curr receiver;
12808 13602        ls  w0    -16     ;   displacement.curr receiver:=
12809 13604        rs  w0  x1+p9     ;   next sector.addrmark.curr receiver;
12810 13606        al  w0     2      ;   c. sector 0 on odd cylinders;
12811 13608        rs  w0  x1+p12    ;   state.curr receiver:= ready;
12812 13610        jl.        j110.  ;   goto examine queue;
12813 13612  
12813 13612  ; p o w e r   r e s t a r t   s u c c e s s f u l
12814 13612  j87 : rl  w0  x1+p12    ; power restart ok:
12815 13614        sn  w0     1      ;   if state.curr rec = defining disc
12816 13616        al  w0     0      ;   then state.curr rec:= after interven;
12817 13618        rs  w0  x1+p12    ;   c. resume define disc from beginning;
12818 13620        jl.        j110.  ;   goto examine queue;
12819 13622  \f


12819 13622  ; pej 26.09.77    disc driver, deliver answer
12820 13622  
12820 13622  ; d e l i v e r   a n s w e r   r o u t i n e
12821 13622  ; ---------------------------------------------------------------
12822 13622  
12822 13622  ; these routines are entered to deliver the answer to a processed
12823 13622  ; message. upon delivering the answer it is examined if more
12824 13622  ; messages are queued to the driver. if so, next message is pro-
12825 13622  ; cessed, and if not, idle state is entered and a wait program
12826 13622  ; is started. p35+0 and p35+2 contains bytes/chars per segment.
12827 13622  
12827 13622  ; result 1, status blocklength, bytes 0.
12828 13622  j90 : dl. w1     i27.   ; deliver blocklength:
12829 13624        al  w3     0      ;   result:= 1; status:= bit4;
12830 13626        jl.        j106.  ;   segments:= 0; goto deliver;
12831 13628  
12831 13628  ; result 1, status discerror, bytes = what was transferred.
12832 13628  j92 : dl. w1     i28.   ; deliver discerror: result:= 1;
12833 13630        rl  w2     b18    ;   status:= bit11;
12834 13632        jl.        j97.   ;   goto deliver transferred;
12835 13634  
12835 13634  ; result 1, status 0, words contained in ac3
12836 13634  j94 : al  w0     2      ; deliver words wanted: c. w2=curr rec;
12837 13636        al  w1     3      ;   bytes:= 2; chars:= 3;
12838 13638        ds  w1  x2+p35+2  ;   c. w3 = words == segments;
12839 13640        jl.        j104.  ;   goto deliver ok;
12840 13642  
12840 13642  ; result 4, status 0, bytes=what was transferred
12841 13642  j95 : al  w0     4      ; deliver spurious:
12842 13644        al  w1     0      ;   result:= 4; status:= 0;
12843 13646        rl  w2     b18    ;   w2:= curr buf;
12844 13648        jl.        j97.   ;   goto deliver transferred;
12845 13650  
12845 13650  ; result, status corresp. to compound, bytes=what was transferred
12846 13650  j96 :                   ; deliver error:
12847 13650        jl. w3     j10.   ;   set result and status(result,status);
12848 13652  j97 : bz  w3  x2+m8     ; deliver transferred: c. w2 = curr buf;
12849 13654        bs  w3  x2+m9     ;   segments:= segments wanted.curr buf
12850 13656        bz  w2  x2+m0     ;   - remaining segments.curr buf;
12851 13658        so  w2     2.1    ;   if operation.curr buf = control
12852 13660        al  w3     0      ;   then segments:= 0;
12853 13662        jl.        j106.  ;   goto deliver;
12854 13664  
12854 13664  ; result 1, 2, 3, status 0, bytes 0.
12855 13664  j99 : am         3-2    ; deliver unintelligible:
12856 13666  j100: am         2-1    ; deliver rejected       :
12857 13668  j101: al  w0     1      ; deliver size zero      :
12858 13670  j102: al  w1     0      ; deliver status and segms zero:
12859 13672        al  w3     0      ;   status:= 0; segments:= 0;
12860 13674        jl.        j106.  ;   goto deliver;
12861 13676  
12861 13676  ; result 1, status 0, bytes = what was wanted.
12862 13676  j103:                   ; deliver wanted; c. w2 = curr buf;
12863 13676        bz  w3  x2+m8     ;   segment:= segments wanted.curr buf;
12864 13678  j104: dl. w1     i29.   ; deliver ok: result:= 1; status:= 0;
12865 13680  
12865 13680  ; deliver the answer, w0=result, w1=status, w3=segments.
12866 13680  j106: rs  w1     g20    ; deliver:
12867 13682        rl  w1     b19    ;   status.i/o answer:= status;
12868 13684        rs  w3     g21    ;
12869 13686        wm  w3  x1+p35    ;
12870 13688        rx  w3     g21    ;   bytes.i/o answer:= segments * bytes;
12871 13690        wm  w3  x1+p35+2  ;
12872 13692        rs  w3     g22    ;   chars.i/o answer:= segments * chars;
12873 13694        rl  w2  x1+a244   ;   file.i/o answer:= i/o result.curr rec;
12874 13696        rl  w3  x1+p31    ;   block.i/o answer:=
12875 13698        ds  w3     g24    ;   curr status.curr receiver;
12876 13700        rl  w2  x1+p31+2  ;   curr buf(18:19):= event stat.curr rec;
12877 13702        rl  w3  x1+p33    ;   curr buf(20:21):= techn stat.curr rec;
12878 13704        am        (b18)   ;
12879 13706        ds  w3     m8     ;
12880 13708        rs  w0  x1+p35    ;   save result;
12881 13710  ;  w0= result; b18 =buffer
12882 13710        rl  w2  b18       ;  w2:=buffer
12883 13712        rl  w1  x2+a141   ;  w1:= receiver.buf
12884 13714        sh  w1  0         ; 
12885 13716        ac  w1  x1        ;  w1:= absolute value of receiver
12886 13718        sh  w1  6         ; 
12887 13720        jl.     j107.     ; 
12888 13722        rl  w3  x1+a10    ;  w3:= kind(rec);
12889 13724        se  w3  4         ;  if area process then
12890 13726        jl.     j107.     ;  begin
12891 13728        rl  w3  g22       ; 
12892 13730        sn  w0  1         ;  if bytes<>0 then
12893 13732        sn  w3  0         ;  begin
12894 13734        jl.     j107.     ; 
12895 13736        bz  w3  x2+8      ;  if operation = write then
12896 13738        se  w3  q33       ;    nooftiw:=nooftiw+1
12897 13740        am      a412-a411 ;  else
12898 13742        al  w3  x1+a411   ;    nooftir:=nooftir+1;
12899 13744        rl  w2  x3        ; 
12900 13746        al  w2  x2+1      ; 
12901 13748        rs  w2  x3        ; 
12902 13750  j107: jl  w3     g19    ;   deliver result(result);
12903 13752  
12903 13752  ; clean the driver in case of abnormal result.
12904 13752        rl  w0  x1+p35    ;
12905 13754        sl  w0     4      ;   if result > 3
12906 13756        jl. w3     j14.   ;   then clean(result);
12907 13758  
12907 13758  ; examine if more messages are queued.
12908 13758  j110: al  w0     0      ; examine queue: c. w1=curr receiver;
12909 13760        rs  w0  x1+a56    ;   regretted.curr receiver:= 0;
12910 13762        jl  w3     g64    ;   examine queue(queue empty);
12911 13764        jl.        j112.  ;   if not queue empty
12912 13766        jl.        j50.   ;   then goto process next message;
12913 13768  
12913 13768  ; queue is empty, start a wait program. continue at waitnext.
12914 13768  j112: rl  w0     g49    ; start wait: c. w1 = curr receiver;
12915 13770        rs  w0  x1+p13    ;   transfer state.curr receiver:= idle;
12916 13772        rl  w3  x1+a235   ;   dev:= device descr.curr rec;
12917 13774        al  w0     3<2+1  ;   start control + std exit;
12918 13776        ld  w2    -100    ;   buf:= 0; timeout:= eternal;
12919 13778        jd      1<11+100  ;   start i/o(func,timeout,buf,dev);
12920 13780  \f


12920 13780  
12920 13780  ; pej 28.09.77    disc driver, error routine
12921 13780  
12921 13780  ; e r r o r   r o u t i n e
12922 13780  ; ---------------------------------------------------------------
12923 13780  
12923 13780  ; this routine is entered when an interrupt not corresponding to
12924 13780  ; a successful transfer has been received. the treatment of the
12925 13780  ; error takes place by running through a number of actions, each
12926 13780  ; action being executed as a function of the kind of error and
12927 13780  ; the transfer state of the driver.
12928 13780  ;
12929 13780  ; if possible, the transfer is repeated. if the routine is entered
12930 13780  ; due to power restart (or disc power down = possible power break
12931 13780  ; in progress) a loop is entered to check if power comes up again,
12932 13780  ; leaving a possible message being currently processed in the head
12933 13780  ; of the queue.
12934 13780  
12934 13780  ; determine the kind of error
12935 13780  j125:                   ; error: c. w1 = curr receiver;
12936 13780       jl  w2  (b31)        ; call errorlog
12937 13782        jl. w3     j9.    ;   set errorkind(kind);
12938 13784        wa  w0  x1+p13    ;   actionkey:=
12939 13786        rs  w0  x1+p36    ;   errorkind + transfer state.curr rec;
12940 13788        al  w0    -4      ;
12941 13790        rs  w0  x1+p37    ;   actionindex:= -4;
12942 13792  
12942 13792  ; determine if next action is to be executed
12943 13792  j130: rl  w1     b19    ; central action: w1:= curr receiver;
12944 13794  j132: am     (x1+p37)   ; skip:
12945 13796        al  w3     4      ;
12946 13798        rs  w3  x1+p37    ;   action index:= actionindex + 4;
12947 13800        rl  w0  x1+p36    ;
12948 13802        la. w0  x3+i35.   ;   i:= table(actionindex) and actionkey;
12949 13804        bz  w2     1      ; 
12950 13806        sz  w0    (g51)   ;   if i(0:11) = 0
12951 13808        sn  w2     0      ;   or i(12:23) = 0
12952 13810        jl.        j132.  ;   then goto skip;
12953 13812        rl  w2     b18    ;   goto table(actionindex + 2);
12954 13814        jl.    (x3+i36.)  ;   c. with w1 = curr rec, w2 = curr buf;
12955 13816  
12955 13816  b. n25, o16 w.               ; block containing error actions
12956 13816  
12956 13816  ; table guiding the execution of actions. each entry contains:
12957 13816  ; +0: transfer states < 12 + errorkinds
12958 13816  ;     the action is executed if the actionkey (see above) anded
12959 13816  ;     to this word gives nonzero in both bytes.
12960 13816  ; +2: action address.
12961 13816  ; ---------------------------------------------------------------
12962 13816  ;       ----transfer states----        --error kinds--       actions
12963 13816  ;                   read
12964 13816  ;                       write          d a i p p t w d a o
12965 13816  ;                           read aft.    f n o o i r a d t
12966 13816  ;       i d p s p c d a d a d a        o t t w w m   t d h
12967 13816  ;       d e o e o l a d a d a d        v   e e e e p a r e
12968 13816  ;       l f w n s e t d t d t d        e d r r r o r     r
12969 13816  ;       e i e s   a a r a r a r        r   v     u o e e
12970 13816  ;         n r e   n                    r o   r d t t r r
12971 13816  ; ---------------------------------------------------------------
12972 13816  ;                              action 1                      vacant
12973 13816  i35: 2. 1 1 1 0 1 1 1 1 1 1 1 1 <12+2.     1 1 1 1 0 0 1 1 , i36: n2
12974 13820       2.             1 1 1 1 0 0 <12+2. 1 1 1 1 1 1 1 1 1 1 ,      n3
12975 13824       2.                     1 1 <12+2. 1 1 1 1 1 1 1 1 1 1 ,      n4
12976 13828       2.       1 1 1 0 0 0 0 0 0 <12+2.           1 0 1 1 1 ,      n5
12977 13832       2.       1 1 1 1 1 1 1 1 1 <12+2.           1 0 1 1 1 ,      n6
12978 13836       2.             1 0 0 0 0 0 <12+2.               1 0 0 ,      n7
12979 13840  c. q1
12980 13840       2.             1 1 1 1 1 1 <12+2.           1 0 1 1 1 ,      o7
12981 13844  z.
12982 13844       2.             1 1 0 0 0 0 <12+2.               1 1 0 ,      n8
12983 13848       2.             1 1 0 0 0 0 <12+2.           1 0 0 0 0 ,      o8
12984 13852       2.       1 1 1 1 1 1 1 0 0 <12+2.           1 0 1 1 1 ,      n9
12985 13856       2.                     1 1 <12+2.           1 0 1 1 1 ,      n10
12986 13860       2. 1 1 0 1 1 1 1 1 1 1 1 1 <12+2.         1 0 0 0 0 0 ,      n11
12987 13864       2. 1 1 1 1 1 1 1 1 1 1 1 1 <12+2.       1 0 0 0 0 0 0 ,      n12
12988 13868       2.     1 0 0 0 0 0 0 0 0 0 <12+2.           1 0 0 0 0 ,      n13
12989 13872       2.     1 0 0 0 0 0 0 0 0 0 <12+2. 1 1 1 1 1 1 1 1 1 1 ,      n14
12990 13876       2. 1 1 1 1 1 1 1 1 1 1 1 1 <12+2.     1 0 0 0 0 0 0 0 ,      n17
12991 13880       2.           1 0 0 1 1 1 1 <12+2.             1 0 0 0 ,      n16
12992 13884       2.       1 1 0 1 1 0 0 0 0 <12+2.             1 0 0 0 ,      o16
12993 13888       2. 1 0 0 0 0 0 0 0 0 0 0 0 <12+2. 1 1 1 1 1 1 1 1 1 1 ,      n17
12994 13892       2.   1 0 0 0 0 0 0 0 0 0 0 <12+2.                 1 0 ,      n18
12995 13896       2.   1 0 0 0 0 0 0 0 0 0 0 <12+2. 1 1 1 1 1 1 1 1 1 1 ,      n19
12996 13900       2. 1 1 1 1 1 1 1 1 1 1 1 1 <12+2.   1 0 0 0 0 0 0 0 0 ,      n20
12997 13904       2. 1 1 1 1 1 1 1 1 1 1 1 1 <12+2. 1 0 0 0 0 0 0 0 0 0 ,      n21
12998 13908       2. 1 1 1 1 1 1 1 1 1 1 1 1 <12+2. 1 1 1 1 1 1 1 1 1 1 ,      n22
12999 13912  
12999 13912  \f


12999 13912  ; pej 28.09.77    disc driver, error routine
13000 13912  
13000 13912  ; action 2: set initdisc
13001 13912  ; tr.state: all, except sense
13002 13912  ; err.kind: all, except overrrun, write prot, and data err
13003 13912  n2  : al  w0     1     ;   initdisc.curr receiver:= 1;
13004 13914        hs  w0  x1+p14   ;
13005 13916        jl.        j130. ;   goto central action;
13006 13918  
13006 13918  ; action 3: update buf at error at read or simple write.
13007 13918  ; tr.state: read data, read addr m, write data, write addr m
13008 13918  ; err.kind: any
13009 13918  n3  : al  w2  x1+p16    ;   area:= statusarea1.curr receiver;
13010 13920        al. w3     j130.  ;   update buf on err(area,bytes,chars);
13011 13922        jl.        j12.   ;   goto central action;
13012 13924  
13012 13924  ; action 4: update buf at read after write error.
13013 13924  ; tr.state: read after write data, read after write addr m.
13014 13924  ; err.kind: any
13015 13924  n4  : al  w0     0      ;   c. test if first transfer (write) ok;
13016 13926        rs  w0  x1+p38    ;   write ok:= 0; c. see action 10;
13017 13928        se  w0 (x1+p16)   ;   if chan pg count.status1.curr rec = 0
13018 13930        se  w0 (x1+p16+2) ;   or rembytes.statusarea1.curr rec <> 0
13019 13932        jl.        j130.  ;   then goto central action; c. not ok;
13020 13934        dl  w1  x1+p16+6  ;
13021 13936        jl. w3     j8.    ;   compoundstatus(curr,event,compound);
13022 13938        sz. w0    (i40.)  ;   if compound and output ok <> 0
13023 13940        jl.        j130.  ;   then goto central action; c. not ok;
13024 13942        rs  w1  x1+p38    ;   write ok:= <> 0; c. see action 10;
13025 13944        al  w2  x1+p18    ;   area:= statusarea2.curr receiver;
13026 13946        al. w3     j130.  ;   update buf on err(area,bytes,chars);
13027 13948        jl.        j12.   ;   goto central action;
13028 13950  
13028 13950  ; action 5: repeatable error, test if control message regretted.
13029 13950  ; tr.state: sense, position, clean track
13030 13950  ; err.kind: timeout, data error, addr mark error, other error
13031 13950  n5  : al  w0     0      ;
13032 13952        sn  w0 (x1+a56)   ;   if regretted.curr receiver = 0
13033 13954        jl.        j130.  ;   then goto central action
13034 13956        jl.        j110.  ;   else goto examine queue;
13035 13958  
13035 13958  ; action 6: repeatable error, test if transfer may be repeated.
13036 13958  ; tr.state: any, except idle, define disc, power restart
13037 13958  ; err.kind: timeout, data error, addr mark error, other error
13038 13958  n6  :                   ;
13039 13958        c.         q1     ;   if statistics wanted then
13040 13958        am     (x1+p41)   ;   begin
13041 13960        al  w3     1      ;     count:= not successful.curr rec + 1;
13042 13962        bz  w0  x2+m6     ;
13043 13964        sn  w0     0      ;     if retryinf.curr buf = 0 then
13044 13966        rs  w3  x1+p41    ;     not successful.curr rec:= count;
13045 13968        z.                ;   end;
13046 13968        bz  w0  x2+m1     ;
13047 13970        sz  w0     q41    ;   if -, error recovery.mode.curr buf
13048 13972        jl.        j96.   ;   then goto deliver error
13049 13974        jl.        j130.  ;   else goto central action;
13050 13976  
13050 13976  ; action 7: data error at read, try to repair by ecc.
13051 13976  ; tr.state: read data
13052 13976  ; err.kind: data error
13053 13976  n7  : jl. w3     j15.   ;   correct data;
13054 13978        jl.        j130.  ;   if not corrected then goto cent act.;
13055 13980        al  w0     1      ;   segments:= 1;
13056 13982        rl  w1     b19    ;   c. one segment, the last, corrected;
13057 13984        rl  w2     b18    ;
13058 13986        jl. w3     j11.   ;   update buf(segments,bytes);
13059 13988        c.         q1     ;   if statistics wanted then
13060 13988        am     (x1+p42)   ;   begin
13061 13990        al  w3     1      ;     count:= ecc corrected.curr rec + 1;
13062 13992        bz  w0  x2+m6     ;
13063 13994        sn  w0     0      ;     if retryinf.curr buf = 0
13064 13996        rs  w3  x1+p42    ;     then ecc corrected.curr rec:= count
13065 13998        se  w0     0      ;
13066 14000        jl. w3     j16.   ;     else update on corrected error;
13067 14002        z.                ;   end;
13068 14002        al  w0     0      ;   if setmode param.curr rec = 0
13069 14004        sn  w0 (x1+p21)   ;   then initdisc.curr rec:= 0;
13070 14006        hs  w0  x1+p14    ;   c. init not necessary;
13071 14008        hs  w0  x2+m6     ;   retryinf.curr buf:= 0;
13072 14010        bz  w0  x2+m5     ;   c. check if entire transfer now ok;
13073 14012        sn  w0     0      ;   if no of segments.curr buf = 0
13074 14014        jl.        j80.   ;   then goto check if more
13075 14016        jl.        j55.   ;   else goto start;
13076 14018  
13076 14018  ; action 7a, update table of error segments
13077 14018  ; tr.state : read data, read addr m, write data, write addr m,
13078 14018  ;            read after write data, read after write addr m
13079 14018  ; err.kind : timeout, data error, addr mark error, other error
13080 14018  o7  : c.         q1     ;   if statistics wanted then
13081 14018        bz  w0  x2+m6     ;   begin
13082 14020        se  w0     0      ;     if retryinf.curr buf <> 0
13083 14022        jl.        j130.  ;     then goto central action;
13084 14024        rl  w3  x2+m4     ;     c. already registrated;
13085 14026        am     (x2+m10)   ;     segment:= first segment.curr buf
13086 14028        wa  w3     p3     ;     + first segment.device.curr buf;
13087 14030        al  w2  x1+p46    ;     entry:= 1st error segm.curr rec;
13088 14032  j141: sl  w2  x1+p46+q2*6;    while entry <> top entry do
13089 14034        jl.        j130.  ;     begin
13090 14036        sh  w0 (x2+0)     ;       if segment no.entry < 0
13091 14038        sn  w3 (x2+0)     ;       or segment no.entry = segment
13092 14040        jl.        j143.  ;       then goto found; increase entry;
13093 14042        al  w2  x2+6      ;     end;
13094 14044        jl.        j141.  ;     goto central action; c. table full;
13095 14046  j143: rs   w3  x2+0     ; found:
13096 14048        am         (b18)  ;     segment no.entry:= segment;
13097 14050        ba  w2     m0     ;     i:= operation.curr buf;
13098 14052        bz  w1  x2+0      ;
13099 14054        al  w1  x1+1      ;     entry(i):= entry(i) + 1;
13100 14056        hs  w1  x2+0      ;
13101 14058        jl.        j130.  ;   end;
13102 14060        z.                ;   goto central action;
13103 14060  
13103 14060  ; action 8, data error or addr m error at read, use strobe-offset
13104 14060  ; tr.state: read data, read addr mark
13105 14060  ; err.kind: data error, addr mark error
13106 14060  n8  : al  w1  x2+m6     ;   retryinf:= retryinf.curr buf;
13107 14062        jl. w3     j13.   ;   update retryinformation(retryinf);
13108 14064        jl.        j96.   ;   if no more tries goto deliver error;
13109 14066        jl.        j147.  ;
13110 14068        jl.        j145.  ;   if next offset magnitude used then
13111 14070        jl.        j147.  ;   begin c. may buf be requeued;
13112 14072  j145: rl  w2     b18    ;
13113 14074        bz  w0  x2+m1     ;
13114 14076        sz  w0     q42    ;     if requeue.curr buf = no requeue
13115 14078        jl.        j92.   ;     then goto deliver discerror;
13116 14080        jl  w3     d5     ;     c. remove and link the buf to q end;
13117 14082        am        (b19)   ;     remove(curr buf);
13118 14084        al  w1     a54    ;
13119 14086        jl  w3     d6     ;     link(mess queue.curr rec,curr buf);
13120 14088        rl  w1     b19    ;     goto examine queue;
13121 14090        jl.        j110.  ;   end;
13122 14092  j147: al  w0     2.10   ;   c. initdisc may be skipped if data
13123 14094        rl  w1     b19    ;      error as the correct segment was
13124 14096        la  w0  x1+p36    ;      read;
13125 14098        sn  w0     0      ;   if actionkey and -, addr mark error
13126 14100        hs  w0  x1+p14    ;   then initdisc.curr rec:= 0;
13127 14102        jl.        j55.   ;   goto start;
13128 14104  ; action 8a: timeout at read, simulate address mark error if
13129 14104  ;            timeout is possibly caused by use of strobe -
13130 14104  ;            offset (synchronization chars out of reach).
13131 14104  ; tr.state : read data, read addr m
13132 14104   
13132 14104  ; err.kind : timeout
13133 14104  o8:   bz  w3  x2+m6     ;
13134 14106        sh  w3  2.111     ; if retryinf.curr buf <> strobe.offset
13135 14108        jl.     j130.     ; used then goto central action;
13136 14110        la. w3  i45.      ; c. force next offset magnitude;
13137 14112        wa. w3  i44.      ; retryinf.curr buf:= last modeindex < 8
13138 14114        hs  w3  x2+m6     ; +offset.retryinf.curr buf + maxtries;
13139 14116        rl  w3  x1+p36    ; c. simulate addr mark error;
13140 14118        al  w3  x3-2.10000; action key.cur rec:=
13141 14120        al  w3  x3+2.10   ; action key.curr rec
13142 14122        rs  w3  x1+p36    ; -timeout + addr m error;
13143 14124        rl. w3  i43.      ; compound status.curr rec:=
13144 14126        rs  w3  x1+p34    ; data err + hard err + abnorm term;
13145 14128        jl.     n8.       ; goto action 8;
13146 14130  
13146 14130  ; action 9: error at control, read, simple write. repeat transfer
13147 14130  ; tr.state: sense, position, clean track,
13148 14130  ;           read data, read addr m, write data, write addr m
13149 14130  ; err.kind: timeout, data error, addr mark error, other error
13150 14130  n9  : al  w1  x2+m6     ;   retryinf:= retryinf.curr buf;
13151 14132        jl. w3     j13.   ;   update retryinformation(retryinf);
13152 14134        jl.        j98.   ;
13153 14136        jl.        j98.   ;
13154 14138        jl.        j98.   ;   if tries <= 3 then goto start
13155 14140        jl.        j55.   ;   else goto deliver error;
13156 14142  j98:  rl  w1     b19    ;
13157 14144        al  w0     0      ;   if more than 3 timeouts then
13158 14146        rs  w0  x1+p12    ;   then execute initdisc before next operation
13159 14148        jl.        j96.   ;   (possible kitshift in progress)
13160 14150  
13160 14150  ; action 10: error at read after write, repeat transfer.
13161 14150  ; tr.state : read after write data, read after write addr mark
13162 14150  ; err.kind : timeout, data error, addr mark error, other error
13163 14150  n10 : rl  w0  x1+p38    ;   c. see action 4 re. write ok;
13164 14152        bz  w3  x2+m6     ;   r:= retryinformation.curr buf; c. w3;
13165 14154        sn  w0     0      ;   if write ok then
13166 14156        jl.        j150.  ;   begin c. repeat 2nd transfer (read);
13167 14158        al  w3  x3+1      ;     readtries.r:= readtries.r + 1;
13168 14160        so  w3     2.100  ;     if readtries.r <= 3 then goto rep;
13169 14162        jl.        j151.  ;   end;
13170 14164  j150: la. w3     i41.   ;   c. repeat 1st transfer (write);
13171 14166        al  w3  x3+2.1000 ;   readtries.r:= 0; incr writetries.r;
13172 14168        sz  w3     2.100<3;   if writetries.r > 3
13173 14170        jl.        j96.   ;   then goto deliver error;
13174 14172  j151: hs  w3  x2+m6     ; rep: retryinformation.curr buf:= r;
13175 14174        jl.        j55.   ;   goto start;
13176 14176  
13176 14176  ; action 11: disc power down, enter power restart loop.
13177 14176  ; tr.state : any, except power restart
13178 14176  ; err.kind : power down
13179 14176  n11 : am         q14-q13; power down:   n:= no of times to sense disc;
13180 14178  
13180 14178  ; action 12: power restart, enter power restart loop.
13181 14178  ; tr.state : any
13182 14178  ; err.kind : power restart
13183 14178  n12 : al  w3     q13    ;   n:= no of times to sense disc;
13184 14180        al  w0     0      ;
13185 14182        sn  w0 (x1+p12)   ;   if state.curr rec = after intervent.
13186 14184        jl.        n15.   ;   then goto intervention;
13187 14186        al  w0     1      ;   regretted.curr receiver:= 1;
13188 14188        rs  w0  x1+a56    ;   c. to prevent start if buf arrives;
13189 14190        jl.        j154.  ;   goto power sense;
13190 14192  
13190 14192  ; action 13: sense disc in power restart loop.
13191 14192  ; tr.state : power restart
13192 14192  ; err.kind : timeout
13193 14192  n13 : bz  w3  x1+p15    ;   n:= retryinformation.curr receiver;
13194 14194        al  w3  x3-1      ;   n:= n - 1;
13195 14196        sh  w3    -1      ;   if n < 0 then goto intervention;
13196 14198        jl.        n15.   ; power sense: c. w3 = n;
13197 14200  j154: hs  w3  x1+p15    ;   retryinformation.curr receiver:= n;
13198 14202        al  w1     q39+2  ;   kind:= power restart;
13199 14204        jl. w3     j0.    ;   setup channelprogram and start(kind);
13200 14206                          ;   c. cont. at waitnext in driverproc;
13201 14206  
13201 14206  ; action 14: delay before next sense in power restart loop.
13202 14206  ; tr.state : power restart
13203 14206  ; err.kind : any
13204 14206  n14 : rl  w3  x1+a235   ;   dev:= device descr.curr rec;
13205 14208        al  w0     2<2+1  ;   function:= start wait, std exit;
13206 14210        rl. w1     i42.   ;   timer:= time between sense in loop;
13207 14212        al  w2     0      ;   buf:= 0;
13208 14214        jd      1<11+100  ;   start i/o(function,timer,buf,dev);
13209 14216                          ;   c. cont. at waitnext in driverproc;
13210 14216  
13210 14216  ; action 15: intervention.
13211 14216  ; tr.state : any
13212 14216  ; err.kind : intervention
13213 14216  n15 : al  w0     5      ; intervention: result:= 5; c. unknown;
13214 14218        jl. w3     j14.   ;   clean(result);
13215 14220        jl        (b20)   ;   goto waitnext; c. in driver proc;
13216 14222  
13216 14222  ; action 16: write protect at output.
13217 14222  ; tr.state : clean track, all write states
13218 14222  ; err.kind : write protect
13219 14222  n16 : jl.        j100.  ;   goto deliver rejected;
13220 14224  
13220 14224  ; action 16a: write protect at control, read. repeat transfer.
13221 14224  ; tr.state  : sense, position, read data, read a m
13222 14224  ; err.kind  : write protect
13223 14224  o16 : al  w1  x2+m6     ;   retryinf:= retryinf.curr buf;
13224 14226        jl. w3     j13.   ;   update retryinformation(retryinf);
13225 14228        jl.        j95.   ;
13226 14230        jl.        j95.   ;
13227 14232        jl.        j95.   ;   if tries <= 3 then goto start
13228 14234        jl.        j55.   ;   else goto deliver spurious;
13229 14236  
13229 14236  ; action 17: wait program terminated not because of intervention.
13230 14236  ; tr.state : idle
13231 14236  ; err.kind : any
13232 14236  n17:  jl.     n11.      ; goto power down;
13233 14238  
13233 14238  ; action 18: addr mark error at define disc, use stobe-offset.
13234 14238  ; tr.state : define disc
13235 14238  ; err.kind : addr mark error
13236 14238  n18 : al  w1  x1+p15    ;   retryinf:= retryinf.curr receiver;
13237 14240        jl. w3     j13.   ;   update retryinformation(retryinf);
13238 14242        jl.        j160.  ;   if no more tries possible then
13239 14244        jl.        j55.   ;
13240 14246        jl.        j55.   ;
13241 14248        jl.        j55.   ;   begin c. try next even cylinder
13242 14250  j160: rl  w1     b19    ;
13243 14252        am     (x1+p10)   ;
13244 14254        al  w0     2      ;     define disc cyl.curr rec:=
13245 14256        rs  w0  x1+p10    ;     define disc cyl.curr rec + 2;
13246 14258        al  w0     0      ;     define disc head.curr rec:= 0;
13247 14260        rs  w0  x1+p11    ;     retryinformation.curr rec:= 0;
13248 14262        hs  w0  x1+p15    ;   end;
13249 14264        jl.        j55.   ;   goto start;
13250 14266  
13250 14266  ; action 19: error at define disc. repeat transfer.
13251 14266  ; tr.state : define disc
13252 14266  ; err.kind : any
13253 14266  n19 : al  w1  x1+p15    ;   retryinf:= retryinf.curr receiver;
13254 14268        jl. w3     j13.   ;
13255 14270        jl.        j162.  ;
13256 14272        jl.        j162.  ;
13257 14274        jl.        j162.  ;
13258 14276        jl.        j55.   ;   if tries <= 3 then goto start;
13259 14278  j162: al  w0     4      ;   result:= 4; c. malfunction;
13260 14280        jl. w3     j14.   ;   clean(result);
13261 14282        al  w0     0      ;
13262 14284        rs  w0  x1+p12    ;   state.curr rec:= after intervention;
13263 14286        jl        (b20)   ;   goto waitnext; c. in driverproc;
13264 14288    
13264 14288  ; action 20: repeat transfer in data overrun loop
13265 14288  ; tr.state : any
13266 14288  ; err.kind : after data overrun
13267 14288  n20 : al  w0     0      ;   
13268 14290        rs  w0  x1+a56    ;   regretted.curr receiver:= 0;
13269 14292        bz  w3  x1+p15    ;   n:= retryinf.curr receiver;
13270 14294        al  w3  x3+1      ;   n:= n+1;
13271 14296        sl  w3     q15    ;   if n > max no of retries
13272 14298        jl.        j96.   ;      then goto deliver error
13273 14300        hs  w3  x1+p15    ;      else begin
13274 14302        jl.        j55.   ;             retryinf.curr receiver:= n;
13275 14304                          ;             goto start;
13276 14304                          ;           end;
13277 14304    
13277 14304  ; action 21: start wait in data overrun loop
13278 14304  ; tr.state : any
13279 14304  ; err.kind : data overrun
13280 14304  n21 : bz  w0  x2+m1     ;
13281 14306        sz  w0     q41    ;   if -,error recovery.mode.curr buf
13282 14308        jl.        j96.   ;      then goto deliver error;
13283 14310        al  w0     1      ;   regretted.curr receiver:= 1;
13284 14312        rs  w0  x1+a56    ;   c. to prevent start if buf arrives
13285 14314        rl  w3  x1+a235   ;   dev:= device descr.curr receiver;
13286 14316        al  w1  x3        ;   timer:= (dev >> 5) << 9;
13287 14318        ls  w1    -5      ;   c. (controller io no)*512;
13288 14320        ls  w1     9      ;   c. to ensure diff. waiting periods for diff. devices
13289 14322        al  w0     2<2+1  ;   function:= start wait, std exit;
13290 14324        al  w2     0      ;   buf:= 0;
13291 14326        jd      1<11+100  ;   start io(function,timer,buf,dev);
13292 14328  
13292 14328  ; action 22: final action, acts as a stopper.
13293 14328  ; tr.state : any
13294 14328  ; err.kind : any
13295 14328  n22 : al  w0     4      ;   result:= 4; c. malfunction;
13296 14330        jl. w3     j14.   ;   clean(result);
13297 14332        jl.        j112.  ;   goto start wait;
13298 14334  
13298 14334  e.                      ; end of block containing error actions
13299 14334  \f


13299 14334  
13299 14334  ; pej 04.10.77    disc driver, variables
13300 14334  
13300 14334  ; m o d e   t a b l e
13301 14334  ; each entry contains strobe and offset information corre-
13302 14334  ; sponding to bit 16-19 in a setmode parameter. modeindex in
13303 14334  ; retryinformation - 1 is an index to the table.
13304 14334  q23  = 3                ; first mode index in next round
13305 14334  q24 = 8                 ; last modeindex
13306 14334  h.                      ;     strobe  offset
13307 14334  q20 : 2.0100<4          ; +0: late
13308 14335        2.1000<4          ; +1: early
13309 14336        2.0001<4          ; +2:         negative
13310 14337        2.0010<4          ; +3:         positive
13311 14338        2.0101<4          ; +4: late    negative
13312 14339        2.0110<4          ; +5: late    positive
13313 14340        2.1001<4          ; +6: early   negative
13314 14341        2.1010<4          ; +7: early   positive
13315 14342        -1                ; +8: top of table
13316 14343  
13316 14343  ; o f f s e t   t a b l e
13317 14343  ; each entry contains offset magnitude corresponding to bit 20-23
13318 14343  ; in a setmode parameter. offset index in retryinformation is
13319 14343  ; an index to the table.
13320 14343  q21 : 8,15,1,3,6,10,13,2,4,5,7,9,11,12,14 ; +0 - +14
13321 14358        -1                                  ; +15: top entry
13322 14359  w.
13323 14360  
13323 14360  ; variables
13324 14360        1                 ;                    -2: result (1)
13325 14362  i27 : 8.02000000        ; blocklength error: +0: status (bit 4)
13326 14364        1                 ;            -2: result (1)
13327 14366  i28 : 8.00010000        ; discerror: +0: status (bit 11)
13328 14368        1                 ;     -2: result (1)
13329 14370  i29 : 0                 ; ok: +0: status(0)
13330 14372  i40 : i24               ; mask for zeroes in compound at output
13331 14374  i41 : 2.11111000        ; mask for zeroizing readtries.retryinf
13332 14376  i42 : q10               ; time between sense in power rest. loop
13333 14378  i43:  1<22+1<19+1<8     ; compound status: data or hard err,abnorm term
13334 14380  i44:  q24<8+3           ; last modeindex<8+maxtries(retry inf)
13335 14382  i45:  2.000011111000    ; mask for zeroize modeindex or tries (retryinf)
13336 14384  
13336 14384  \f


13336 14384  
13336 14384  
13336 14384  ; pej 26.09.77    disc driver, compound status
13337 14384  
13337 14384  ; procedure compoundstatus(curr status,event status,compound)
13338 14384  ; ---------------------------------------------------------------
13339 14384  ;
13340 14384  ; the procedure performs:
13341 14384  ; - creates a compound status word from curr status and event
13342 14384  ;   status and i/o result from device descr, so that:
13343 14384  ;
13344 14384  ;   bit  0   intervention            event status bit  0
13345 14384  ;        1   data error              -     -      -    1
13346 14384  ;        2   (unused, = 0)
13347 14384  ;        3   data overrun            -     -      -    3
13348 14384  ;        4   hard error              -     -      -    4
13349 14384  ;        5   position error          -     -      -    5
13350 14384  ;        6   power low               curr  -      -    0
13351 14384  ;        7   local                   -     -      -    1
13352 14384  ;        8   write protect           -     -      -    8
13353 14384  ;        9   high density            -     -      -    9
13354 14384  ;       10   mode                    -     -      -   10
13355 14384  ;       11   seek error              -     -      -    5
13356 14384  ;       12   (unused, = 0)
13357 14384  ;       13   power restart           i/o result        6
13358 14384  ;       14   wait pg. terminated     -   -             5
13359 14384  ;       15   abnormal termination    -   -             4
13360 14384  ;       16    software timeout       -   -             3
13361 14384  ;       17    bustimeout, disconn.   -   -             2
13362 14384  ;       18   bus reject, busy        -   -             1
13363 14384  ;       19   normal termination      -   -             0
13364 14384  ;       20   bus com, error          event status bit 20
13365 14384  ;       21   interrupt error         -     -      -   21
13366 14384  ;       22   bustimeout              -     -      -   22
13367 14384  ;       23   bus parity error        -     -      -   23
13368 14384  ;
13369 14384  ; registers: call              exit
13370 14384  ; wo         curr status       compound status
13371 14384  ; w1         event status      curr receiver
13372 14384  ; w2                           destroyed
13373 14384  ; w3         link              unchanged
13374 14384  ;
13375 14384  ; entry    : j8
13376 14384  ;
13377 14384  ; return   : link+0
13378 14384  b. i1 w.
13379 14384  j8  :                   ; compound status:
13380 14384        rl  w2     0      ;   i:= curr status >> 6;
13381 14386        ls  w2    -6      ;   c. bit(6:7):= bit(0:1), bit11:= bit5;
13382 14388        lo  w2     0      ;   i:= i or curr status;
13383 14390        la. w2     i0.    ;   i:= i and bit 6,7,8,9,10,11;
13384 14392        la. w1     i1.    ;   mask out unused event status bits;
13385 14394        lo  w1     4      ;   compound:= event status or i; c. w1;
13386 14396        al  w0     2.10000;   i:= bit 19;
13387 14398        am        (b19)   ;
13388 14400        rl  w2     a244   ;   sh:= i-o result.curr receiver;
13389 14402        ls  w0  x2+0      ;   i:= i shift sh; c. w0;
13390 14404        lo  w0     2      ;   compound:= compound or i; c. w0;
13391 14406        rl  w1     b19    ;
13392 14408        jl      x3+0      ;
13393 14410  
13393 14410  ; variables
13394 14410  i0  : 8.00770000        ; bit 6,7,8,9,10,11
13395 14412  i1  : 8.67000017        ; bit 0,1,3,4,5,20,21,22,23
13396 14414  e.
13397 14414  \f


13397 14414  ; pej 27.09.77    disc driver, set errorkind
13398 14414  
13398 14414  ; procedure set errorkind(errorkind)
13399 14414  ; --------------------------------------------------------------
13400 14414  ; errorkind: bit 14: data overrun
13401 14414  ;                15: after data overrun
13402 14414  ;                16: intervention
13403 14414  ;                17: power restart
13404 14414  ;                18: power down (disc power)
13405 14414  ;                19: time out
13406 14414  ;                20: write protect
13407 14414  ;                21: data error
13408 14414  ;                22: addr mark error
13409 14414  ;                23: other error
13410 14414  ;
13411 14414  ; the procedure performs:
13412 14414  ; - updates tables of compound status and technical statusbits
13413 14414  ;   if statistics wanted.
13414 14414  ; - sets the errorkind as a function of bits in compound status
13415 14414  ;   and bits in statuswords stored by controller.
13416 14414  ;
13417 14414  ; registers: call              exit
13418 14414  ; w0                           errorkind
13419 14414  ; w1         curr receiver     unchanged
13420 14414  ; w2                           compound status
13421 14414  ; w3         link              destroyed
13422 14414  ;
13423 14414  ; entry    : j9
13424 14414  ;
13425 14414  ; return   : link+0
13426 14414  
13426 14414  b. i30 w.
13427 14414  j9  : rs. w3     i10.   ; set errorkind: save link;
13428 14416        c.         q1     ;   if statistics wanted then
13429 14416        rl  w0  x1+p34    ;   begin
13430 14418        rl  w2  x1+p33    ;     i:= 0;
13431 14420        al  w3  x1+p47    ;     repeat
13432 14422  i26 : sl  w0     0      ;       if compound(i).curr rec = 1
13433 14424        jl.        i27.   ;
13434 14426        al  w1     1      ;       then
13435 14428        ba  w1  x3+0      ;       compound table(i).curr rec:=
13436 14430        hs  w1  x3+0      ;       compound table(i).curr rec + 1;
13437 14432  i27 : sl  w2     0      ;       if technical(i).curr rec = 1
13438 14434        jl.        i28.   ;
13439 14436        al  w1     1      ;       then
13440 14438        ba  w1  x3+p48-p47;       technical table(i).curr rec:=
13441 14440        hs  w1  x3+p48-p47;       technical table(i).curr rec + 1;
13442 14442  i28 : al  w3  x3+1      ;
13443 14444        ls  w0     1      ;
13444 14446        ls  w2     1      ;       i:= i + 1
13445 14448        sn  w0     0      ;     until compound(i+1:23) = 0 and
13446 14450        se  w2     0      ;           technical(i+1:23) = 0;
13447 14452        jl.        i26.   ;
13448 14454        rl  w1     b19    ;
13449 14456        z.                ;   end;
13450 14456        rl  w2  x1+p34    ;   ac2:= compound status.curr rec;
13451 14458        so. w2    (i6.)   ;   if data overrun then
13452 14460        jl.        i29.   ;   begin
13453 14462        sz  w2     8.200  ;     if timeout
13454 14464        jl.        i15.   ;        then goto after data overrun
13455 14466        jl.        i14.   ;        else goto data overrun;
13456 14468  i29 :                   ;   end;
13457 14468        rl  w3  x1+p16+6  ;   event:= event.statusarea 1.curr rec;
13458 14470        sz. w2    (i0.)   ;   if compound and mask1 = 0
13459 14472        jl.        i24.   ;
13460 14474        so. w3    (i1.)   ;   and dataerr.event and harderr.event
13461 14476        jl.        i24.   ;   then goto data error;
13462 14478        jl.        i21.   ;
13463 14480  i24 : rl  w0  x1+a233   ;   event:= event.std status.curr rec;
13464 14482        sz. w2    (i2.)   ;   if compound and mask2 = 0
13465 14484        jl.        i25.   ;
13466 14486        rl  w3  x1+a230   ;
13467 14488        se  w3     0      ;   and chan pg count.std status.curr rec
13468 14490        bz  w3  x3-6+1    ;       <> 0
13469 14492        ls  w3    -8      ;   and latest command executed = read
13470 14494        sn  w3     1      ;
13471 14496        so. w0    (i3.)   ;   and harderr.event and pos err.event
13472 14498        jl.        i25.   ;
13473 14500        jl.        i22.   ;   then goto addr mark error;
13474 14502  i25 : sz  w2     8.2000 ;   if power restart.compound
13475 14504        jl.        i17.   ;   then goto power restart;
13476 14506        sz. w2    (i4.)   ;   if powlow.compound or discon.compound
13477 14508        jl.        i18.   ;   then goto power low;
13478 14510        sz  w2     8.200  ;   if timeout.compound
13479 14512        jl.        i19.   ;   then goto timeout;
13480 14514        sz. w2    (i5.)   ;   if interv.compound or local.compound
13481 14516        jl.        i13.   ;   then goto check power up;
13482 14518        sz. w2    (i7.)   ;   if write protect.compound
13483 14520        jl.        i20.   ;   then goto write protect
13484 14522        jl.        i23.   ;   else goto other error;
13485 14524  i13:                    ; check power up:
13486 14524        rl  w0     b75    ;   if power up not yet serviced
13487 14526        se  w0     0      ;   by clockdriver
13488 14528        jl.        i18.   ;   then goto power down
13489 14530        jl.        i16.   ;   else goto intervention;
13490 14532  i14 : am         512-256; data overrun   : set kind bit 14
13491 14534  i15 : am         256-128; aft. data ov.  :              15
13492 14536  i16 : am         128-64 ; intervention   :              16
13493 14538  i17 : am          64-32 ; power restart  :              17
13494 14540  i18 : am          32-16 ; power down     :              18
13495 14542  i19 : am          16-8  ; time out       :              19
13496 14544  i20 : am           8-4  ; write protect  :              20
13497 14546  i21 : am           4-2  ; data error     :              21
13498 14548  i22 : am           2-1  ; addr mark error:              22
13499 14550  i23 : al  w0       1    ; other error    :              23;
13500 14552        jl.       (i10.)  ;   return;
13501 14554  
13501 14554  ; variables
13502 14554  i0  : 8.45613757        ; mask1, data error, mask for zeroes
13503 14556  i1  : 8.22000000        ; bit 1,4
13504 14558  i2  : 8.44613377        ; mask2, addr mark err, mask for zeroes
13505 14560  i3  : 8.03000000        ; bit 4,5
13506 14562  i4  : 8.00400100        ; bit 6,17
13507 14564  i5  : 8.40200000        ; bit 0, 7
13508 14566  i6  : 8.04000000        ; bit 3, data overrun
13509 14568  i7  : 8.00100000        ; bit 8
13510 14570  i10 : 0                 ; saved link
13511 14572  e.
13512 14572  \f


13512 14572  
13512 14572  ; pej 27.09.77    disc driver, set result and status
13513 14572  
13513 14572  ; procedure set result and status(result,status).
13514 14572  ; --------------------------------------------------------------
13515 14572  ; result: 4 if bit 16 in compound status (software timeout)
13516 14572  ;           -  -   18 -  -        -      (bus reject, busy)
13517 14572  ;           -  -   20 -  -        -      (communication error)
13518 14572  ;           -  -   21 -  -        -      (interrupt error)
13519 14572  ;           -  -   22 -  -        -      (bustimeout)
13520 14572  ;           -  -   23 -  -        -      (bus parity error)
13521 14572  ;           if no bits are set in status.
13522 14572  ;         1 if bits are set in status.
13523 14572  ; status: bit 1 (parity)      if bit1,4 in compound (data,hard)
13524 14572  ;         bit 2 (sync.err)    -  -    5 -  -        (pos.error)
13525 14572  ;         bit 3 (data overr.) -  -    3 -  -        (data overr.)
13526 14572  ;         bit 5 (end med.)    -  -   11 -  -        (seek error)
13527 14572  ;
13528 14572  ; the procedure performs:
13529 14572  ; - calculates result and status from compound status.
13530 14572  ;
13531 14572  ; registers: call              exit
13532 14572  ; w0                           result
13533 14572  ; w1                           status
13534 14572  ; w2                           curr buf
13535 14572  ; w3         link              unchanged
13536 14572  ;
13537 14572  ; entry    : j10
13538 14572  ;
13539 14572  ; return   : link+0
13540 14572  b. i4 w.
13541 14572  j10 : am        (b19)   ; set result and status:
13542 14574        rl  w2     p34    ;
13543 14576        sz. w2    (i0.)   ;   if compound and result 4 mask
13544 14578        am         4-1    ;   then result:= 4
13545 14580        al  w0     1      ;   else result:= 1;
13546 14582        al  w1     0      ;   status:= 0;
13547 14584        sz. w2    (i1.)   ;   if compound and seek error mask
13548 14586        al  w1  x1+1<6    ;   then status:= status + end medium;
13549 14588        sz. w2    (i2.)   ;   if compound and data/hard error mask
13550 14590        al  w1  x1+1<10   ;   then status:= status + parity;
13551 14592        sz. w2    (i3.)   ;   if compound and data overrun mask
13552 14594        al  w1  x1+1<8    ;   then status:= status + data overrun;
13553 14596        sz. w2    (i4.)   ;   if compound and position error mask
13554 14598        al  w1  x1+1<9    ;   then status:= status + sync.error;
13555 14600        sn  w1     0      ;   if status = 0
13556 14602        al  w0     4      ;   then result:= 4;
13557 14604        ls  w1     12     ;
13558 14606        rl  w2     b18    ;   w2:= curr buf;
13559 14608        jl      x3+0      ;   return;
13560 14610  
13560 14610  ; variables
13561 14610  i0  : 8.00000257        ; result 4 mask, bit 16,18,20,21,22,23
13562 14612  
13562 14612  i1  : 8.00010000        ; seek error mask, bit 11
13563 14614  i2  : 8.22000000        ; data/hard err mask, bit 1,4
13564 14616  i3  : 8.04000000        ; data overrun mask, bit 3
13565 14618  i4  : 8.01000000        ; pos.error mask, bit 5
13566 14620  e.
13567 14620  \f


13567 14620  
13567 14620  ; pej 26.09.77    disc driver, update buf
13568 14620  
13568 14620  ; procedure update buf(segments,bytes)
13569 14620  ; ---------------------------------------------------------------
13570 14620  ; segments: no of segments transferred.
13571 14620  ; bytes   : no of bytes transferred per segment. must at calltime
13572 14620  ;           be stored in p35.curr receiver.
13573 14620  ;
13574 14620  ; the procedure performs:
13575 14620  ; - updates curr buf by segments:
13576 14620  ;   first segment and firstaddr are incremented.
13577 14620  ;   no of segments and remaining segments are decremented.
13578 14620  ; - updates table of error segments (successful transfer) if sta-
13579 14620  ;   tistics wanted and a segment in the table lies in the
13580 14620  ;   interval given by first segment.curr buf and segments.
13581 14620  ;
13582 14620  ; registers: call              exit
13583 14620  ; w0         segments          destroyed
13584 14620  ; w1         curr receiver     unchanged
13585 14620  ; w2         curr buf          unchanged
13586 14620  ; w3         link              destroyed
13587 14620  ;
13588 14620  ; entry    : j11
13589 14620  ;
13590 14620  ; return   : link+0
13591 14620  b. i4 w.
13592 14620  j11 : rs. w3     i0.    ; update buf: save link;
13593 14622        rl  w3  x2+m4     ;
13594 14624        wa  w3     0      ;   first segment.curr buf:=
13595 14626        rs  w3  x2+m4     ;   first segment.curr buf + segments;
13596 14628        c.         q1     ;   if statistics wanted then
13597 14628        rs. w0     i2.    ;   begin
13598 14630        am     (x2+m10)   ;
13599 14632        wa  w3     p3     ;     top:= first segment.curr buf
13600 14634        rs. w3     i1.    ;     + first segment.device.curr buf;
13601 14636        ws  w3     0      ;     first:= top - segments;
13602 14638        al  w2  x1+p46-6  ;     entry:= 1st error segment.curr rec;
13603 14640  i3  : al  w2  x2+6      ;     while segment no.entry >= 0 and
13604 14642        rl  w0  x2+0      ;           entry <> top entry do
13605 14644        sl  w0     0      ;     begin
13606 14646        sl  w2  x1+p46+q2*6;      if segmentno.entry >= first
13607 14648        jl.        i4.    ;       and segmentno.entry < top
13608 14650        sl  w0    (6)     ;       then goto found;
13609 14652        sl. w0    (i1.)   ;       entry:= entry + 1;
13610 14654        jl.        i3.    ;     end; goto not found;
13611 14656        am        (b18)   ; found:
13612 14658        ba  w2     m0     ;     i:= operation.curr buf;
13613 14660        bz  w3  x2-1      ;
13614 14662        al  w3  x3+1      ;     entry(i-1):= entry(i-1) + 1;
13615 14664        hs  w3  x2-1      ;
13616 14666  i4  : rl  w2     b18    ; not found:
13617 14668        rl. w0     i2.    ;
13618 14670        z.                ;   end;
13619 14670        bz  w3  x2+m5     ;
13620 14672        ws  w3     0      ;   no of segments.curr buf:=
13621 14674        hs  w3  x2+m5     ;   no of segments.curr buf - segments;
13622 14676        bz  w3  x2+m9     ;
13623 14678        ws  w3     0      ;   remaining segments.curr buf:=
13624 14680        hs  w3  x2+m9     ;   rem segments.curr buf - segments;
13625 14682        wm  w0  x1+p35    ;   b:= segments * bytes;
13626 14684        wa  w0  x2+m2     ;   first addr.curr buf:=
13627 14686        rs  w0  x2+m2     ;   first addr.curr buf + b;
13628 14688        jl.       (i0.)   ;   return;
13629 14690  
13629 14690  ; variables
13630 14690  i0  : 0                 ; saved link
13631 14692  i1  : 0                 ; saved top (segment)
13632 14694  i2  : 0                 ; saved param segments
13633 14696  e.
13634 14696  \f


13634 14696  
13634 14696  ; pej 28.09.77    disc driver, update buf on error
13635 14696  
13635 14696  ; procedure update buf on error(statusarea,bytes,chars)
13636 14696  ; ---------------------------------------------------------------
13637 14696  ; statusarea: addr of statusarea containing information about
13638 14696  ;             a read or write operation.
13639 14696  ; bytes     : see proc update buf.
13640 14696  ; chars     : no of chars transferred per segment. must at call-
13641 14696  ;             time be stored in p35+2.curr receiver.
13642 14696  ;
13643 14696  ; the procedure performs:
13644 14696  ; - updates curr buf by calling proc update buf with segments
13645 14696  ;   according to transferred segments using remaining bytes in
13646 14696  ;   statusarea or, if statusarea undefined, then remaining bytes
13647 14696  ;   in std statusarea provided it relates to a read or write
13648 14696  ;   operation.
13649 14696  ;   please note that, due to a controller error (never to be
13650 14696  ;   corrected), remaining bytecount must be transformed as
13651 14696  ;   follows:
13652 14696  ;     if rem mod chars_per_segm <> 0
13653 14696  ;     then rem:= rem - if data transfer then 65536 else 256
13654 14696  ; - leaves curr buf unchanged if neither statusarea nor std sta-
13655 14696  ;   tus area may be used.
13656 14696  ; please note that if the error was of such a kind that the
13657 14696  ; transfer specified in the channelprogram was completed
13658 14696  ; (statusinformation etc. ok), but the channel program was
13659 14696  ; not terminated normally (f.x. error during storing of std
13660 14696  ; status), then this procedure may increment firstaddr.curr buf
13661 14696  ; to a value equal to lastaddr.curr buf + 2.
13662 14696  ;
13663 14696  ; registers: call              exit
13664 14696  ; w0                           destroyed
13665 14696  ; w1         curr receiver     unchanged
13666 14696  ; w2         statusarea        destroyed
13667 14696  ; w3         link              destroyed
13668 14696  ;
13669 14696  ; entry    : j12
13670 14696  ;
13671 14696  ; return   : link+0
13672 14696  b. i5 w.
13673 14696  j12 : rs. w3     i0.    ; update buf on error: save link;
13674 14698        rl  w0  x2+2      ;   rem:= rem bytecount.statusarea;
13675 14700        rl  w3  x2+0      ;
13676 14702        se  w3     0      ;   if chan pg count.status area = 0 then
13677 14704        jl.        i1.    ;   begin c. statusarea undefined;
13678 14706        rl  w3  x1+a230   ;
13679 14708        se  w3     0      ;     if chan pg count.stdstatus.curr rec
13680 14710        bz  w3  x3-6+1    ;        <> 0
13681 14712        ls  w3    -8      ;
13682 14714        se  w3     1      ;     (and last command executed = read
13683 14716        sn  w3     3      ;      or last command executed = write)
13684 14718        jl.        i2.    ;     then rem:= rembytes.stdstatus.curr
13685 14720        jl.       (i0.)   ;     else return;
13686 14722  i2  : rl  w0  x1+a231   ;
13687 14724  i1  : rs. w0     i3.    ;   end;
13688 14726        al  w3     0      ;   saved rem:= rem;
13689 14728        wd  w0  x1+p35+2  ;   rem:= rem // chars;
13690 14730        sn  w3     0      ;   if saved rem mod chars <> 0 then
13691 14732        jl.        i5.    ;   begin
13692 14734        rl. w0     i3.    ;
13693 14736        rl  w2  x1+p35+2  ;
13694 14738        se  w2     q53    ;     rem:= saved rem -
13695 14740        am         2      ;     if chars = chars per data segm
13696 14742        ws. w0     i4.    ;     then 65536 else 256;
13697 14744        sh  w0    -1      ;     if rem < 0
13698 14746        jl.       (i0.)   ;     then return; c. should be impossib;
13699 14748        al  w3     0      ;     rem:= rem // chars;
13700 14750        wd  w0     4      ;   end;
13701 14752  i5  : ac  w0    (0)     ;
13702 14754        rl  w2     b18    ;   segments:=
13703 14756        ba  w0  x2+m5     ;   no of segments.curr buf - rem;
13704 14758        rl. w3     i0.    ;   update buf(segments,bytes);
13705 14760        jl.        j11.   ;   c.return from there;
13706 14762  
13706 14762  ;variables
13707 14762  i0  : 0                 ; saved link
13708 14764  i3  : 0                 ; for saving rem
13709 14766  i4  : 65536             ; constant for correcting rem, +0: data
13710 14768        256               ;                              +2: addr m
13711 14770  e.
13712 14770  \f


13712 14770  
13712 14770  ; pej 28.09.77    disc driver, update retryinformation
13713 14770  
13713 14770  ; procedure update retryinformation(retryinformation)
13714 14770  ; ---------------------------------------------------------------
13715 14770  ; retryinformation: addr of the byte containing retryinformation.
13716 14770  ;                   bit 0- 3: modeindex
13717 14770  ;                   bit 4- 8: offsetindex
13718 14770  ;                   bit 9-11: tries
13719 14770  ;
13720 14770  ; the procedure performs:
13721 14770  ; - increments tries.
13722 14770  ; - increments modeindex if tries flows over and sets tries to 1.
13723 14770  ; - increments offsetindex if modeindex flows over and sets mode-
13724 14770  ;   index to first value and tries to 1. not performed if
13725 14770  ;   variable offset impossible.
13726 14770  ;
13727 14770  ; registers: call              exit
13728 14770  ; w0                           destroyed
13729 14770  ; w1         retryinformation  destroyed
13730 14770  ; w2                           destroyed
13731 14770  ; w3         link              unchanged
13732 14770  ;
13733 14770  ; entry    : j13
13734 14770  ;
13735 14770  ; return   : link+0: no more tries possible
13736 14770  ;            link+2: next stobe-offset combination
13737 14770  ;            link+4: next offset magnitude
13738 14770  ;            link+6: tries <= 3 (mode/offset index unchanged)
13739 14770  b. i4 w.
13740 14770  j13 : rs. w1     i4.    ; update retryinformation:
13741 14772        bz  w1  x1+0      ;   r:= core(retryinformation)
13742 14774        al  w1  x1+1      ;   tries.r:= tries.r + 1;
13743 14776        hs. w1    (i4.)   ;   core(retryinformation):= r;
13744 14778        so  w1     2.100  ;   if tries.r <= 3
13745 14780        jl      x3+6      ;   then return; c. link+6;
13746 14782        la. w1     i0.    ;   tries.r:= 1;
13747 14784        al  w1  x1+i1     ;   modeindex.r:= modeindex.r + 1;
13748 14786        hs. w1    (i4.)   ;   core(retryinformation):= r;
13749 14788        al  w2  x1+0      ;
13750 14790        ls  w2    -8      ;
13751 14792        bl. w0  x2+q20.-1 ;
13752 14794        se  w0    -1      ;   if modetable(modeindex.r) <> -1
13753 14796        jl      x3+2      ;   then return; c. link+2;
13754 14798        la. w1     i2.    ;
13755 14800        ls  w1    -3      ;
13756 14802        al  w1  x1+1      ;   i:= offsetindex + 1;
13757 14804        bl. w0  x1+q21.   ;
13758 14806        am        (b19)   ;
13759 14808        rl  w2     p5     ;
13760 14810        se  w2     0      ;   if disctype.curr receiver = 0
13761 14812        sn  w0    -1      ;   or offset table(i) = -1
13762 14814        jl      x3+0      ;   then return; c. link+0;
13763 14816        ls  w1     3      ;   r:= modeindex for next round << 8
13764 14818        al  w1  x1+i3     ;       + i << 3 + 1;
13765 14820        hs. w1    (i4.)   ;   core(retryinformation):= r;
13766 14822        jl      x3+4      ;   return; c. link + 4;
13767 14824  
13767 14824  ; variables
13768 14824  i0  : 2.111111111000    ; mask for zeroizing tries
13769 14826  i1  = 2.000100000001    ; mask for incrementing modeindex, tries
13770 14826  i2  : 2.000011111000    ; mask for zeroizing modeindex, tries
13771 14828  i3  = q23<8+1           ; modeindex for next round << 8 + tries
13772 14828  i4  : 0                 ; saved param retryinformation
13773 14830  e.
13774 14830  \f


13774 14830  
13774 14830  ; pej 30.09.77    disc driver, clean
13775 14830  
13775 14830  ; procedure clean(result)
13776 14830  ; ---------------------------------------------------------------
13777 14830  ; result: result to be used as parameter to deliver result.
13778 14830  ;
13779 14830  ; the procedure performs:
13780 14830  ; - returns all messages queued to the driver with above
13781 14830  ;   mentioned result.
13782 14830  ; - zeroizes regretted.curr receiver.
13783 14830  ; - sets transfer state.curr receiver idle.
13784 14830  ; - if result = 5 (unknown) then state.curr receiver is set to
13785 14830  ;   after intervention, the name of curr receiver is zeroized
13786 14830  ;   and so is device address in all areaprocesses referring
13787 14830  ;   to curr receiver. the same is performed on eventual logical
13788 14830  ;   disc drivers referring to current receiver.
13789 14830  ;
13790 14830  ; registers: call               exit
13791 14830  ; w0         result             destroyed
13792 14830  ; w1                            curr receiver
13793 14830  ; w2                            destroyed
13794 14830  ; w3         link               destroyed
13795 14830  ;
13796 14830  ; entry    : j14
13797 14830  ;
13798 14830  ; return   : link+0
13799 14830  b. i7 w.
13800 14830  j14 : ds. w0     i1.    ; clean: save link, result;
13801 14832        rl  w1     b19    ;
13802 14834        rl  w2     g49    ;
13803 14836        rs  w2  x1+p13    ;   transfer state.curr rec:= idle;
13804 14838        al  w2     0      ;
13805 14840        rs  w2  x1+a56    ;   regretted.curr rec:= 0;
13806 14842        rs  w2     g20    ;   status.i/o answer:= 0;
13807 14844        rs  w2     g21    ;   bytes.i/o answer:= 0;
13808 14846        rs  w2     g22    ;   chars.i/o answer:= 0;
13809 14848  i2  : rl  w2  x1+a54    ;   while next message.curr rec <>
13810 14850        sn  w2  x1+a54    ;         addr of next message.curr rec do
13811 14852        jl.        i3.    ;   begin
13812 14854        rs  w2     b18    ;     curr buf:= next message.curr rec;
13813 14856        jl  w3     g19    ;     deliver result(result);
13814 14858        rl. w0     i1.    ;
13815 14860        jl.        i2.    ;   end;
13816 14862  i3  : se  w0     5      ;   if result <> 5
13817 14864        jl.       (i0.)   ;   then return;
13818 14866        al  w0     0      ;
13819 14868        rs  w0  x1+p12    ;   state.curr rec:= after intervention;
13820 14870        rl  w1     b4     ;   proci:= addr of 1st device.nametable;
13821 14872  i4  : rs. w1     i1.    ;   repeat
13822 14874        rl  w1  x1+0      ;     proc:= nametable(proci);
13823 14876        rl  w3  x1+a10    ;
13824 14878        rl  w0  x1+p2     ;
13825 14880        sn  w0    (b19)   ;     if (mainproc.proc = curr receiver
13826 14882        se  w3     q61    ;          and kind.proc = disc)
13827 14884        sn  w1    (b19)   ;      or proc = curr receiver then
13828 14886        jl.        i5.    ;      begin
13829 14888        jl.        i7.    ;
13830 14890  i5  : al  w0     0      ;
13831 14892        rs  w0  x1+a11    ;        name(0).proc:= 0;
13832 14894        rs  w0  x1+a52    ;        reserver.proc:= 0;
13833 14896        rl  w3     b5     ;        areai:= first areaproc.nametable;
13834 14898  i6  : rl  w2  x3+0      ;        repeat area:= nametable(areai);
13835 14900        sn  w1 (x2+a50)   ;          if device addr.area:= proc
13836 14902        rs  w0  x2+a50    ;          then device addr.area:= 0;
13837 14904        al  w3  x3+2      ;          areai:= areai + 2
13838 14906        se  w3    (b6)    ;
13839 14908        jl.        i6.    ;        until areai = first internal;
13840 14910  i7  : am.       (i1.)   ;      end;
13841 14912        al  w1     2      ;      proci:= proci + 2
13842 14914        se  w1    (b5)    ;
13843 14916        jl.        i4.    ;   until proci = first area proc;
13844 14918        rl  w1     b19    ;
13845 14920        jl.       (i0.)   ;
13846 14922  
13846 14922  ; variables
13847 14922  i0  : 0                 ; saved link
13848 14924  i1  : 0                 ; saved result, proci in loop
13849 14926  e.
13850 14926  \f


13850 14926  
13850 14926  ; pej 04.10.77    disc driver, procedure correct data
13851 14926  
13851 14926  ; procedure correct data
13852 14926  ; ---------------------------------------------------------------
13853 14926  ;
13854 14926  ; the procedure performs:
13855 14926  ; - checks if the error correction information stored in status-
13856 14926  ;   area1 of curr receiver may be used for correcting the data 
13857 14926  ;   segment pointed to by first addr.curr buf.
13858 14926  ; - performs the correction by copying the bad word(s)
13859 14926  ;   from the buffer and back again after having corrected them.
13860 14926  ;   the copying is performed by calling a monitor procedure.
13861 14926  ;   two words are copied unless the errorburst starts in the
13862 14926  ;   base word or last word of the segment.
13863 14926  ;
13864 14926  ; registers: call              exit
13865 14926  ; w0                           destroyed
13866 14926  ; w1         curr receiver     destroyed
13867 14926  ; w2                           curr buf if corrected
13868 14926  ; w3         link              destroyed
13869 14926  ;
13870 14926  ; entry    : j15
13871 14926  ;
13872 14926  ; return   : link+0: data not corrected
13873 14926  ;            link+2: data corrected
13874 14926  b. i25 w.
13875 14926  j15 : rs. w3     i0.    ; correct data: save link;
13876 14928        al  w2  x1+p16+16 ;   addr:=
13877 14930        ld  w1    -100    ;   addr of ecc inf.statusarea1.curr rec;
13878 14932        ds. w1     i2.    ;   sum:= 0;
13879 14934        jl. w3     i16.   ;   sum:= sum
13880 14936        21                ;         + (21 - char0.addr)
13881 14938        452387            ;         * 452387;
13882 14940        jl. w3     i16.   ;   sum:= sum
13883 14942        88                ;         + (88 - char1.addr)
13884 14944        72358             ;         * 72358;
13885 14946        jl. w3     i16.   ;   sum:= sum
13886 14948        12                ;         + (12 - char2.addr)
13887 14950        315238            ;         * 315238;
13888 14952        al  w2  x2+2      ;   c. now eccinf(0) = 0; addr:= addr + 2;
13889 14954        jl. w3     i16.   ;   sum:= sum
13890 14956        22                ;         + (22 - char0.addr)
13891 14958        330902            ;         * 330902;
13892 14960        wd. w1     i3.    ;   c. now eccinf(2) = err pattern << 8;
13893 14962        al  w1  x1+1      ;   bitdisp:=
13894 14964        wm. w1     i3.    ;   (sum // 585442 + 1) * 585442
13895 14966        ws. w1     i2.    ;   - sum - 56 + 16;
13896 14968        al  w0  x1-56+16  ;   c. is now base for error pattern;
13897 14970        sl. w0    (i5.)   ;   if bitdisp outside segment
13898 14972        jl.       (i0.)   ;   then not corrected return; c. link+0;
13899 14974        sh  w0     0      ;   if bitdisp <= 0
13900 14976        jl.        i15.   ;   then goto corrected;
13901 14978        rl  w2     0      ;   c. error entirely in checkcharacters;
13902 14980        al  w2  x2+11     ;
13903 14982        al  w1     0      ;   bytedisp:=
13904 14984        wd. w2     i6.    ;   (bitdisp + 11) / 12; c. w2;
13905 14986        al  w3     0      ;
13906 14988        wd. w0     i8.    ;
13907 14990        al  w3  x3-24     ;   sh:= -24 + (bitdisp mod 24);
13908 14992        sn  w3    -24     ;   if sh = - 24
13909 14994        al  w3     0      ;   then sh:= 0;
13910 14996        rs. w3     i9.    ;   save sh;
13911 14998        al  w0     q52    ;
13912 15000        ws  w0     4      ;   relative:=
13913 15002        la  w0     g50    ;   even (segment size - bytedisp); c.w0;
13914 15004        al. w1     i10.   ;   c. relative to firstaddr.curr buf;
13915 15006        al. w3     i11.   ;   first:= first bad; last:= second bad;
13916 15008        se  w0    -2      ;   if relative = -2 then
13917 15010        jl.        i17.   ;   begin c. only one word;
13918 15012        al  w0     0      ;     relative:= 0; first:= last;
13919 15014        al  w1  x3+0      ;   end;
13920 15016  i17 : sn  w0     q52-2  ;   if relative = segmentsize - 2
13921 15018        al  w3  x1+0      ;   then last:= first; c. only 1 word;
13922 15020        rl  w2     b18    ;   buf:= curr buf;
13923 15022        rs. w1     i21.   ;   save first
13924 15024        rl. w1     i25.   ;   store mode.call
13925 15026        rs. w1     i20.   ;
13926 15028  
13926 15028        ds. w0     i23.   ;   save relative,last
13927 15030        al. w1     i20.   ;   w1:= parameter address
13928 15032        jd         1<11+84;   general copy(params,buf)
13929 15034        se  w0     0      ;   if result <> 0
13930 15036        jl.       (i0.)   ;   then not corrected return; c. link+0;
13931 15038        am        (b19)   ;   c. align the err pattern to error;
13932 15040        rl  w3     p16+18 ;   w3:= eccinf(2).statusarea1.curr rec;
13933 15042        al  w0     0      ;   w0:= 0;
13934 15044        ld. w0    (i9.)   ;   w3w0:= w3w0 shift sh;
13935 15046        lx. w3     i10.   ;   first bad:= first bad xor w3;
13936 15048        lx. w0     i11.   ;   second bad:= second bad xor w0;
13937 15050        ds. w0     i11.   ;
13938 15052        rl. w1     i24.   ;   change function in parameter list(from=curr,to=buf)
13939 15054        rs. w1     i20.   ;
13940 15056        al. w1     i20.   ;   w1:= parameter address
13941 15058        jd         1<11+84;   general copy(params,buf)
13942 15060        se  w0     0      ;   if result <> 0
13943 15062        jl.       (i0.)   ;   then not corrected return; c. link+0;
13944 15064  i15 : am.       (i0.)   ; corrected:
13945 15066        jl         2      ;   return; c. link + 2;
13946 15068  
13946 15068  ; routine for updating sum. the routine performs:
13947 15068  ;   sum:= sum + (k - (core(addr) shift (-16)) * m
13948 15068  ;   core(addr):= core(addr) shift 8
13949 15068  ; registers: call w2=addr, w3=link
13950 15068  ;            exit w0w1=sum (also stored in i1i2), w2,w3=unch
13951 15068  ; call     : jl. w3  i16.
13952 15068  ;            k             link+0
13953 15068  ;            m             link+2
13954 15068  ;            returnpoint   link+4
13955 15068  i16 : rl  w1  x2+0      ; update sum:
13956 15070        al  w0     0      ;   w1:= core(addr); w0:= 0;
13957 15072        ld  w1     8      ;   w0w1:= w0w1 shift 8;
13958 15074        rs  w1  x2+0      ;   core(addr):= w1;
13959 15076        sz  w0     8.200  ;   if char in w0 negative
13960 15078        jl.       (i0.)   ;   then not corrected return;
13961 15080        rl  w1  x3+0      ;
13962 15082        ws  w1     0      ;   w1:= k - w0;
13963 15084        wm  w1  x3+2      ;   w0w1:= w1 * m;
13964 15086        aa. w1     i2.    ;   w0w1:= sum:= sum + w0w1;
13965 15088        ds. w1     i2.    ;
13966 15090        jl      x3+4      ;   return;
13967 15092  
13967 15092  ; variables
13968 15092  i0  : 0                 ; saved link
13969 15094  i1  : 0                 ; double word for sum
13970 15096  i2  : 0                 ; -      -
13971 15098  i3  : 585442            ; constant used in calculations
13972 15100  i6  : 12                ; -        -    -  -
13973 15102  i8  : 24                ; -        -    -  -
13974 15104  i5  : q53*8+16          ; largest bitdisplacement + 1 + 16
13975 15106  i9  : 0                 ; saved sh (shifts to align err pattern)
13976 15108  i10 : 0                 ; to receive first bad word
13977 15110  i11 : 0                 ; -  -       2nd   -   -
13978 15112    
13978 15112  ; parameters for general copy:
13979 15112  i20 : 2<1+0             ; function(pair<1+mode),init: from=buf,to=curr
13980 15114  i21 : 0                 ; first
13981 15116  i22 : 0                 ; last
13982 15118  i23 : 0                 ; relative
13983 15120    
13983 15120  i24 : 2<1+1             ; function(from=curr,to=buf)
13984 15122  i25 : 2<1+0             ; function(from=buf,to=curr)
13985 15124  e.
13986 15124  \f


13986 15124  
13986 15124  ; pej 17.11.77    disc driver, update on corrected error
13987 15124  
13987 15124  ; procedure update on corrected error
13988 15124  ; ---------------------------------------------------------------
13989 15124  ;
13990 15124  ; the procedure performs:
13991 15124  ; - updates statistics concerning an error which has been
13992 15124  ;   corrected either by incrementing the counter for errors
13993 15124  ;   corrected within 3 retries (setmode param.curr receiver = 0)
13994 15124  ;   or by incrementing a counter in the tables for errors
13995 15124  ;   corrected by strobe-offset.
13996 15124  ;
13997 15124  ; registers: call              exit
13998 15124  ; w0                           destroyed
13999 15124  ; w1         curr receiver     unchanged
14000 15124  ; w2                           unchanged
14001 15124  ; w3         link              destroyed
14002 15124  ;
14003 15124  ; entry    : j16  -  used at transput
14004 15124  ;            j17  -  used at control
14005 15124  ; return   : link + 0
14006 15124  c. q1
14007 15124  b. i3 w.
14008 15124  j16 : rl  w0  x1+p21    ; update on corrected transput error:
14009 15126        se  w0     0      ;   if setmode param.curr rec = 0 then
14010 15128        jl.        i1.    ;   begin
14011 15130  j17 : am     (x1+p43)   ; update on corrected control error:
14012 15132        al  w0     1      ;     corrected in 3 tries.curr rec:=
14013 15134        rs  w0  x1+p43    ;     corrected in 3 tries.curr rec + 1;
14014 15136        jl      x3+0      ;   end else
14015 15138  i1  : rs. w3     i0.    ;   begin c. strobe-offset used;
14016 15140        ls  w0    -4      ;     i:= setmode param(16:19).curr rec;
14017 15142        am        (0)     ;     c. strobe and offset;
14018 15144        bz  w3  x1+p44-1  ;
14019 15146        al  w3  x3+1      ;     strobe offset table(i-1).curr rec:=
14020 15148        am        (0)     ;     strobe offset table(i-1).curr rec+1;
14021 15150        hs  w3  x1+p44-1  ;     c. i-1 as value 1 is counted in
14022 15152        rl  w0  x1+p21    ;        byte o;
14023 15154        sz  w0     2.11<4 ;     if setmode param(18:19).curr rec =0
14024 15156        jl.        i2.    ;     then
14025 15158        jl.       (i0.)   ;     begin
14026 15160  i2  : la. w0     i3.    ;     i:= setmode param(20:23).curr rec;
14027 15162        am        (0)     ;     c. offset magnitude;
14028 15164        bz  w3  x1+p45    ;
14029 15166        al  w3  x3+1      ;     offset magn. table(i).curr rec:=
14030 15168        am        (0)     ;     offset magn. table(i).curr rec + 1;
14031 15170                          ;     end;
14032 15170        hs  w3  x1+p45    ;   end;
14033 15172        jl.       (i0.)   ;   return;
14034 15174  
14034 15174  ; variables
14035 15174  i0  : 0                 ; saved link
14036 15176  i3  : 2.1111            ; for masking out offset magnitude
14037 15178  e.
14038 15178  z.
14039 15178  
14039 15178  \f


14039 15178  
14039 15178  ; pej 04.10.77    disc driver, end of code
14040 15178  
14040 15178  z.e.                    ; end disc driver block
14041 15178  
14041 15178  e.                      ; end area process-disc driver block
14042 15178  
14042 15178  b. p22, m50, n114 w.  ; block including ioc and dlc main process.
14043 15178  
14043 15178  ; -------------------------------------------------------------------------
14044 15178  ; 
14045 15178  ;              I O C   M A I N   P R O C E S S   D R I V E R
14046 15178  ;
14047 15178  ;              D L C   M A I N   P R O C E S S   D R I V E R
14048 15178  ;
14049 15178  ; -------------------------------------------------------------------------
14050 15178  ;
14051 15178  ;
14052 15178  ; the main processes supports the following operations:
14053 15178  ;
14054 15178  ;     IOC                            DLC
14055 15178  ;   --------------------------     -----------------------------
14056 15178  ;
14057 15178  ;   - dump (*)
14058 15178  ;   - prepare dump (*)
14059 15178  ;   - create link (*)              - create link (*)
14060 15178  ;   - extract statistics           - extract statistics
14061 15178  ;   - remove link (*)              - remove link (*)
14062 15178  ;   - set mask                     - set mask    
14063 15178  ;   - link logical disc
14064 15178  ;   - unlink logical disc
14065 15178  ;   - test (*)
14066 15178  ;   - initialize controller (*)    - initialize controller (*)
14067 15178  ;
14068 15178  ;     RC8000-IDA/IFP
14069 15178  ;   -------------------------- 
14070 15178  ;
14071 15178  ;   - input
14072 15178  ;   - output
14073 15178  ;   - position
14074 15178  ;
14075 15178  ;                                    driverproc messages
14076 15178  ;                                  -----------------------------
14077 15178  ;                                  - answer create link
14078 15178  ;                                  - answer remove link request
14079 15178  ;                                  - answer attention          
14080 15178  ;                                  - stop normal communication (only rc8000)
14081 15178  ;
14082 15178  ; (*)  the (possible re-formattet) message is transmitted to the controller
14083 15178  ;
14084 15178  ;
14085 15178  ; execution of messages:
14086 15178  ; ----------------------
14087 15178  ;
14088 15178  ; when a message is received by the mainprocess, it is claimed
14089 15178  ; (receiver is negated).
14090 15178  ; only one message is executed by (the 1st part of) the driver at a
14091 15178  ; time. when the message is executed in this part of the driver it is
14092 15178  ; in no queue. if the message isn't going to be transmitted to the
14093 15178  ; controller (those operation which are not marked '(*)' above) the
14094 15178  ; answer to the message is returned before the next message is received
14095 15178  ; (i.e. the message will never be in the event queue of the main
14096 15178  ; process).
14097 15178  ; if the message is going to be transfered to the controller (all 
14098 15178  ; operations marked '(*)') the message will be delivered to the 2ed
14099 15178  ; part of the main driver, where it will be linked either to the
14100 15178  ; waiting queue of the main process or to the event queue of the
14101 15178  ; receiver. at this time the 1st part of the driver will never see
14102 15178  ; the message/answer again (except for the create/remove link
14103 15178  ; operations where it receives an interrupt-operation).
14104 15178  ; the 1st part of the driver need not to worry about regret of messages
14105 15178  ; as it will never receive a regretted message. the second part (setup
14106 15178  ; part) of the driver will take a proper action on a regretted message
14107 15178  ; if it is regretted while it is under execution (either in the rc8000
14108 15178  ; or in the controller).
14109 15178  ;
14110 15178  \f


14110 15178  
14110 15178  ; use of names:
14111 15178  ; -------------
14112 15178  ;        m  main routines (one for each operation)
14113 15178  ;
14114 15178  ;        n  sub-routines
14115 15178  ;
14116 15178  ;        p  names of operations
14117 15178  ;
14118 15178  ;
14119 15178  
14119 15178  ; definition of operations
14120 15178  ;
14121 15178   p2 =  2     ; prepare dump
14122 15178   p6 =  6     ; create link
14123 15178   p9 =  9     ; extract statistics
14124 15178  p10 = 10     ; remove link
14125 15178  p12 = 12     ; set mask
14126 15178  p14 = 14     ; dump
14127 15178  p16 = 16     ; link logical disc
14128 15178  p18 = 18     ; unlink logical disc
14129 15178  p20 = 20     ; test
14130 15178  p22 = 22     ; initialize controller
14131 15178   p3 =  3     ; ida/ifp input
14132 15178   p5 =  5     ; ida/ifp output
14133 15178   p8 =  8     ; ida/ifp position
14134 15178  
14134 15178  
14134 15178  ; ***** stepping stones *****
14135 15178  
14135 15178  jl.  (+2),  d150 ,  d150 = k - 4
14136 15182  jl.  (+2),  d151 ,  d151 = k - 4
14137 15186  jl.  (+2),  d156 ,  d156 = k - 4
14138 15190  
14138 15190  \f


14138 15190  
14138 15190  
14138 15190  ; 
14139 15190  ; M E S S A G E   R E C E I V E D   B Y   M A I N P R O C E S S .
14140 15190  ; ---------------------------------------------------------------
14141 15190  ;
14142 15190  ; Control is transfered to this part when driverproc receives a 
14143 15190  ; message sent to an IOC or DLC main process.
14144 15190  ; 
14145 15190  ; From driverproc the following messages can be received:
14146 15190  ;      stop normal communication    - 4
14147 15190  ;      answer attention             - 3
14148 15190  ;      answer remove link request   - 2
14149 15190  ;      answer create link           - 1
14150 15190  ;      remove link                   10
14151 15190  ;
14152 15190  ; At entry the registers contains:
14153 15190  ;
14154 15190  ;  w0  -
14155 15190  ;  w1  sender
14156 15190  ;  w2  message
14157 15190  ;  w3  main process
14158 15190  ;
14159 15190  
14159 15190  b. i10, j10  w.
14160 15190  
14160 15190  h20:                   ; message received
14161 15190  h26:                   ;
14162 15190       rs. w1     i1.    ; begin
14163 15192       rl  w3     b21    ;
14164 15194       zl  w0  x3+a19    ;   <* claim the buffer - driverproc will have claims
14165 15196       bs. w0     1      ;      enough as it received the message in wait event
14166 15198       hs  w0  x3+a19    ;      and unclaimed it 'by hand' when it received it *>
14167 15200       ac  w3 (x2+a141)  ;
14168 15202       rs  w3  x2+a141   ;
14169 15204                         ;
14170 15204       sn  w1    (b21)   ;   if message.sender = driverproc then    
14171 15206       jl.        j3.    ;      goto branch;    <* skip all checks *>
14172 15208                         ;
14173 15208       rl  w1     b19    ;   <* select the proper operation/mode mask 
14174 15210       al  w0     2.0111 ;      depending on main state and main kind *>
14175 15212       la  w0  x1+a78    ;
14176 15214       al  w3     8      ;   if main.connect_state = connected then
14177 15216       sn  w0     l38    ;        index := connect_mask
14178 15218       al  w3     0      ;   else index := free_mask;
14179 15220       rl  w0  x1+a10    ;
14180 15222       se  w0     q20    ;   if main.kind = ifp_main then
14181 15224       al  w3  x3+4      ;        index := index or ifp_mask
14182 15226       al. w3  x3+i2.    ;   else index := index or ida_mask;
14183 15228       dl  w1  x3+0      ;
14184 15230       jl  w3     g16    ;   check operation(operation mask, mode mask, message);
14185 15232                         ;
14186 15232       rl. w1     i1.    ;
14187 15234       zl  w3  x2+a150   ;   if message.operation needs reservation then
14188 15236       rl. w0     i3.    ;
14189 15238       ls  w0  x3        ;      check reserver(sender, message)
14190 15240       sh  w0    -1      ;   else
14191 15242       am         g15-g14;      check user(sender, message);
14192 15244       jl  w3     g14    ;
14193 15246                         ;
14194 15246       zl  w0  x2+a138+1 ;
14195 15248       so  w0     2.1    ;   if message.state.io then
14196 15250       jl.        j3.    ;   begin
14197 15252       jl  w3     g34    ;     if message.regretted or
14198 15254       sz                ;        message.sender.state = stopped then
14199 15256       jl.        j2.    ;     begin
14200 15258       rl  w3     b20    ;       no operation;
14201 15260       jl         g26    ;       goto driverproc.wait event;
14202 15262                         ;     end;
14203 15262                         ;
14204 15262  j2:  jl  w3     g31    ;     increase stopcount(message.sender);
14205 15264       sn  w0     p9     ;     if message.operation <> extract statistics then
14206 15266       jl.        j3.    ;     begin
14207 15268                         ;
14208 15268       rl  w3  x2+a152   ;       message.no of bytes := 
14209 15270       al  w0  x3+2      ;       (last address - first address + 2)/2 * 3;
14210 15272       ws  w0  x2+a151   ;
14211 15274       ls  w0    -1      ;
14212 15276       wm  w0     g48    ;
14213 15278       rs  w0  x2+a152   ;
14214 15280                         ;
14215 15280       rl  w0  x2+a151   ;       message.first address := 
14216 15282       wa  w0  x1+a182   ;       message.first address + sender.base;
14217 15284       rs  w0  x2+a151   ;       <* physical address *>
14218 15286                         ;     end;
14219 15286                         ;   end;
14220 15286                         ;
14221 15286  j3:  el  w3  x2+a150+0 ; branch:
14222 15288       ls  w3    +1      ;
14223 15290       jl.    (x3+i5.)   ;   goto case message.operation of
14224 15292                         ;
14225 15292                m34      ; -4 : stop normal communication
14226 15294                m33      ; -3 : answer attention
14227 15296                m32      ; -2 : answer remove link request
14228 15298                m31      ; -1 : answer create link
14229 15300  i5:            m0      ;  0 : sense
14230 15302                 -1      ;  1 : -
14231 15304                 m1      ;  2 : prepare dump / set tiomout (ida/ifp)
14232 15306                 m3      ;  3 : ida/ifp input
14233 15308                 m4      ;  4 : ida/ifp reset
14234 15310                 m5      ;  5 : ida/ifp output
14235 15312                 m6      ;  6 : create link
14236 15314                 -1      ;  7 : -
14237 15316                 m8      ;  8 : ida/ifp position
14238 15318                 m9      ;  9 : extract statistics
14239 15320                m10      ; 10 : remove link
14240 15322                 -1      ; 11 : -
14241 15324                m12      ; 12 : set mask
14242 15326                 -1      ; 13 : -
14243 15328                m14      ; 14 : dump
14244 15330                 -1      ; 15 : -
14245 15332                m16      ; 16 : link logical disc
14246 15334                 -1      ; 17 : -
14247 15336                m18      ; 18 : unlink logical disc
14248 15338                 -1      ; 19 : -
14249 15340                m20      ; 20 : test
14250 15342                 -1      ; 21 : -
14251 15344                m22      ; 22 : initialize controller
14252 15346  
14252 15346  
14252 15346  i1: 0                  ; saved w1 (sender)
14253 15348                         ;
14254 15348      ; format of the operation/mode mask table:
14255 15348      ;   -2 : ida/ioc, connected, operations
14256 15348      ;i2: 0 : ida/ioc, connected, modes
14257 15348      ;    2 : ifp/dlc, connected, operations
14258 15348      ;    4 : ifp/dlc, connected, modes
14259 15348      ;    6 : ida/ioc, not connected, operations
14260 15348      ;    8 : ida/ioc, not connected, modes
14261 15348      ;   10 : ifp/dlc, not connected, operations
14262 15348      ;   12 : ifp/dlc, not connected, modes
14263 15348  
14263 15348      a0>3+a0>4+a0>5+a0>6+a0>8+a0>9+a0>10+a0>12+a0>16+a0>18+a0>22
14264 15350  i2: a0>0 + a0>1 + a0>2 + a0>3 + a0>4 + a0>5
14265 15352      a0>0+a0>2+a0>3+a0>4+a0>5 + a0>6 +a0>8 + a0>9 + a0>10 + a0>12 + a0>22
14266 15354      a0>0 + a0>1 + a0>2 + a0>3 + a0>4 + a0>5 + a0>6
14267 15356      a0>4+a0>5+a0>9+a0>12+a0>22
14268 15358      a0>0+a0>1+a0>2
14269 15360      a0>2+a0>3+a0>4+a0>5+a0>9+a0>12+a0>22
14270 15362      a0>0+a0>1+a0>2+a0>3+a0>4+a0>5+a0>6
14271 15364      
14271 15364                         ; the following operations needs reservation:
14272 15364  i3: a0>4
14273 15366  
14273 15366  e.                     ; end   *** message received ***;
14274 15366  \f


14274 15366  ;    sense
14275 15366  ;----------------------------------------------------------------------------
14276 15366  ;        message (sender format)           message (when delivered to part 2)
14277 15366  ;        ---------------------------       ----------------------------------
14278 15366  ;
14279 15366  ;  + 0:  0 < 12 + 0                        0 < 12 + 0
14280 15366  ;  + 6:                                    timeout value (0.1 msec)
14281 15366  ;
14282 15366  ;
14283 15366  ; at entry:
14284 15366  ;
14285 15366  ;  w0   -
14286 15366  ;  w1   sender
14287 15366  ;  w2   message
14288 15366  ;  w3   -
14289 15366  ;
14290 15366  
14290 15366  m0:                    ; sense:
14291 15366       rl  w1     b19    ;
14292 15368       rl  w3  x1+a87    ;
14293 15370       rs  w3  x2+a153   ;   mess_3:=timeout value;
14294 15372       al  w0     0      ;   force := no;
14295 15374       jl.       (n100.) ;   start_controller(force);
14296 15376  \f


14296 15376  ;    set timeout (ifp)
14297 15376  ;----------------------------------------------------------------------------
14298 15376  ;
14299 15376  ; The timevalue is set in the mainprocess. If the value exceeds 800 sec.
14300 15376  ; timeout will be set to 800 sec.
14301 15376  ; If timeout is set to 0, the timeout supervision is disabled.
14302 15376  ; NOTE: the procedure is called from m2.
14303 15376  ; The operation does not involve the ifp.
14304 15376  ;
14305 15376  ;    message (sender format)
14306 15376  ; +0 2<12 +0
14307 15376  ; +2 timeout value (in sec.)
14308 15376  ;
14309 15376  ;
14310 15376  ; at entry:
14311 15376  ; w0     -                                                              
14312 15376  ; w1     sender
14313 15376  ; w2     message
14314 15376  ; w3     -
14315 15376  
14315 15376  b. i1 w.
14316 15376  m1:  rl  w0  x2+a151     ; if mess.timeout < 0 then deliver result(3)
14317 15378       sh  w0     -1       ;
14318 15380       jl         g5       ;                                              ;
14319 15382       sl  w0     800      ; if mess.timeout > 800 sec then
14320 15384       al  w0     800      ;   main.timeout := 800 sec
14321 15386       wm. w0     i1.      ;
14322 15388       rl  w1     b19      ;
14323 15390       rs  w0  x1+a87      ; else main.timeout := mess.timeout
14324 15392       al  w0     0        ;
14325 15394       rs  w0     g20      ; deliver result(1)
14326 15396       jl         g7       ;
14327 15398  
14327 15398  i1:  10000               ; timeout in 0.1 msec
14328 15400  e.
14329 15400  \f


14329 15400  
14329 15400  c.-(:a399>23a.1:)
14330 15400  m2=-1
14331 15400  z.
14332 15400  
14332 15400  c.(:a399>23a.1:)-1
14333 15400  ; prepare_dump (ioc)
14334 15400  ; -----------------------------------------------------------------------------
14335 15400  ; 
14336 15400  ; the area specifed in the message is reserved for dump of the two specified
14337 15400  ; core areas. 
14338 15400  ; the core areas will be changed if necessary to be a multiplum of the 
14339 15400  ; segment size by first decrementing (if possible) the first_address and then
14340 15400  ; (if necessary) increment the last_address.
14341 15400  ; the area process must be reserved by the sender when the message is received
14342 15400  ; by the main process.
14343 15400  ;
14344 15400  ;        message (sender format)           message (when delivered to part 2)
14345 15400  ;        ---------------------------       ----------------------------------
14346 15400  ;
14347 15400  ;  + 0:  2 < 12 + 0                        2 < 12 + 0
14348 15400  ;  + 2:  first address (low core)          first address (low core)
14349 15400  ;  + 4:  last  address (low core)          0 (no of bytes)
14350 15400  ;  + 6:  first address (high core)         first segment (disk: phys, area: 0)
14351 15400  ;  + 8:  last  address (high core)         no of segments
14352 15400  ;  +10:  dump_device                       0 (next logical segment if area)
14353 15400  ;  +12:  first segment (if dump dev=disk)  first address (high core)
14354 15400  ;  +14:  -                                 no of segments (in high core)
14355 15400  ;
14356 15400  ; the format of the message when delivered to part 2 is close to the i/o
14357 15400  ; format of a message to an area process.
14358 15400  ;
14359 15400  ; at entry:
14360 15400  ;
14361 15400  ;  w0   -
14362 15400  ;  w1   sender
14363 15400  ;  w2   message
14364 15400  ;  w3   -
14365 15400  ;
14366 15400  
14366 15400  b.   i10,  j20    w.
14367 15400  
14367 15400  m2:                      ; prepare dump/set timeout
14368 15400       am         b19      ;
14369 15400       rl  w0    +a10      ; if main.kind = ifp then goto set timeout
14370 15400       se  w0     q20      ; else
14371 15400       jl.        m1.      ;
14372 15400       ds. w2     i2.      ; begin
14373 15400                           ;   ------- check specified dump device -------
14374 15400       rl  w1  x2+a155     ;
14375 15400       rl  w3    (b6)      ;   proc := message.dump_device;
14376 15400       rl  w0    (b4)      ;
14377 15400       sl  w1    (0)       ;   if not proc within area or external then
14378 15400       sl  w1  x3          ;      deliver_result(3);
14379 15400       jl         g5       ;
14380 15400                           ;
14381 15400       rl  w3  x1+a11      ;   if proc.name = 0 or
14382 15400       rl  w0  x1+a10      ;      proc.kind <> area and
14383 15400       sn  w3     0        ;      proc.kind <> disk then
14384 15400       jl         g5       ;      deliver_result(3);
14385 15400       se  w0     q4       ;
14386 15400       sn  w0     q6       ;
14387 15400       sz                  ;
14388 15400       jl         g5       ;
14389 15400       al  w3  x1          ;   p := proc;
14390 15400       sz                  ; 
14391 15400  j1:  rl  w3  x3+a50      ;   while p.kind <> ioc_main
14392 15400       rl  w0  x3+a10      ;   begin
14393 15400       se  w0     q20      ;     p := proc.main;
14394 15400       jl.        j1.      ;   end;
14395 15400                           ;
14396 15400       se  w3    (b19)     ;   if p <> this main then
14397 15400       jl         g5       ;      deliver_result(3);
14398 15400                           ;
14399 15400       rl  w0  x1+a10      ;   size :=
14400 15400       se  w0     q4       ;   if dump_device.kind = area then
14401 15400       jl.        j0.      ;      area.number_of_segments
14402 15400       rl  w0  x1+a61      ;   else
14403 15400       sz                  ;      disk.number_of_segments;
14404 15400  j0:  rl  w0  x1+a74      ;
14405 15400       rs. w0     i4.      ;
14406 15400                           ;
14407 15400       rl  w3  x3+a200     ;
14408 15400       se  w3     0        ;   if this main.pending_prepare_dump <> 0 then
14409 15400       jl         g5       ;      deliver_result(3);
14410 15400                           ;
14411 15400       al  w2  x1          ;
14412 15400       rl. w1     i1.      ;
14413 15400       jl  w3     d113     ;   check_reserver(internal, proc);
14414 15400       jl         g6       ;+0: other: deliver_result(2);
14415 15400       sz                  ;+2: internal: ok;
14416 15400       jl         g6       ;+4: none: deliver_result(2);
14417 15400                           ;
14418 15400                           ; -------- check addresses --------
14419 15400       al  w0     2        ;
14420 15400       rs. w0     i6.      ;   check high core addresses first
14421 15400                           ;
14422 15400       rl  w2     b18      ;
14423 15400  j9:  am.       (i6.)     ;check_addresses:
14424 15400       dl  w1  x2+a152     ;
14425 15400       la  w0     g50      ;   first := message.first & -2; <* even *>
14426 15400       la  w1     g50      ;   last  := message.last  & -2; <* even *>
14427 15400       am.       (i6.)     ;   message.first := first; 
14428 15400       rs  w0  x2+a151     ;
14429 15400                           ;
14430 15400       sl  w0     0        ;   if first > 8Mhw or
14431 15400       sh  w1     -1       ;      last  > 8Mhw or
14432 15400       jl         g5       ;      last  > core_size then
14433 15400       sl  w1    (b12)     ;      deliver_result(3);
14434 15400       jl         g5       ; 
14435 15400                           ;
14436 15400       al  w1  x1+2        ;
14437 15400       ws  w1     0        ;   dump_size := last - first + 2;
14438 15400       sh  w1    -1        ;   if dump_size < 0 then
14439 15400       jl         g5       ;      deliver_result(3);
14440 15400                           ;
14441 15400       al  w0     0        ;   no_of_segm,rest := dump_size / 512;
14442 15400       wd  w1     b221     ;
14443 15400       sn  w0     0        ;   if rest <> 0 then
14444 15400       jl.        j11.     ;   begin
14445 15400       am.       (i6.)     ;
14446 15400       rl  w3  x2+a151     ;     if message.first <> 0 then
14447 15400       sn  w3     0        ;     begin
14448 15400       jl.        j10.     ;
14449 15400       ws  w3     0        ;
14450 15400       sh  w3     0        ;       first := message.first - rest;
14451 15400       al  w3     0        ;       if first < 0 then first := 0;
14452 15400       la  w3     g50      ;       first := first & -2; <* even *>
14453 15400       am.       (i6.)     ;
14454 15400       rs  w3  x2+a151     ;       message.first := first;
14455 15400       jl.        j9.      ;       goto check_addresses;
14456 15400                           ;     end
14457 15400  j10:                     ;     else
14458 15400       am.       (i6.)     ;     begin
14459 15400       rl  w3  x2+a152     ;
14460 15400       wa  w3     0        ;       last := message.last + rest & -2; <* even *>
14461 15400       la  w3     g50      ;
14462 15400       am.       (i6.)     ;
14463 15400       rs  w3  x2+a152     ;
14464 15400       jl.        j9.      ;       goto check_addresses;
14465 15400                           ;     end;
14466 15400                           ;   end;
14467 15400  j11:                     ;
14468 15400       sl. w1    (i4.)     ;   if no_of_segm > size then
14469 15400       rl. w1     i4.      ;      no_of_segm := size;
14470 15400       am.       (i6.)     ;
14471 15400       rs  w1  x2+a152     ;   message.no_of_segments := no_of_segm;
14472 15400       rl. w0     i4.      ;
14473 15400       ws  w0     2        ;   size := size - no_of_segm;
14474 15400       rs. w0     i4.      ;
14475 15400                           ;
14476 15400       al  w0     0        ;   if address_pair = last then
14477 15400       rx. w0     i6.      ;   begin
14478 15400       se  w0     0        ;     address_pair := first;
14479 15400       jl.        j9.      ;     goto check_addresses;
14480 15400                           ;   end;
14481 15400       rl  w0  x2+a152     ;
14482 15400       wa  w0  x2+a154     ;   if message.no_of_segments = 0 then
14483 15400       sn  w0     0        ;      deliver_result(3);
14484 15400       jl         g5       ;
14485 15400                           ;
14486 15400       dl  w0  x2+a154     ;   <* save high core addr in mess_6 - mess_7 *>
14487 15400       ds  w0  x2+a157     ;
14488 15400       ds  w0     b28      ;   <* save high core addr in monitor for post mortem *>
14489 15400       dl  w0  x2+a152     ;
14490 15400       ds  w0     b27      ;   <* save low core addr in monitor for post mortem *>
14491 15400                           ;
14492 15400       rs  w0  x2+a154     ;   <* transform the format to resemble the 
14493 15400       al  w0     0        ;      area i/o format *>
14494 15400       rs  w0  x2+a152     ;
14495 15400       rs  w0  x2+a153     ;
14496 15400                           ;
14497 15400       rl  w3     b19      ;
14498 15400       rs  w2  x3+a200     ;   main.pending_prepare_dump := message;
14499 15400       al  w1     0        ;   main.dump_device := message.dump_device;
14500 15400       rx  w1  x2+a155     ;   message.dump_device := 0; <* area: next logical segment *>
14501 15400       rs  w1  x3+a201     ;
14502 15400       rl  w0  x1+a10      ;   if dump_device.kind = area then
14503 15400       se  w0     q4       ;   begin
14504 15400       jl.        j12.     ;
14505 15400       al  w2  x1          ;     insert_reserver(driverproc, area);
14506 15400       rl  w1     b21      ;
14507 15400       jl  w3     d125     ;  
14508 15400       jl.        j13.     ;   end
14509 15400  j12:                     ;   else
14510 15400       rl  w0  x2+a155     ;   begin
14511 15400       wa  w0  x1+a73      ;     message.first_segment :=
14512 15400       rs  w0  x2+a153     ;     message.first_logical_segment + 
14513 15400                           ;     disk.first_segment;
14514 15400  j13:                     ;   end;
14515 15400                           ;
14516 15400       al  w0     0        ;   force := no;
14517 15400       jl.       (n100.)   ;   start_controller(force);
14518 15400                           ;
14519 15400  i1:  0                   ; save w1
14520 15400  i2:  0                   ; save w2
14521 15400  i4:  0                   ; size
14522 15400  i6:  0                   ; address pair: 0  a151 - a152
14523 15400                           ;               2  a153 - a154
14524 15400                           ;
14525 15400  e.                       ; end;
14526 15400  z.
14527 15400  \f


14527 15400  ;
14528 15400  ; reset (ida & ifp) 
14529 15400  ; -------------------------------------------------------------------------
14530 15400  ;
14531 15400  ;        message (sender format)        answer
14532 15400  ;        -----------------------        ------
14533 15400  ;   + 0: 4<12 + mode                    0
14534 15400  ;   + 2:                                ifp_type (if soft_reset)
14535 15400  ;
14536 15400  ; the controller will be reset. for ida it will always be a hard reset 
14537 15400  ; (where the comm. area is not used); for ifp it will be a hard reset if
14538 15400  ; mode <> 2 otherwise it will be a soft reset involving a reset operation 
14539 15400  ; to be sent to the controller - in this case an answer is returned when
14540 15400  ; the ifp controller is ready. In this case cleanup is performed when the
14541 15400  ; answer arrives.
14542 15400  ; the process complex in rc8000 concerning this controller is cleaned up
14543 15400  ; i.e. all pending messages are returned with result 4, and all physical
14544 15400  ; disc, mt processes or gsd processes are removed.
14545 15400  ;
14546 15400  ; at entry:
14547 15400  ;
14548 15400  ; w0 -
14549 15400  ; w1 sender
14550 15400  ; w2 message
14551 15400  ; w3 -
14552 15400  ;
14553 15400  
14553 15400  b.  i10, j10  w.
14554 15400  
14554 15400  m4:                    ; reset
14555 15400       rl  w1     b4     ; begin
14556 15402  j0:  rl  w3  x1        ;   for proc := first external, next until last external do
14557 15404       rl  w0  x3+a10    ;   begin
14558 15406       se  w0     q6     ;   
14559 15408       jl.        j1.    ;     if proc.kind = disc and
14560 15410       rl  w0  x3+a50    ;
14561 15412       se  w0    (b19)   ;        proc.main = this main and
14562 15414       jl.        j1.    ;
14563 15416       rl  w0  x3+a70    ;        proc.next logical disc <> 0 then
14564 15418       se  w0     0      ;
14565 15420       jl         g5     ;        deliver result(3);
14566 15422                         ;
14567 15422  j1:  al  w1  x1+2      ;
14568 15424       se  w1    (b5)    ;
14569 15426       jl.        j0.    ;   end;
14570 15428                         ;
14571 15428       rl  w1     b19    ;
14572 15430       al  w0   2.100000 ;   main.state := not_ok;
14573 15432       lo  w0  x1+a78    ;
14574 15434       hs  w0  x1+a78+1  ;
14575 15436       rs  w1  x1+a77    ;   main.proc_id := main; <* just to initialize it *>
14576 15438  ;    al  w0     0      ;
14577 15438  ;    rs  w0  x1+a76    ;   main.device_id := 0;  <*          - " -        *>
14578 15438                         ;
14579 15438       rl  w0  x1+a10    ;   if main.kind = ifp_main and
14580 15440       am        (b18)   ;      message.mode = soft_reset then
14581 15442       zl  w3    +a150+1 ;   begin
14582 15444       se  w0     q20    ;
14583 15446       se  w3     2      ;
14584 15448       jl.        j2.    ;
14585 15450       al  w0     2      ;     force := strong; <* ignore state of main *>
14586 15452       jl.       (n100.) ;     start_controller(force); 
14587 15454                         ;     <* never reached *>
14588 15454  j2:                    ;   end
14589 15454                         ;   else
14590 15454       rl  w3  x1+a235   ;   begin
14591 15456       sn  w0     q26    ;
14592 15458       rs  w3     b58    ;     <* place ifp device addr in monitor table *>
14593 15460       al  w2     0      ;
14594 15462       se  w0     q26    ;     if  main.kind = ifpmain then
14595 15464       am       2.01<1   ;         reset(har_ifp_reset) 
14596 15466       do  w2  x3+0      ;     else reset(normal);
14597 15468       la  w3  b212      ;
14598 15470       wa  w3     b65    ;     <* clear any pending interrupt from contrller *>
14599 15472       rl  w0  x3+a313   ;
14600 15474       gp  w0     b95    ;
14601 15476                         ;
14602 15476       jl. w3    (n109.) ;     cleanup;
14603 15478                         ;
14604 15478       rl  w1     b19    ;     <* give the main process a few free
14605 15480       al  w0     3      ;     buffers to play with *>
14606 15482       ls  w0     12     ;
14607 15484       rs  w0  x1+a78+0  ;     proc.free_buffers := 3; proc.state:=free;
14608 15486       al  w0     0      ;     status := 0;
14609 15488       rs  w0 x1+a86     ;
14610 15490       rs  w0     g20    ;
14611 15492       al  w2  x1+a242   ;
14612 15494       se  w2     (x2)   ;     if in timeout queue then
14613 15496       jl  w3     d5     ;       remove (main, timeout_queue)
14614 15498       jl         g7     ;     deliver_result(1);
14615 15500                         ;   end;
14616 15500                         ;
14617 15500  e.                     ; end;
14618 15500  \f


14618 15500  
14618 15500  
14618 15500  ; create link (ioc & dlc)
14619 15500  ; -------------------------------------------------------------------------
14620 15500  ; 
14621 15500  ; if the specified rc8000 device number is -1 a free subprocess is
14622 15500  ; selected (and the device no will be placed in word +6 of the message).
14623 15500  ; the subprocess is (partly) initialized and the state of the subprocess
14624 15500  ; is set to 'during connect'.
14625 15500  ; the rest of the process is initialized when the maindriver receives
14626 15500  ; a create link answer operation from the controller.
14627 15500  ;
14628 15500  ; IOC:  message (sender/setup format)    answer (*)
14629 15500  ;       -----------------------------    ----------
14630 15500  ;  + 0: 6<12 + mode                      status
14631 15500  ;  + 2: control module/formatter         RC8000 device number
14632 15500  ;  + 4: slave device/station no          controller device index
14633 15500  ;  + 6: RC8000 device no/-1 (**)         device kind
14634 15500  ;  + 8: device kind, device type         device capacity
14635 15500  ;
14636 15500  ;
14637 15500  ; mode: 0: include sender as user of connection
14638 15500  ;       1: include users of main as users of connection
14639 15500  ;
14640 15500  ; device kind: 
14641 15500  ;              6: disk
14642 15500  ;             18: tape
14643 15500  ;
14644 15500  ; device type: none is defined
14645 15500  ;
14646 15500  ; DLC:  message (sender/setup format)    answer
14647 15500  ;       -----------------------------    ----------
14648 15500  ;  + 0: 6<12 + mode                      status
14649 15500  ;  + 2: device type (0-9)                RC8000 device number
14650 15500  ;  + 4: controller index/255
14651 15500  ;  + 6: RC8000 device no/-1 (**)
14652 15500  ;  + 8: name in controller
14653 15500  ;  +10:       - " -
14654 15500  ;  +12:       - " -
14655 15500  ;  +14:       - " -
14656 15500  ;
14657 15500  ; mode: as for IOC
14658 15500  ;
14659 15500  ; device type: see device type table (i0:)
14660 15500  ;
14661 15500  ; (*) the answer is created by the controller.
14662 15500  ; (**) RC8000 process address inserted instead of device no in part 1.
14663 15500  ;
14664 15500  ; at entry 
14665 15500  ;
14666 15500  ;  w0  -
14667 15500  ;  w1  sender
14668 15500  ;  w2  message
14669 15500  ;  w3  -
14670 15500  ;
14671 15500  
14671 15500  b.  i10, j20  w.
14672 15500  
14672 15500  m6:                    ; create link   
14673 15500       rl  w1  x2+a153   ; begin
14674 15502       se  w1    -1      ; 
14675 15504       jl.        j3.    ;   if message.rc8000_device_no = -1 then
14676 15506                         ;   begin
14677 15506       rl  w1     b5     ;     for proc := last external, next until first external do
14678 15508       al  w1  x1-2      ;
14679 15510  j1:  rl  w3  x1        ;     begin
14680 15512       rl  w0  x3+a10    ;
14681 15514       sn  w0     q68    ;       if proc.kind = free subprocess then
14682 15516       jl.        j4.    ;         goto out;
14683 15518                         ;     end;       
14684 15518  j2:  al  w1  x1-2      ;
14685 15520       sl  w1    (b4)    ;
14686 15522       jl.        j1.    ;     goto no_resources; 
14687 15524       jl.        j20.   ;   end
14688 15526                         ;   else
14689 15526  j3:  ls  w1    +1      ;   begin
14690 15528       wa  w1     b4     ;
14691 15530       sl  w1    (b4)    ;     if not message.rc8000_device_no within external then
14692 15532       sl  w1    (b5)    ;        deliver_result(3);
14693 15534       jl         g5     ;
14694 15536       rl  w3  x1        ;     proc := nametable(rc8000 device no);
14695 15538       rl  w0  x3+a10    ;     if proc.kind <> free subprocess then
14696 15540       se  w0     q68    ;        goto no_resources;
14697 15542       jl.        j20.   ;
14698 15544                         ;   end;
14699 15544  j4:  am        (b19)   ;out:
14700 15546       rl  w0    +a10    ;   <* w3: proc *>
14701 15548       se  w0     q20    ;   if this main.kind = ioc_main then
14702 15550       jl.        j5.    ;   begin
14703 15552                         ;
14704 15552       zl  w0  x2+a154   ;     kind := message.device_kind;
14705 15554       se  w0     q6     ;     if kind <> disk and tape then
14706 15556       sn  w0     q18    ;        deliver_result(3);
14707 15558       sz                ;
14708 15560       jl         g5     ;       <* w0: kind *>
14709 15562       jl.        j7.    ;   end
14710 15564  j5:                    ;   else <* main = dlc *>
14711 15564       rl  w1  x2+a151   ;   begin
14712 15566       sl  w1     1      ;     if message.device_type < 1 or
14713 15568       sl  w1     10     ;        message.device_type > 9 then
14714 15570       jl         g5     ;        deliver_result(3);
14715 15572                         ;
14716 15572       zl. w0  x1+i0.    ;     kind := device_kind_table(message.device_type);
14717 15574  ;    jl.        j7.    ;   end;
14718 15574                         ;
14719 15574  j7:                    ;
14720 15574       rl  w1  x2+a142   ;   if message.regrettet then
14721 15576       sh  w1     0      ;     deliver_result(dummy);
14722 15578       jl         g7     ;
14723 15580       zl  w1  x2+a150+1 ;   if message.mode <> 0 or 1 then
14724 15582       sz  w1    -2      ;      deliver_result(3);
14725 15584       jl         g5     ;
14726 15586                         ;
14727 15586                         ;   <*  init process  *>
14728 15586       rs  w0  x3+a10    ;   proc.kind := kind;
14729 15588                         ;
14730 15588       dl  w2  x2+a152   ;   proc.module,facility :=
14731 15590       ds  w2  x3+a68    ;   message.module,facility;
14732 15592       ld  w2    -48     ;   <* module,fac. irr. for dlc - don't matter *>
14733 15594       ds  w2  x3+a71    ;   <* clear proc a70 - a87 *>
14734 15596       ds  w2  x3+a73    ;
14735 15598       ds  w2  x3+a75    ;
14736 15600       ds  w2  x3+a87    ;
14737 15602                         ;
14738 15602       rl  w2     b19    ;   proc.main := this main;
14739 15604       rs  w2  x3+a50    ;
14740 15606       al  w1    2.000001;   proc.state := during_connect;
14741 15608       hs  w1  x3+a78+1  ;
14742 15610       rs  w3  x3+a77    ;   proc.proc_id := proc;
14743 15612       am        (b18)   ;
14744 15614       rs  w3    +a153   ;   message.8000_process := proc;
14745 15616                         ;
14746 15616       al  w2  x3        ;
14747 15618       am        (b18)   ;   if message.mode = 0 then
14748 15620       zl  w0    +a150+1 ;      include_user(message.sender, proc)
14749 15622       se  w0     0      ;   else
14750 15624       jl.        j10.   ;      include_all_users(main, proc);
14751 15626       am        (b18)   ;
14752 15628       rl  w1    +a142   ;
14753 15630       sh  w1     0      ;
14754 15632       ac  w1  x1        ;
14755 15634       jl  w3     d126   ;
14756 15636       al  w0     0      ;   force := no;
14757 15638       jl.       (n100.) ;
14758 15640  j10:                   ;
14759 15640       rl  w1     b19    ;
14760 15642       jl. w3     (n103.);
14761 15644       al  w0     0      ;   force := no;
14762 15646       jl.       (n100.) ;   start_controller(force);
14763 15648                         ;   <* never reached *>
14764 15648                         ;
14765 15648  j20:                   ; no_resources:
14766 15648       al  w0   8.1400   ;   status := no_resources;
14767 15650       rs  w0     g20    ;
14768 15652       jl         g7     ;   deliver_result(1);
14769 15654                         ;
14770 15654  h.                     ; device_kind_table(0:9)
14771 15654  i0:            -1      ; 0 : -
14772 15655        8                ; 1 : terminal
14773 15656       28                ; 2 : IMC port handler
14774 15657       28                ; 3 : mailbox
14775 15658       28                ; 4 : 3270 input
14776 15659       28                ; 5 : 3270 output
14777 15660       28                ; 6 : lanstat (test device)
14778 15661       28                ; 7 : floppy
14779 15662       14                ; 8 : printer
14780 15663       18                ; 9 : streamer
14781 15664  w.                     ;
14782 15664  e.                     ; end;
14783 15664  
14783 15664  \f


14783 15664  
14783 15664  ; extract statistics (ioc & dlc)
14784 15664  ; -------------------------------------------------------------------------
14785 15664  ;
14786 15664  ; the statistical information collected in the main process is copied
14787 15664  ; to the sender.
14788 15664  ;
14789 15664  ;       message (sender format)         answer
14790 15664  ;       -----------------------         ------
14791 15664  ;  + 0: 9<12 + mode                     status
14792 15664  ;  + 2: first storage address           no of halfwords
14793 15664  ;  + 4: last storage address            no of characters
14794 15664  ;
14795 15664  ;  mode: clear statistics<0: 0 = statistics remain unchanged
14796 15664  ;                            1 = statistics are cleared
14797 15664  ;
14798 15664  ;  at entry
14799 15664  ;
14800 15664  ;  w0  -
14801 15664  ;  w1  sender
14802 15664  ;  w2  message
14803 15664  ;  w3  -
14804 15664  ;
14805 15664  
14805 15664  b.  i10, j10  w.
14806 15664  
14806 15664  m9:                    ; extract statistics
14807 15664       rl  w3     b19    ; begin
14808 15666       al  w0  x3+a216   ;   param.first address := this main.statistics.first
14809 15668       al  w1  x3+a218   ;   param.last address  := this main.statistics.last
14810 15670       ds. w1     i3.    ;
14811 15672       al. w1     i1.    ;
14812 15674       jd      1<11+84   ;   general_copy(buffer, param);
14813 15676                         ;
14814 15676       sn  w0     0      ;   if result = 3 then
14815 15678       jl.        j1.    ;      decrease stopcount and deliver result_3(message)
14816 15680       se  w0     2      ;   else if result = 2 then 
14817 15682       jl.        (n104.);   begin
14818 15684       jl  w3     d132   ;     decrease_stopcount(message);
14819 15686       rl  w3     b20    ;
14820 15688       jl         g26    ;     goto_no_operation;
14821 15690                         ;   end;
14822 15690  j1:  rs  w1     g21    ;
14823 15692       ls  w1    -1      ;   message.no_of_halfwords := halfwords;
14824 15694       wm  w1     g48    ;   message.no_of_characters:= halfwords*2/3;
14825 15696       rs  w1     g22    ;
14826 15698       al  w0     0      ;
14827 15700       rs  w0     g20    ;   message.status := 0;
14828 15702                         ;
14829 15702       zl  w1  x2+a150+1 ;   if not clear_statistics then
14830 15704       so  w1     2.1    ;      decrease stopcount and deliver result_1(message)
14831 15706       jl.        (n105.);   else
14832 15708       ld  w1    -100    ;   begin
14833 15710       ds  w1  x3+a216+2 ;     clear all statistics in this mainprocess
14834 15712       ds  w1  x3+a218   ;
14835 15714       jl.        (n105.);     decrease stopcount and deliver result_1(message);
14836 15716                         ;   end;
14837 15716                         ;
14838 15716                         ; param:
14839 15716  i1:  2<1 + 1           ; function := 1st address pair, core to buffer
14840 15718       0                 ; first address
14841 15720  i3:  0                 ; last address
14842 15722       0                 ; relative start
14843 15724                         ;
14844 15724  e.                     ; end;
14845 15724  \f


14845 15724  
14845 15724  ;
14846 15724  ; remove link (ioc & dlc)
14847 15724  ; ------------------------------------------------------------------------
14848 15724  ;
14849 15724  ; removes the connection between a rc8000 external process representing an
14850 15724  ; device and the corresponding device.
14851 15724  ;
14852 15724  ;       message (sender format)         answer (*)
14853 15724  ;       -----------------------         ----------
14854 15724  ;  + 0: 10<12 + 0                       0
14855 15724  ;  + 2: rc8000 device number         
14856 15724  ; (+ 4: rc8000 proc addr when sent
14857 15724  ;              from driverproc)
14858 15724  ;
14859 15724  ;       message (setup format)
14860 15724  ;       ----------------------
14861 15724  ;  + 0: 10<12 + 0
14862 15724  ;  + 2: rc8000 process address
14863 15724  ;  + 4: controller_index
14864 15724  ;
14865 15724  ; (*) the answer is created by the controller.
14866 15724  ;
14867 15724  ; at entry 
14868 15724  ; 
14869 15724  ;  w0  -
14870 15724  ;  w1  sender
14871 15724  ;  w2  message
14872 15724  ;  w3  -
14873 15724  ;
14874 15724  
14874 15724  b.  i10, j10  w.
14875 15724  
14875 15724  m10:                    ; remove link
14876 15724                          ; begin
14877 15724       se  w1    (b21)    ;   if sender = driverproc then
14878 15726       jl.        j0.     ;   begin
14879 15728       rl  w2  x2+a152    ;     proc := message.mess_2;
14880 15730                          ;
14881 15730       al  w0     2.000111;     if proc.state = free or
14882 15732       la  w0  x2+a78     ;        proc.state = during disconnect then
14883 15734       se  w0     l36     ;        deliver_result(3);
14884 15736       sn  w0     l39     ;        <* a remove link message has been received
14885 15738       jl         g5      ;           after driverproc sent this message *>
14886 15740       jl.        j2.     ;     goto proc_ok;
14887 15742  j0:                     ;   end;
14888 15742       rl  w3  x2+a151    ; 
14889 15744       ls  w3    +1       ;
14890 15746       wa  w3     b4      ;
14891 15748       sl  w3    (b4)     ;   if not message.device number within external processes then
14892 15750       sl  w3    (b5)     ;      deliver result(3);
14893 15752       jl         g5      ;
14894 15754       rl  w2  x3         ;   proc := nametable(message.device number);
14895 15756                          ;
14896 15756       rl  w3  x2+a50     ;
14897 15758       sn  w2    (b19)    ;   if proc = this main or
14898 15760       jl         g5      ;      proc.main <> this main then
14899 15762       se  w3    (b19)    ;      deliver_result(3);
14900 15764       jl         g5      ;   <* test of main will catch disconnect of logical
14901 15766                          ;      disks and return result 3 *>
14902 15766       al  w0     2.000111;
14903 15768       la  w0  x2+a78     ;
14904 15770       se  w0     l36     ;   if proc.state= free or
14905 15772       sn  w0     l39     ;      proc.state= during disconnect 
14906 15774       jl         g5      ;   then deliver_result(3);
14907 15776       rl  w0  x2+a10     ;
14908 15778       se  w0     q6      ;   if proc.kind = disk then
14909 15780       jl.        j1.     ;   begin
14910 15782       rl  w0  x2+a70     ;
14911 15784       rl  w3     b19     ;     if proc.next_logical_disk <> 0 or
14912 15786       se  w0     0       ;        proc = this main.dump_device then
14913 15788       jl         g5      ;        deliver_result(3);
14914 15790       sn  w2 (x3+a201)   ; 
14915 15792       jl         g5      ;   end;
14916 15794                          ;
14917 15794  j1:  jl  w3     d76     ;   test user and reserver(sender, proc);
14918 15796       sz  w3     2.1000  ;   if other reserver or
14919 15798       jl         g6      ;     (sender not user and other users) then
14920 15800       so  w3     2.0001  ;   deliver_result(2);
14921 15802       so  w3     2.0100  ;
14922 15804       sz                 ;
14923 15806       jl         g6      ;
14924 15808  j2:                     ; proc_ok:
14925 15808       rl  w1     b18     ;
14926 15810       rl  w3  x2+a76     ;   message.mess_1 := proc;
14927 15812       ds  w3  x1+a152    ;   message.mess_2 := proc.controller_index;
14928 15814                          ;
14929 15814       ac  w0     2.000111+1;
14930 15816       la  w0  x2+a78     ;
14931 15818       al  w3     l39     ;
14932 15820       lo  w0     6       ;
14933 15822       hs  w0  x2+a78+1   ;   proc.state := during disconnect;
14934 15824                          ;   <* prevents create peripheral process *>
14935 15824       rl  w0  x2+a10     ;   
14936 15826       se  w0     q8      ;   if proc.kind = terminal then
14937 15828       jl.        j3.     ;   begin
14938 15830       al  w0     1<1     ;     type := disconnected;
14939 15832       rl  w1     b19     ;
14940 15834       jl. w3     (n112.) ;     check_remoter(type, main, proc);
14941 15836       rs  w3  x2+a74     ;     proc.att_receiver := internal_supervisor;
14942 15838       se  w3     0       ;     if internal_supervisor then
14943 15840       jl. w3     n114.   ;        send_remoter_att(type, main, proc);
14944 15842                          ;   end;
14945 15842  j3:                     ;
14946 15842       jl. w3     n2.     ;   clear_process(proc);
14947 15844                          ;
14948 15844       al  w0     0       ;   force := no;
14949 15846       jl.       (n100.)  ;   start controller(force);
14950 15848                          ;   <* the rest of the process will be cleared when
14951 15848                          ;      answer disconnect is received *>
14952 15848  e.                      ; end;
14953 15848  \f


14953 15848  
14953 15848  ;
14954 15848  ; set mask (ioc & dlc)
14955 15848  ; ------------------------------------------------------------------------
14956 15848  ; 
14957 15848  ; sets the test mask in the rc8000 driver.
14958 15848  ;
14959 15848  ;       message (sender/setup format)     answer
14960 15848  ;       -----------------------------     ----------
14961 15848  ;  + 0: 12<12 + mode                      status
14962 15848  ;  + 2: rc8000 mask (point  0 - 23) 
14963 15848  ;  + 4: rc8000 mask (point 24 - 47)
14964 15848  ;
14965 15848  ; at entry 
14966 15848  ;
14967 15848  ;  w0  -
14968 15848  ;  w1  sender
14969 15848  ;  w2  message
14970 15848  ;  w3  -
14971 15848  ;
14972 15848  
14972 15848  m12:                   ; set mask
14973 15848                         ; begin
14974 15848       rl  w3     b19    ;   <* set mask for rc8000 device drivers *>
14975 15850       dl  w1  x2+a152   ;
14976 15852       ds  w1  x3+a75    ;
14977 15854       al  w0     0      ;   answer.status := ok;
14978 15856       rs  w0     g20    ;
14979 15858       jl         g7     ;   deliver_result(1);
14980 15860                         ; end;
14981 15860  \f


14981 15860  
14981 15860  ; dump (ioc)
14982 15860  ; -----------------------------------------------------------------------------
14983 15860  ;
14984 15860  ; the previously sent 'prepare dump' operation will be executed.
14985 15860  ;
14986 15860  ;         message (sender & setup format)
14987 15860  ;         -------------------------------
14988 15860  ;   + 0: 14 < 12 + 0
14989 15860  ;   + 2:  0
14990 15860  ;   + 4:  0
14991 15860  ;
14992 15860  ;
14993 15860  ; at entry:
14994 15860  ;
14995 15860  ;    w0:  -
14996 15860  ;    w1:  sender
14997 15860  ;    w2:  message
14998 15860  ;    w3:  -
14999 15860  ;
15000 15860  
15000 15860  b.  i10,  j10   w.
15001 15860  
15001 15860  m14:                      ; dump
15002 15860       rl  w3     b19       ; begin
15003 15862       rl  w0  x3+a200      ;
15004 15864       sn  w0     0         ;   if main.pending_prepare_dump = 0 then
15005 15866       jl         g5        ;      deliver_result(3);
15006 15868       rl  w0  x2+a151      ;
15007 15870       lo  w0  x2+a152      ;
15008 15872       se  w0     0         ;   if message.mess_1<>0 or message.mess_2<>0 then
15009 15874       jl         g5        ;      deliver_result(3);
15010 15876       al  w0     1         ;   force := weak;
15011 15878       jl.       (n100.)    ;   start_controller(force);
15012 15880                            ;
15013 15880  e.                        ; end;
15014 15880  
15014 15880  \f


15014 15880  
15014 15880  ;
15015 15880  ; link logical disk (ioc)
15016 15880  ; ------------------------------------------------------------------------
15017 15880  ; 
15018 15880  ; creates a logical disc process and initialize it. if the specified 
15019 15880  ; device number of the logical disc is -1 a free subprocess is selec-
15020 15880  ; ted.
15021 15880  ;
15022 15880  ;       message (sender format)               answer
15023 15880  ;       -----------------------               ------
15024 15880  ;  + 0: 16<12 + mode                          status
15025 15880  ;  + 2: device no of logical disc/-1          device no of logical disc
15026 15880  ;  + 4: device no of physical disc            device no of physical disc
15027 15880  ;  + 6: first segment                         first segment
15028 15880  ;  + 8: no of segments                        no of segments
15029 15880  ;
15030 15880  ;  mode: 0: sender is included as user of logical disc.
15031 15880  ;        1: all users of main are included as users of the logical disc.
15032 15880  ;
15033 15880  ; at entry
15034 15880  ; 
15035 15880  ;  w0  -
15036 15880  ;  w1  sender
15037 15880  ;  w2  message
15038 15880  ;  w3  -
15039 15880  ;
15040 15880  
15040 15880  b.  i10, j15  w.
15041 15880  
15041 15880  m16:                    ; link logical disc
15042 15880       zl  w0  x2+a150+1  ; begin
15043 15882       sz  w0    -2       ;   if not message.mode = 0 or 1 then
15044 15884       jl         g5      ;      deliver result(3);
15045 15886       rl  w3  x2+a152    ;
15046 15888       ls  w3    +1       ;
15047 15890       wa  w3     b4      ;      if not external processes then
15048 15892       sl  w3    (b4)     ;
15049 15894       sl  w3    (b5)     ;      deliver result(3);
15050 15896       jl         g5      ;
15051 15898                          ;
15052 15898       rl  w3  x3         ;   proc := nametable(devno);
15053 15900       rl  w0  x3+a10     ;   if proc.kind <> disc or
15054 15902       rl  w2  x3+a50     ;      proc.main <> this mainprocess then
15055 15904       sn  w0     q6      ;      deliver result(3);
15056 15906       se  w2    (b19)    ;
15057 15908       jl         g5      ;
15058 15910       al  w0     2.000111;
15059 15912       la  w0  x3+a78     ;   if proc.state <> connected then
15060 15914       se  w0     l38     ;      deliver result(3);
15061 15916       jl         g5      ;
15062 15918                          ;
15063 15918       al  w2  x3         ;   
15064 15920       jl  w3     d113    ;   check reserver(sender, proc);
15065 15922       jl         g6      ;   +0: if other reserver then deliver result(2);
15066 15924       jl.        j0.     ;   +2: 
15067 15926       jl  w3     d102    ;   +4: if no reserver then check user(sender, proc);
15068 15928       jl         g6      ;   +0: if not user then deliver result(2);
15069 15930                          ;   +2:
15070 15930  j0:  al  w3  x2         ;
15071 15932       rs. w1     i1.     ;
15072 15934       rl  w1     b18     ;   logical := proc.first logical disc;
15073 15936       rl  w2  x3+a70     ;
15074 15938  j1:  sn  w2     0       ;   while logical <> 0 do
15075 15940       jl.        j4.     ;   begin
15076 15942                          ;
15077 15942       rl  w0  x2+a73     ;     if logical.first segment < message.first segment then
15078 15944       sl  w0 (x1+a153)   ;     begin
15079 15946       jl.        j2.     ;       if logical.first segment+logical.no of segments >=
15080 15948       wa  w0  x2+a74     ;          message.first segment then
15081 15950       sh  w0 (x1+a153)   ;          deliver result(3);
15082 15952       jl.        j3.     ;
15083 15954       jl         g5      ;
15084 15956                          ;     end else
15085 15956  j2:  rl  w0  x1+a153    ;     begin
15086 15958       wa  w0  x1+a154    ;       if message.first segment+message.no of segments >=
15087 15960       sh  w0 (x2+a73)    ;          logical.first segment then
15088 15962       sz                 ;          deliver result(3);
15089 15964       jl         g5      ;
15090 15966                          ;     end;
15091 15966  j3:  rl  w2  x2+a70     ;     logical := logical.next logical disc;
15092 15968       jl.        j1.     ;   end;
15093 15970                          ;
15094 15970  j4:  rl  w2  x1+a153    ;   if message.first segment <
15095 15972       al  w0  x2-1       ;      proc.first segment or
15096 15974       wa  w0  x1+a154    ;      message.first segment + message.no of segments >
15097 15976       sl  w2 (x3+a73)    ;      proc.no of segments or
15098 15978       sl  w0 (x3+a74)    ;      
15099 15980       jl         g5      ;
15100 15982       sl  w0  x2         ;      message.no of segments <= 0 then
15101 15984       sz                 ;
15102 15986       jl         g5      ;      deliver result(3);
15103 15988                          ;
15104 15988       rl  w1  x1+a151    ;   if message.logical devno = -1 then
15105 15990       se  w1    -1       ;   begin
15106 15992       jl.        j7.     ;
15107 15994       rl  w1     b4      ;     for ext := first external, next until last external do
15108 15996  j5:  rl  w2  x1         ;     begin
15109 15998       rl  w0  x2+a10     ;
15110 16000       se  w0     q68     ;       if ext.kind = free subprocess then
15111 16002       jl.        j6.     ;       begin
15112 16004       rl  w1  x2+a59     ;         message.logical devno := ext.device_no;
15113 16006       am        (b18)    ;
15114 16008       rs  w1    +a151    ;         goto out;
15115 16010       jl.        j7.     ;       end;
15116 16012                          ;
15117 16012  j6:  al  w1  x1+2       ;
15118 16014       se  w1    (b5)     ;
15119 16016       jl.        j5.     ;     end;
15120 16018       jl.        j10.    ;     deliver status('no free subprocesses');
15121 16020                          ;out:
15122 16020                          ;   end;
15123 16020  j7:  ls  w1    +1       ;
15124 16022       wa  w1     b4      ;
15125 16024       sl  w1    (b4)     ;   if not ext within external processes then
15126 16026       sl  w1    (b5)     ;   deliver result(3);
15127 16028       jl         g5      ;
15128 16030       rl  w2  x1         ;   ext := nametable(logical devno);
15129 16032       rl  w0  x2+a10     ;   if ext.kind <> free subprocess then
15130 16034       se  w0     q68     ;      deliver status('no free subprocesses');
15131 16036       jl.        j10.    ;
15132 16038                          ;
15133 16038       ld  w1    -100     ;   ext.chaintable := 0;
15134 16040       ds  w1  x2+a72     ;   ext.slicelength := 0;
15135 16042       al  w1  x2+a81     ;
15136 16044       al  w0  x1         ;   <* init process queues *>
15137 16046       ds  w1  x2+a81+2   ;
15138 16048       al  w1  x2+a54     ;
15139 16050       al  w0  x1         ;
15140 16052       ds  w1  x2+a55     ;
15141 16054                          ;
15142 16054       rs  w3  x2+a50     ;   ext.main := physical disc;
15143 16056       al  w0     q6      ;   ext.kind := disc kind;
15144 16058       rs  w0  x2+a10     ;
15145 16060       al  w0     2.1     ;
15146 16062       hs  w0  x2+a57     ;   ext.type := logical type;
15147 16064       am        (b18)    ;
15148 16066       dl  w1    +a154    ;   ext.first segment := message.first segment;
15149 16068       ds  w1  x2+a74     ;   ext.no of segments:= message.no of segments;
15150 16070       dl  w1  x3+a87     ;   ext.max_transfer_size := physical_disk.max_transfer_size;
15151 16072       ds  w1  x2+a87     ;   ext.max_buffer_size := physical_disk.max_buffer_size;
15152 16074       rl  w1  x3+a75     ;   ext.bytes_pr_track := physical_disk.bytes_pr_track;
15153 16076       rs  w1  x2+a75     ;
15154 16078       dl  w1  x3+a77     ;   ext.controller_index:=physical_disc.controller_index;
15155 16080       ds  w1  x2+a77     ;   ext.rc8000process:= physical disc.rc8000process;
15156 16082       dl  w1  x3+a68     ;   ext.cm  := physical disc.cm;
15157 16084       ds  w1  x2+a68     ;   ext.unit:= physical disc.unit;
15158 16086                          ;
15159 16086       al  w0     0       ;
15160 16088  j8:  sn  w0 (x3+a70)    ;   while proc.next logical disc <> 0 do
15161 16090       jl.        j9.     ;   proc := proc.next logical disc;
15162 16092       rl  w3  x3+a70     ;
15163 16094       jl.        j8.     ;
15164 16096                          ;
15165 16096  j9:  rs  w2  x3+a70     ;   proc.next logical disc := ext;
15166 16098       rs  w0  x2+a70     ;   ext.next logical disc := 0;
15167 16100                          ;
15168 16100       am        (b18)    ;
15169 16102       zl  w0    +a150+1  ;   if message.mode = 0 then
15170 16104       se  w0     0       ;      include user(message.sender, ext)
15171 16106       jl.        j11.    ;   else
15172 16108       rl. w1     i1.     ;      include all users(physical disc, ext);
15173 16110       jl  w3     d126    ;
15174 16112       jl.        j12.    ;
15175 16114  j11:                    ;
15176 16114       rl  w1  x2+a50     ;
15177 16116       jl. w3     (n103.) ;
15178 16118  j12:                    ;
15179 16118       al  w0     l38     ;
15180 16120       hs  w0  x2+a78+1   ;   ext.state := connected;
15181 16122                          ;
15182 16122       rl  w3     b18     ;
15183 16124       al  w0     0       ;
15184 16126       rs  w0     g20     ;   status := ok;
15185 16128       dl  w1  x3+a152    ;   rc8000 device no of logical disc
15186 16130       ds  w1     g22     ;   rc8000 device no of physical disc
15187 16132       dl  w1  x3+a154    ;   first segment
15188 16134       ds  w1     g24     ;   no of segments
15189 16136       jl         g7      ;   deliver result(1);
15190 16138                          ;
15191 16138                          ;
15192 16138  j10:                    ; no_resources: 
15193 16138       al  w0   8.1400    ;   status := no_resources; 
15194 16140       rs  w0     g20     ;
15195 16142       jl         g7      ;   deliver result(1);
15196 16144                          ;
15197 16144  i1:  0                  ; saved sender
15198 16146                          ;
15199 16146  e.                      ; end;
15200 16146  \f


15200 16146  
15200 16146  ;
15201 16146  ; unlink logical disc (ioc)
15202 16146  ; ------------------------------------------------------------------------
15203 16146  ;
15204 16146  ; removes the logical disc process in rc8000 and the connection to the 
15205 16146  ; physical disc process.
15206 16146  ;
15207 16146  ;       message (sender format)            answer
15208 16146  ;       -----------------------            ------
15209 16146  ;  + 0: 18<12 + 0                          0
15210 16146  ;  + 2: rc8000 device number               
15211 16146  ;
15212 16146  ; at entry
15213 16146  ;
15214 16146  ;  w0  -
15215 16146  ;  w1  sender
15216 16146  ;  w2  message
15217 16146  ;  w3  -
15218 16146  ;
15219 16146  
15219 16146  b.  i10, j10  w.
15220 16146  
15220 16146  m18:                   ; unlink logical disc
15221 16146       rl  w3  x2+a151   ; begin
15222 16148       ls  w3    +1      ;
15223 16150       wa  w3     b4     ;
15224 16152       sl  w3    (b4)    ;   if not message.device number within external processes then
15225 16154       sl  w3    (b5)    ;      deliver result(3);
15226 16156       jl         g5     ;
15227 16158                         ;
15228 16158       rl  w2  x3        ;   proc := nametable(message.device number);
15229 16160       rl  w0  x2+a10    ;   if proc.kind <> disc or
15230 16162       zl  w3  x2+a57    ;      proc.type <> logical disc then
15231 16164       sn  w0     q6     ;      deliver result(3);
15232 16166       so  w3     2.1    ;
15233 16168       jl         g5     ;
15234 16170       sz  w3     2.1100000;    if proc.type = logical volume then 
15235 16172       jl         g5     ;      deliver result(3);
15236 16174                         ;
15237 16174       rl  w3  x2+a50    ;   if proc.main.main <> this mainprocess or
15238 16176       rl  w3  x3+a50    ;      proc.chaintable <> 0 then
15239 16178       rl  w0  x2+a71    ;      deliver result(3);
15240 16180       sn  w0     0      ;
15241 16182       se  w3    (b19)   ;
15242 16184       jl         g5     ;
15243 16186                         ;
15244 16186       sn  w2 (x3+a201)  ;   if mainprocess.dump_device = proc then
15245 16188       jl         g5     ;      deliver_result(3);
15246 16190                         ;
15247 16190       jl  w3     d76    ;   test user and reserver(sender, proc);
15248 16192       sz  w3     2.1000 ;   if other reserver or
15249 16194       jl         g6     ;      (sender not user and other users) then
15250 16196       so  w3     2.0001 ;      deliver result(2);
15251 16198       so  w3     2.0100 ;
15252 16200       sz                ;
15253 16202       jl         g6     ;
15254 16204                         ;
15255 16204       rl  w1  x2+a50    ;   p := proc.main; <* physical disc *>
15256 16206  j1:  sn  w2 (x1+a70)   ;   while p.next logical disc <> proc do
15257 16208       jl.        j2.    ;     p := p.next logical disc;
15258 16210       rl  w1  x1+a70    ;
15259 16212       jl.        j1.    ;
15260 16214                         ;
15261 16214  j2:  rl  w0  x2+a70    ;   p.next logical disc := proc.next logical disc;
15262 16216       rs  w0  x1+a70    ;
15263 16218       al  w0     0      ;   proc.next logical disc := 0;
15264 16220       rs  w0  x2+a70    ;
15265 16222                         ;
15266 16222       jl. w3     n2.    ;   clear_process(proc);
15267 16224                         ;
15268 16224       jl. w3     n8.    ;   free_process(proc);
15269 16226                         ;
15270 16226       al  w0     0      ;   status := 0;
15271 16228       rs  w0     g20    ;
15272 16230       jl         g7     ;   deliver result(1);
15273 16232                         ;
15274 16232  e.                     ; end;
15275 16232  \f


15275 16232  
15275 16232  m20:                   ; test:
15276 16232       al  w0     0      ;   force := no;
15277 16234       jl.       (n100.) ;   start_controller(force);
15278 16236  
15278 16236  
15278 16236  \f


15278 16236  
15278 16236  ;
15279 16236  ; initialize controller
15280 16236  ; -----------------------------------------------------------------------------
15281 16236  ;
15282 16236  ; the mainprocess is connected to the supervisor process in the controller.
15283 16236  ; credits for outstanding messages are exchanged between the two parties.
15284 16236  ;
15285 16236  ;      message (sender/setup format)     answer format
15286 16236  ; + 0  22 < 12 + 0                       0
15287 16236  ; + 2  controller credit                 monitor credit
15288 16236  ;
15289 16236  ; at entry
15290 16236  ; w0   -
15291 16236  ; w1   sender
15292 16236  ; w2   message
15293 16236  ; w3   -
15294 16236  
15294 16236  b.  i10,  j10  w.
15295 16236  
15295 16236  m22:                    ; initialize controller
15296 16236       rl  w1     b19     ; begin
15297 16238       al  w0     8.07    ;
15298 16240       la  w0  x1+a78+1   ;   if main.state <> free then
15299 16242       se  w0     0       ;      deliver_result(3);
15300 16244       jl         g5      ;
15301 16246                          ;
15302 16246       am        (b21)    ;   if driverproc.buffer_claim <=
15303 16248       zl  w0    +a19     ;      message.controller_credit then
15304 16250       sh  w0 (x2+a151)   ;      deliver_result(3);
15305 16252       jl         g5      ;
15306 16254                          ;
15307 16254       rl  w0  x2+a142    ;   if regretted(message) then
15308 16256       sh  w0     0       ;      deliver_result(dummy);
15309 16258       jl         g7      ;
15310 16260                          ;
15311 16260       al  w0     2.000001;   main.state := during_connect;
15312 16262       lo  w0  x1+a78     ;
15313 16264       hs  w0  x1+a78+1   ;   <* give the main process a few free
15314 16266       al  w0     4       ;      buffers to play with *>
15315 16268       hs  w0  x1+a78+0   ;   proc.free_buffers := 4;
15316 16270                          ;
15317 16270       rs  w1  x1+a50     ;   main.main := main;
15318 16272       rs  w1  x1+a77     ;   main.proc_id := main;
15319 16274       al  w0     0       ;   main.device_id := 0;
15320 16276       rs  w0  x1+a76     ;
15321 16278       al  w3     0       ;
15322 16280       ds  w0  x1+a216+2  ;   <* clear statistics *>
15323 16282       ds  w0  x1+a218    ;
15324 16284       ds  w0  x1+a201    ;   <* clear prepare dump variables *>
15325 16286                          ;
15326 16286       rx  w1     4       ;
15327 16288       rl  w1  x1+a142    ;
15328 16290       jl  w3     d126    ;   include_user(message.sender, proc);
15329 16292                          ;
15330 16292       al  w0     1       ;   force := weak;
15331 16294       jl.       (n100.)  ;   start_controller(force);
15332 16296                          ;
15333 16296  e.                      ; end;
15334 16296  \f


15334 16296  
15334 16296  ;
15335 16296  ; answer create link (internal driverproc message)
15336 16296  ; -----------------------------------------------------------------------------
15337 16296  ;
15338 16296  ; sent from driverproc to mainprocess (driverproc) when 'answer create link'
15339 16296  ; is sent to then controller.
15340 16296  ; format of the message: see o20 in the interrupt procedure c36.
15341 16296  ;
15342 16296  ;    at entry
15343 16296  ;   w0  -
15344 16296  ;   w1  (sender)
15345 16296  ;   w2  message
15346 16296  ;   w3  -
15347 16296  ;
15348 16296  
15348 16296  b.  i5,  j5  w.
15349 16296  
15349 16296  i1:  0                    ; reserver, result
15350 16298  i2:  0                    ; terminal_process
15351 16300  
15351 16300  m31:                      ; answer create link
15352 16300       rl  w0  x2+a151      ; begin
15353 16302       rs. w0     i1.       ;   <* save reserved, result *>
15354 16304       rl  w0  x2+a153      ;
15355 16306       rs. w0     i2.       ;   <* save terminal process *>
15356 16308                            ;
15357 16308       al  w0     0         ;   force := no;
15358 16310       am        (b19)      ;
15359 16312       rl  w1    +a59       ;
15360 16314       jd         1<11+128  ;   start_controller(force, this main.devno, message);
15361 16316       se  w0     0         ;   if result <> ok then 
15362 16318       jl         g4        ;      deliver_result(4);
15363 16320                            ;
15364 16320       hl. w0     i1.+0     ;   
15365 16322       hl. w1     i1.+1     ;   if save_result <> ok or
15366 16324       sn  w1     1         ;      save_reserved = 0 then
15367 16326       se  w0     1         ;      goto driverproc.wait_event;
15368 16328       jl        (b20)      ;
15369 16330                            ;
15370 16330  ;    al  w0     1<0       ;   type := connected;
15371 16330       rl  w1     b19       ;
15372 16332       rl. w2     i2.       ;
15373 16334       jl. w3     n14.      ;   send_remoter_att(type, main, terminal);
15374 16336                            ;
15375 16336       jl        (b20)      ;   goto driverproc.wait_event;
15376 16338                            ;
15377 16338                            ;
15378 16338  e.                        ; end;
15379 16338  
15379 16338  \f


15379 16338  
15379 16338  
15379 16338  ; answer remove link request
15380 16338  ; answer attention
15381 16338  
15381 16338  m32:
15382 16338  m33:
15383 16338       al  w0     0      ; force := no;
15384 16340       jl.       (n100.) ; start_controller(force);
15385 16342  
15385 16342  ; stop normal communication
15386 16342  
15386 16342  m34: al  w0     2      ; force := strong
15387 16344       jl.        (n100.); start_controller(force)
15388 16346  
15388 16346  
15388 16346  
15388 16346  
15388 16346  
15388 16346  \f


15388 16346  
15388 16346  ;
15389 16346  ; input (ida ifp) only RC8000
15390 16346  ; -----------------------------------------------------------------------------
15391 16346  ;
15392 16346  ; this operation must have been preceeded by a 'position' operation in which
15393 16346  ; the input area was defined.
15394 16346  ;
15395 16346  ;        message (sender format)       answer (*)
15396 16346  ;        -----------------------       ----------
15397 16346  ;   + 0: 3<12 + 0                      status
15398 16346  ;   + 2: first storage address         no of halfwords transfered
15399 16346  ;   + 4: last storage address          no of chareacters transfered
15400 16346  ;
15401 16346  ;        message (setup format)
15402 16346  ;        ----------------------
15403 16346  ;   + 0: 3<12 + 0
15404 16346  ;   + 2: first storage address
15405 16346  ;   + 4: no of bytes
15406 16346  ;
15407 16346  ; (*) the answer is created by the controller.
15408 16346  ;
15409 16346  ; at entry:
15410 16346  ;
15411 16346  ; w0  -
15412 16346  ; w1  sender
15413 16346  ; w2  message
15414 16346  ; w3  -
15415 16346  ;
15416 16346  
15416 16346  b.  i5, j5  w.
15417 16346  
15417 16346  m3:                    ; input 
15418 16346                         ; begin
15419 16346       al  w3     0      ;   message.no of bytes := 
15420 16348       rl  w0  x2+a152   ;  (message.no of bytes//768) * 768;
15421 16350       wd  w0     b222   ;
15422 16352       wm  w0     b222   ;   < let no of bytes be a multiplum of the
15423 16354       rs  w0  x2+a152   ;     segmentsize >
15424 16356       al  w0     0      ;   force := no;
15425 16358       jl.       (n100.) ;   start_controller(force);
15426 16360                         ;
15427 16360  e.                     ; end;
15428 16360  
15428 16360  \f


15428 16360  
15428 16360  ;
15429 16360  ; take autoload block (ida & ifp) only RC8000
15430 16360  ; -------------------------------------------------------------------------
15431 16360  ;
15432 16360  ; the specified autoload block is transmitted to the controller.
15433 16360  ;
15434 16360  ;       message (sender format)        answer (*)
15435 16360  ;       -----------------------        ----------
15436 16360  ;  + 0: 5<12 + 0                       status
15437 16360  ;  + 2: first storage address          number of halfwords transfered
15438 16360  ;  + 4: last storage address           number of characters transfered
15439 16360  ;
15440 16360  ;       message (setup format)
15441 16360  ;       ----------------------
15442 16360  ;  + 0: 5<12 + 0
15443 16360  ;  + 2: first storage address
15444 16360  ;  + 4: no of bytes
15445 16360  ;
15446 16360  ; (*) the answer is created by the controller.
15447 16360  ;
15448 16360  ; at entry
15449 16360  ;
15450 16360  ;  w0  -
15451 16360  ;  w1  sender
15452 16360  ;  w2  message
15453 16360  ;  w3  -
15454 16360  ;
15455 16360  
15455 16360  b. i10, j10  w.
15456 16360  
15456 16360  m5:                    ; take autoload block
15457 16360                         ; begin
15458 16360       al  w0     0      ;   force := no;
15459 16362       jl.       (n100.) ;   start_controller(force);
15460 16364                         ;
15461 16364  e.                     ; end;
15462 16364  \f


15462 16364  
15462 16364  ;
15463 16364  ; position (ida ifp) only RC8000
15464 16364  ; -----------------------------------------------------------------------------
15465 16364  ; 
15466 16364  ; this operation defines the (logical) filenumber from where the succeding
15467 16364  ; input operations will receive data.
15468 16364  ;
15469 16364  ;       message (sender/setup format)     answer (*)
15470 16364  ;       -----------------------------     ----------
15471 16364  ;  + 0: 8<12 + 0                          status
15472 16364  ;  + 2: 0
15473 16364  ;  + 4: 0
15474 16364  ;  + 6: (logical) filenumber
15475 16364  ;
15476 16364  ; (*) the answer is created by the controller.
15477 16364  ;
15478 16364  ; at entry:
15479 16364  ; 
15480 16364  ;  w0  -
15481 16364  ;  w1  sender
15482 16364  ;  w2  message
15483 16364  ;  w3  -
15484 16364  ;
15485 16364  
15485 16364  m8:                    ; position
15486 16364                         ; begin
15487 16364       al  w0     0      ;   force := no;
15488 16366       jl.       (n100.) ;   start_controller(force);
15489 16368                         ; end;
15490 16368  \f


15490 16368  ; 
15491 16368  ; M E S S A G E   R E C E I V E D   B Y   S S P  M A I N P R O C E S S .
15492 16368  ; ----------------------------------------------------------------------
15493 16368  ;
15494 16368  ; Control is transfered to this part when driverproc receives a 
15495 16368  ; message sent to the SSP main process.
15496 16368  ; 
15497 16368  ; From driverproc the following messages can be received:
15498 16368  ;      answer attention             - 3
15499 16368  ;
15500 16368  ; The ioc/dlc code for the following operations are used by the
15501 16368  ; ssp main-driver:
15502 16368  ;      - extract_statistics    ( m9)
15503 16368  ;      - set_mask              (m12)
15504 16368  ;      - initialize_controller (m22)
15505 16368  ;
15506 16368  ; At entry the registers contains:
15507 16368  ;
15508 16368  ;  w0  -
15509 16368  ;  w1  sender
15510 16368  ;  w2  message
15511 16368  ;  w3  main process
15512 16368  ;
15513 16368  
15513 16368  b. i10, j10  w.
15514 16368  
15514 16368  h24:                   ; message received
15515 16368       rs. w1     i1.    ; begin
15516 16370       rl  w3     b21    ;
15517 16372       zl  w0  x3+a19    ;   <* claim the buffer - driverproc will have claims
15518 16374       bs. w0     1      ;      enough as it received the message in wait event
15519 16376       hs  w0  x3+a19    ;      and unclaimed it 'by hand' when it received it *>
15520 16378       ac  w3 (x2+a141)  ;
15521 16380       rs  w3  x2+a141   ;
15522 16382                         ;
15523 16382       sn  w1    (b21)   ;   if message.sender = driverproc then    
15524 16384       jl.        j3.    ;      goto branch;    <* skip all checks *>
15525 16386                         ;
15526 16386       zl  w0  x2+a150+0 ;   if message.operation < 24 then
15527 16388       sl  w0     24     ;   begin
15528 16390       jl.        j1.    ;
15529 16392       dl. w1     i2.    ;     check_operation(operation_mask, mode_mask, message);
15530 16394       jl  w3     g16    ;
15531 16396       rl. w1     i1.    ;
15532 16398       jl  w3     g14    ;     check_user(sender, message);
15533 16400       jl.        j2.    ;   end
15534 16402  j1:                    ;   else   <* no io operation with oper. code > 23 as  *>
15535 16402       se  w0     24     ;   begin  <* check_operation must be called for those *>
15536 16404       sn  w0     25     ;     if message.operation <> 24 and
15537 16406       sz                ;        message.operation <> 26 then
15538 16408       jl         g5     ;        deliver_result(3);
15539 16410       rl. w1     i1.    ;
15540 16412       jl  w3     g15    ;     check_reserver(sender, message);
15541 16414  j2:                    ;   end;
15542 16414                         ;
15543 16414       zl  w0  x2+a138+1 ;
15544 16416       so  w0     2.1    ;   if message.state.io then
15545 16418       jl.        j4.    ;   begin
15546 16420       jl  w3     g34    ;     if message.regretted or
15547 16422       sz                ;        message.sender.state = stopped then
15548 16424       jl.        j3.    ;     begin
15549 16426       rl  w3     b20    ;       no operation;
15550 16428       jl         g26    ;       goto driverproc.wait event;
15551 16430                         ;     end;
15552 16430                         ;
15553 16430  j3:  jl  w3     g31    ;     increase stopcount(message.sender);
15554 16432                         ;
15555 16432       rl  w3  x2+a152   ;     message.no of bytes := 
15556 16434       al  w0  x3+2      ;     (last address - first address + 2)/2 * 3;
15557 16436       ws  w0  x2+a151   ;
15558 16438       ls  w0    -1      ;
15559 16440       wm  w0     g48    ;
15560 16442       rs  w0  x2+a152   ;
15561 16444                         ;
15562 16444       rl  w0  x2+a151   ;     message.first address := 
15563 16446       wa  w0  x1+a182   ;     message.first address + sender.base;
15564 16448       rs  w0  x2+a151   ;     <* physical address *>
15565 16450                         ;   end;
15566 16450                         ;
15567 16450  j4:                    ; branch:
15568 16450       zl  w0  x2+a150+0 ;   oper := message.operation;
15569 16452       sn  w0     5      ;   if oper = operator_output then
15570 16454       jl.        m41.   ;      goto   operator_output else
15571 16456       sn  w0     6      ;   if oper = create_link then
15572 16458       jl.        m42.   ;      goto   create_link else
15573 16460       sn  w0     9      ;   if oper = extract_statistics then
15574 16462       jl.        m9.    ;      goto   extract_statistics else
15575 16464       sn  w0     12     ;   if oper = set_mask then
15576 16466       jl.        m12.   ;      goto   set_mask else
15577 16468       sn  w0     22     ;   if oper = initialize_controller then
15578 16470       jl.        m22.   ;      goto   initialize_controller else
15579 16472       sn  w0     24     ;   if oper = close_system then
15580 16474       jl.        m43.   ;      goto   close_system else
15581 16476       sn  w0     26     ;   if oper = reload_system then
15582 16478       jl.        m44.   ;      goto   reload_system
15583 16480       jl.        m45.   ;   else goto answer_attention;
15584 16482                         ;
15585 16482                         ;
15586 16482  i1:  0                 ; save w1 (sender)
15587 16484                         ;
15588 16484                         ; ssp legal operation mask (only operations < 24)
15589 16484                         ; ssp legal mode mask      (only operations < 24)
15590 16484  
15590 16484      a0>5 + a0>6 + a0>9 + a0>12 + a0>22
15591 16486  i2: a0>0 + a0>1
15592 16488  
15592 16488  e.                     ; end   *** message received ***;
15593 16488  \f


15593 16488  
15593 16488  ; operator_output
15594 16488  ; ---------------------------------------------------------------------------
15595 16488  ;
15596 16488  ;   message:
15597 16488  ;
15598 16488  ;  + 0: 5<12 + 0
15599 16488  ;  + 2: first address
15600 16488  ;  + 4: last address (byte count when sent to controller)
15601 16488  ;
15602 16488  
15602 16488  m41:                   ; operator_output:
15603 16488                         ; begin
15604 16488       al  w0     0      ;   force := no;
15605 16490       jl.        n0.    ;   start_controller(force);
15606 16492                         ; end;
15607 16492  
15607 16492  ; close_system
15608 16492  ; reload_system
15609 16492  ; ---------------------------------------------------------------------------
15610 16492  ; nothing to check - nothing to do here!
15611 16492  
15611 16492  m43:                   ; close_system:
15612 16492  m44:                   ; reload_system:
15613 16492                         ; begin
15614 16492       al  w0     1      ;   force := yes;  <* just do it quickly *>
15615 16494       jl.        n0.    ;   start_controller)force);
15616 16496                         ; end;
15617 16496  
15617 16496  ; answer_attention
15618 16496  ; -------------------------------------------------------------------------
15619 16496  ; nothing to check - nothing to do here!
15620 16496  
15620 16496  m45:                   ; answer_attention:
15621 16496                         ; begin
15622 16496       al  w0     0      ;   force := no;
15623 16498       jl.        n0.    ;   start_controller(force);
15624 16500                         ; end;
15625 16500  \f


15625 16500  
15625 16500  ; create link (SSP)
15626 16500  ; -------------------------------------------------------------------------
15627 16500  ; 
15628 16500  ; if the specified rc8000 device number is -1 a free subprocess is
15629 16500  ; selected (and the device no will be placed in word +6 of the message).
15630 16500  ; the subprocess is (partly) initialized and the state of the subprocess
15631 16500  ; is set to 'during connect'.
15632 16500  ; the rest of the process is initialized when the maindriver receives
15633 16500  ; a create link answer operation from the controller.
15634 16500  ;
15635 16500  ;       message (sender/setup format)    answer
15636 16500  ;       -----------------------------    ----------
15637 16500  ;  + 0: 6<12 + mode                      status
15638 16500  ;  + 2: device type (1 or 7)             RC8000 device number
15639 16500  ;  + 4: -
15640 16500  ;  + 6: RC8000 device no/-1 (**)
15641 16500  ;
15642 16500  ; mode: 0: include sender as user of link
15643 16500  ;       1: include users of main as users of link
15644 16500  ;
15645 16500  ; device type: 1 : console
15646 16500  ;              7 : floppy disk
15647 16500  ;
15648 16500  ; (**) RC8000 process address inserted instead of device no in part 1.
15649 16500  ;
15650 16500  ; at entry 
15651 16500  ;
15652 16500  ;  w0  -
15653 16500  ;  w1  sender
15654 16500  ;  w2  message
15655 16500  ;  w3  -
15656 16500  ;
15657 16500  
15657 16500  b.  i10, j20  w.
15658 16500  
15658 16500  m42:                   ; create link   
15659 16500       rl  w1  x2+a153   ; begin
15660 16502       se  w1    -1      ; 
15661 16504       jl.        j3.    ;   if message.rc8000_device_no = -1 then
15662 16506                         ;   begin
15663 16506       rl  w1     b4     ;     for proc := first external, next until last external do
15664 16508  j1:  rl  w3  x1        ;     begin
15665 16510       rl  w0  x3+a10    ;
15666 16512       sn  w0     q68    ;       if proc.kind = free subprocess then
15667 16514       jl.        j4.    ;         goto out;
15668 16516                         ;     end;       
15669 16516  j2:  al  w1  x1+2      ;
15670 16518       se  w1    (b5)    ;
15671 16520       jl.        j1.    ;     goto no_resources; 
15672 16522       jl.        j20.   ;   end
15673 16524                         ;   else
15674 16524  j3:  ls  w1    +1      ;   begin
15675 16526       wa  w1     b4     ;
15676 16528       sl  w1    (b4)    ;     if not message.rc8000_device_no within external then
15677 16530       sl  w1    (b5)    ;        deliver_result(3);
15678 16532       jl         g5     ;
15679 16534       rl  w3  x1        ;     proc := nametable(rc8000 device no);
15680 16536       rl  w0  x3+a10    ;     if proc.kind <> free subprocess then
15681 16538       se  w0     q68    ;        goto no_resources;
15682 16540       jl.        j20.   ;
15683 16542                         ;   end;
15684 16542  j4:                    ; out:
15685 16542       rl  w1  x2+a151   ;
15686 16544       se  w1     1      ;   if message.device_type <> 1 and
15687 16546       sn  w1     10     ;      message.device_type <> 9 then
15688 16548       sz                ;      deliver_result(3);
15689 16550       jl         g5     ;
15690 16552                         ;
15691 16552       al  w0     9      ;   kind := if message.device_type = terminal then 9
15692 16554       se  w1     1      ;           else 28;
15693 16556       al  w0     28     ;
15694 16558                         ;
15695 16558       rl  w1  x2+a142   ;   if message.regrettet then
15696 16560       sh  w1     0      ;     deliver_result(dummy);
15697 16562       jl         g7     ;
15698 16564       zl  w1  x2+a150+1 ;   if message.mode <> 0 or 1 then
15699 16566       sz  w1    -2      ;      deliver_result(3);
15700 16568       jl         g5     ;
15701 16570                         ;
15702 16570                         ;   <*  init process  *>
15703 16570       rs  w0  x3+a10    ;   proc.kind := kind;
15704 16572       ld  w2    -48     ;
15705 16574       ds  w2  x3+a71    ;   <* clear proc a70 - a87 *>
15706 16576       ds  w2  x3+a73    ;
15707 16578       ds  w2  x3+a75    ;
15708 16580       ds  w2  x3+a87    ;
15709 16582                         ;
15710 16582       rl  w2     b19    ;   proc.main := this main;
15711 16584       rs  w2  x3+a50    ;
15712 16586       al  w1    2.000001;   proc.state := during_connect;
15713 16588       hs  w1  x3+a78+1  ;
15714 16590       rs  w3  x3+a77    ;   proc.proc_id := proc;
15715 16592       am        (b18)   ;
15716 16594       rs  w3    +a153   ;   message.8000_process := proc;
15717 16596                         ;
15718 16596       al  w2  x3        ;
15719 16598       am        (b18)   ;   if message.mode = 0 then
15720 16600       zl  w0    +a150+1 ;      include_user(message.sender, proc)
15721 16602       se  w0     0      ;   else
15722 16604       jl.        j10.   ;      include_all_users(main, proc);
15723 16606       am        (b18)   ;
15724 16608       rl  w1    +a142   ;
15725 16610       sh  w1     0      ;
15726 16612       ac  w1  x1        ;
15727 16614       jl  w3     d126   ;
15728 16616       al  w0     0      ;   force := no;
15729 16618       jl.        n0.    ;
15730 16620  j10:                   ;
15731 16620       rl  w1     b19    ;
15732 16622       jl. w3     n3.    ;
15733 16624       al  w0     0      ;   force := no;
15734 16626       jl.        n0.    ;   start_controller(force);
15735 16628                         ;   <* never reached *>
15736 16628                         ;
15737 16628  j20:                   ; no_resources:
15738 16628       al  w0   8.1400   ;   status := no_resources;
15739 16630       rs  w0     g20    ;
15740 16632       jl         g7     ;   deliver_result(1);
15741 16634                         ;
15742 16634  e.                     ; end;
15743 16634  ; ***** stepping stones *****
15744 16634  
15744 16634  n100: n0               ;
15745 16636  n103: n3               ;
15746 16638  n104: n4               ;
15747 16640  n105: n5               ;
15748 16642  n109: n9               ;
15749 16644  n112: n12              ;
15750 16646  n114: n14
15751 16648  jl.  (+2),  d156 ,  d156 = k - 4
15752 16652  
15752 16652  \f


15752 16652  
15752 16652  ; I N T E R R U P T   R E C E I V E D   F R O M   C O N T R O L L E R .
15753 16652  ; ---------------------------------------------------------------------
15754 16652  ;
15755 16652  ; all interrupts except 'answer device operation' are delivered
15756 16652  ; as interrupts to the mainprocess in question.
15757 16652  ; when an interrupt is received the communication area from the controller
15758 16652  ; to rc8000 has not been released yet.
15759 16652  
15759 16652  b. i10, j10, o121 w.
15760 16652  
15760 16652  
15760 16652  c36:                      ; interrupt received
15761 16652       rl  w1     b19       ; begin
15762 16654       rl  w2  x1+a501      ;
15763 16656       rs  w2     b18       ;   <*  w1 = main,   w2 = message (if any) *>
15764 16658       rl  w0  x1+a244      ;
15765 16660       sn  w0     3         ;   if timeout_interrupt then goto timeout
15766 16662       jl.        o3.       ;   
15767 16664       se  w0     0         ;   if NOT ok_interrupt then
15768 16666       jl.        o2.       ;      goto power_interrupt;
15769 16668                            ;  else begin <*normal io result*>
15770 16668       rl  w3     b218      ;   <* left 8 bits *>
15771 16670       la  w3  x1+a500      ;
15772 16672       ls  w3    -3-12      ;
15773 16674       sl  w3    13*2*2     ;   if main.function >12 then
15774 16676       jl        -1         ;      panic;
15775 16678       jl.    (x3+j0.)      ;   goto case main.function of
15776 16680                            ;
15777 16680                            ;   <* w1: main, w2: message (if any) *>
15778 16680                            ; func, answ
15779 16680                            ; - - - - - -
15780 16680  j0:            -1         ;   0    0  : panic
15781 16682                 -1         ;   0    1  : panic
15782 16684                 -1         ;   1    0  : panic 
15783 16686                 -1         ;   1    1  : panic, answer device operation, catched
15784 16688       o20                  ;   2    0  : create link
15785 16690       o21                  ;   2    1  : answer create link
15786 16692                 -1         ;   3    0  : panic
15787 16694       o31                  ;   3    1  : answer remove link
15788 16696       o40                  ;   4    0  : attention
15789 16698                 -1         ;   4    1  : panic
15790 16700                 -1         ;   5    0  : panic
15791 16702        o1                  ;   5    1  : answer regret: start controller
15792 16704                 -1         ;   6    0  : panic
15793 16706        o1                  ;   6    1  : answer reserve device: start controller
15794 16708                 -1         ;   7    0  : panic
15795 16710        o1                  ;   7    1  : answer release device: start controller
15796 16712       o80                  ;   8    0  : remove link request
15797 16714                 -1         ;   8    1  : panic
15798 16716                 -1         ;   9    0  : panic
15799 16718       o91                  ;   9    1  : answer initialize controller
15800 16720                 -1         ;  10    0  : panic
15801 16722                 -1         ;  10    1  : panic
15802 16724                 -1         ;  11    0  : panic
15803 16726       o111                 ;  11    1  : answer reset
15804 16728                 -1         ;  12    0  : panic
15805 16730       o121                 ;  12    1  : answer stop normal communication
15806 16732  \f


15806 16732  
15806 16732  b.  i10,  j10   w.        ; - - - data - - - 
15807 16732  
15807 16732  i0:  -1 < 12 + 0          ; mess_0: operation (= answer_create_link)
15808 16734  i1:  0                    ;     +2: reserved, result 
15809 16736  i2:  0                    ;     +4: device_id
15810 16738  i3:  0                    ;     +6: proc_id
15811 16740  i4:  0, 0, 0, 0           ; +8-+14: name of reserver (if any)
15812 16748  
15812 16748  i8:  32000                ; max transfer size
15813 16750  
15813 16750  o20:                      ; create link
15814 16750                            ; --------------------
15815 16750                            ; begin
15816 16750       rl  w0  x1+a502      ;
15817 16752       rs. w0     i2.       ;   mess_2 := main.device_id;    
15818 16754       al  w2  x1+a514      ;
15819 16756       jl  w3     d11       ;   check_name,(driverproc,name_address);
15820 16758       sz                   ; not found goto search free sub process
15821 16760       jl.        j0.       ; found goto set result 9;
15822 16762       rl  w3     b5        ;   proc := last_external;
15823 16764  j1:  al  w3  x3-2         ;   while proc.kind <> free and
15824 16766       rl  w2  x3           ;         proc <> first_external 
15825 16768       rl  w0  x2+a10       ;   begin
15826 16770       sn  w0     q68       ;     proc := nametable(prev);
15827 16772       jl.        j2.       ;
15828 16774       se  w3    (b4)       ;
15829 16776       jl.        j1.       ;   end;
15830 16778                            ;
15831 16778                            ;
15832 16778       am         8-9       ;   if proc = first_external 
15833 16780  j0:  al  w0     9         ;      or name already exist then
15834 16782       rs. w0     i1.       ;   begin
15835 16784       jl.        j9.       ;     result := no_resources/already exist;
15836 16786                            ;     goto answer_controller;
15837 16786                            ;   end;
15838 16786  j2:                       ;
15839 16786       al  w0     1         ;
15840 16788       rs. w0     i1.       ;   reserved := 0; result := ok;
15841 16790       rs. w2     i3.       ;   mess_3 := proc;
15842 16792       ld  w0    -48        ;
15843 16794       ds  w0  x2+a71       ;   <* clear proc a70 - a87 *>
15844 16796       ds  w0  x2+a73       ;
15845 16798       ds  w0  x2+a75       ;
15846 16800       ds  w0  x2+a87       ;
15847 16802       al  w3  x2+a81       ;   <* init process queues *>
15848 16804       al  w0  x3           ;
15849 16806       ds  w0  x2+a81+2     ;
15850 16808       al  w3  x2+a54       ;
15851 16810       al  w0  x3           ;
15852 16812       ds  w0  x2+a54+2     ;
15853 16814       rs  w1  x2+a50       ;   proc.main := this main;
15854 16816       rl  w1     (b6)      ;
15855 16818       jl  w3     d126      ;   insert_user(proc,proc_func);
15856 16820       rl  w1  x2+a50       ;
15857 16822       al  w0     l37       ;
15858 16824       rs  w0  x2+a78       ;   proc.state := during_connect;
15859 16826       al  w0     q8        ;
15860 16828       rs  w0  x2+a10       ;   proc.kind := terminal;
15861 16830       rl  w0  x1+a502      ;
15862 16832       rs  w0  x2+a76       ;   proc.device_index := main.device_id;
15863 16834       rs  w2  x2+a77       ;   proc.process_address := proc;
15864 16836       rl. w3     i8.;x1+a513;
15865 16838       rs  w3  x2+a87       ;   proc.buffer_size := main.mess_3;
15866 16840       al  w3  x3+1         ;
15867 16842       rs  w3  x2+a86       ;   proc.max_transfer := buffer_size + 1;
15868 16844       dl  w0  x1+a514+2    ;
15869 16846       ds  w0  x2+a11+2     ;   proc.name := main.mess_4 - mess_7;
15870 16848       dl  w0  x1+a514+6    ;
15871 16850       ds  w0  x2+a11+6     ;
15872 16852       am         (b21)     ;   proc.name_base := driverproc.base (i.e. max)
15873 16854       dl  w0     +a49      ;
15874 16856       ds  w0  x2+a49       ;
15875 16858       al  w0     1<0       ;   type := connected;
15876 16860       jl. w3     (n112.)   ;   check_remoter(type, main, proc);
15877 16862                            ;   <* w3 retur: 0 or internal_supervisor *>
15878 16862       sn  w3     0         ;   if internal_supervisor then
15879 16864       jl.        j4.       ;   begin
15880 16866       al  w2  x3           ;
15881 16868       dl  w0  x2+a11+2     ;
15882 16870       ds. w0     i4.+2     ;     mess_4 - mess_7 := internal_supervisor.name;
15883 16872       dl  w0  x2+a11+6     ;
15884 16874       ds. w0     i4.+6     ;
15885 16876       am.       (i3.)      ;
15886 16878       rs  w2    +a74       ;     proc.att_receiver := internal_supervisor;
15887 16880       al  w2     1         ;     mess_1.reserver := 1;
15888 16882       hs. w2     i1.+0     ;   end;
15889 16884  j4:                       ;
15890 16884  j9:                       ; answer_controller:
15891 16884       al. w2     i0.       ;
15892 16886       jl. w3     n13.      ;   send_main_message(main, message);
15893 16888                            ;
15894 16888       jl.        o1.       ;   goto common_end;
15895 16890                            ;
15896 16890  e.                        ; end <* ----- end create link ----- *>
15897 16890  \f


15897 16890  
15897 16890  b.   i10, j20   w.              ; - - - data - - - 
15898 16890  i0:  32000                     ; default ifp buffersize
15899 16892  i2:  0                         ; saved message
15900 16894  i4:                            ; result : comment
15901 16894  ;    ccccccccddssssss........  ; c=connect_result, d=description, s=dev_status
15902 16894     2.000000000000010000000000  ;    8   : no resources
15903 16896     2.000000000000010100000000  ;    9   : link already exist
15904 16898     2.100000000000000100000000  ;   10   : ill kind (should not come ?)
15905 16900     2.001000000000000100000000  ;   11   : controller unknown
15906 16902     2.100000000000000100000000  ;   12   : device unknown
15907 16904     2.000100000000000100000000  ;   13   : controller fault
15908 16906     2.000100000000000100000000  ;   14   : device fault
15909 16908  
15909 16908                            ;
15910 16908  o21:                      ; answer create link
15911 16908                            ; --------------------
15912 16908                            ; begin
15913 16908       al  w0     8.377     ;   if main.result = ok then
15914 16910       la  w0  x1+a500      ;   begin
15915 16912       se  w0     1         ;
15916 16914       jl.        j8.       ;
15917 16916                            ;
15918 16916       rl  w3  x1+a503      ;     proc := main.proc_id;
15919 16918       rl  w0  x3+a10       ;
15920 16920       se  w0     q6        ;     if proc.kind = disk then 
15921 16922       jl.        j2.       ;     begin
15922 16924                            ;
15923 16924       rl  w0  x1+a520+a154 ;       proc.no_of_segments :=
15924 16926       rs  w0  x3+a74       ;       message.device_capacity :=
15925 16928       rs  w0  x2+a154      ;       main.mess_4;
15926 16930                            ;
15927 16930       sn  w0     0         ;       if proc.no_of_segments > 0 then
15928 16932       jl.        j1.       ;       begin
15929 16934       rs. w2     i2.       ;
15930 16936       al  w2  x3           ; 
15931 16938       al  w3     0         ;         proc.segments_pr_track :=
15932 16940       rl  w0  x1+a520+a156 ;         main.mess_6 / bytes_pr_segment;
15933 16942       wd  w0     b222      ;
15934 16944       rs  w0  x2+a75       ;
15935 16946                            ;
15936 16946       al  w3     0         ;         proc.buffer_size :=
15937 16948       rl  w0  x1+a520+a155 ;         main.mess_5 / bytes_pr_segment;
15938 16950       wd  w0     b222      ;
15939 16952       rs  w0  x2+a87       ;
15940 16954                            ;         <* make max transfer a multiple
15941 16954       al  w3     0         ;            of track size *>
15942 16956       wd  w0  x2+a75       ;         proc.max_transfer :=
15943 16958       wm  w0  x2+a75       ;         proc.buffer_size / proc.segments_pr_track *
15944 16960                            ;                            proc.segments_pr_track;
15945 16960       sn  w0     0         ;         if proc.max_transfer = 0 then
15946 16962       rl  w0  x2+a87       ;         proc.max_transfer := proc.buffer_size;
15947 16964       rs  w0  x2+a86       ;         <* in case where buffersize < tracksize *>
15948 16966                            ;
15949 16966       al  w3  x2           ;
15950 16968       jl.        j6.       ;       end
15951 16970  j1:                       ;       else
15952 16970                            ;       begin
15953 16970                            ;         <* drive has not been formated *>
15954 16970                            ;         <* io requests will be rejected due to  
15955 16970                            ;            disk.no_of_segments *>
15956 16970                            ;       end;
15957 16970       jl.        j6.       ;     end
15958 16972  j2:                       ;     else
15959 16972       se  w0     q18       ;     if proc.kind = tape then
15960 16974       jl.        j3.       ;     begin
15961 16976                            ;
15962 16976       rl  w0  x1+a520+a155 ;       proc.buffer_size := main.mess_5;
15963 16978       rs  w0  x3+a87       ;       proc.max_transfer := main.mess_5 + 1;
15964 16980       ba. w0     1         ;
15965 16982       rs  w0  x3+a86       ;
15966 16984                            ;
15967 16984       rl  w0    (b3)       ;       proc.remoter_process :=
15968 16986       rs  w0  x3+a75       ;       nametabel(1);
15969 16988                            ;
15970 16988       al  w0     3         ;       proc.document_state :=
15971 16990       la  w0  x1+a520+a157 ;
15972 16992       rs  w0  x3+a70       ;       returned_state;
15973 16994       jl.        j6.       ;     end
15974 16996  j3:                       ;     else
15975 16996       sn  w0     q28       ;     if proc.kind = gsd or
15976 16998       jl.        j4.       ;        proc.kind = printer or
15977 17000       sn  w0     q14       ;        proc.kind = terminal or
15978 17002       jl.        j4.       ;        proc.kind = ssp terminal then
15979 17004       sn  w0     q8        ;
15980 17006       jl.        j4.       ;
15981 17008       se  w0     q9        ;
15982 17010       jl        -1         ;     begin
15983 17012  j4:                       ;
15984 17012       rl. w0     i0.       ;       proc.buffer_size := standard size 
15985 17014       rs  w0  x3+a87       ;
15986 17016       ba. w0     1         ;       proc.max_transfer := standard size;
15987 17018       rs  w0  x3+a86       ;
15988 17020  ;    jl.        j6.       ;     end
15989 17020                            ;     else panic;
15990 17020  j6:                       ;
15991 17020       rl  w0  x1+a502      ;     proc.device_id := 
15992 17022       rs  w0  x3+a76       ;     main.device_id;
15993 17024       ac  w0     2.000111+1;
15994 17026       la  w0  x3+a78       ;
15995 17028       al  w2     l38       ;     proc.state := 
15996 17030       lo  w0     4         ;     proc.state or connected;
15997 17032       hs  w0  x3+a78+1     ;
15998 17034                            ;     <* prepare answer *>
15999 17034       al  w0     0         ;
16000 17036       rs  w0     g20       ;     answer_0 := ok; <* status *>
16001 17038       rl  w0  x3+a59       ;
16002 17040       rs  w0     g21       ;     answer_1 := proc.devno;
16003 17042       rl  w0  x1+a502      ; 
16004 17044       rs  w0     g22       ;     answer_2 := main.device_id;
16005 17046       am        (b18)      ;
16006 17048       rl  w0    +a154      ;     answer_3 := message.device_kind,device_modif;
16007 17050       rs  w0     g23       ;
16008 17052       rl  w0  x1+a514      ;     answer_4 := main.mess_4; <*device capacity *>
16009 17054       rs  w0     g24       ;
16010 17056       al. w3     o1.       ;
16011 17058       jl         g18       ;     deliver_result(1);
16012 17060                            ;     goto common_end;
16013 17060                            ;   end
16014 17060  j8:                       ;   else
16015 17060       rl  w2  x1+a503      ;   begin
16016 17062       jl. w3     n2.       ;     clear_process(main.proc_id);
16017 17064       jl. w3     n8.       ;     free_process(main.proc_id);
16018 17066                            ;
16019 17066       al. w3     o1.       ;     if main.result < 5 then
16020 17068       sh  w0     5         ;     begin
16021 17070       jl         g19       ;       deliver_result(main.result);
16022 17072                            ;       goto common_end;
16023 17072                            ;     end;
16024 17072       rl  w2     0         ;
16025 17074       al  w2  x2-8         ;
16026 17076       ls  w2     1         ;
16027 17078       rl. w0  x2+i4.       ;
16028 17080       rs  w0     g20       ;     answer_0 := status_table(main.result);
16029 17082       jl         g18       ;     deliver_result(1);
16030 17084                            ;     goto common_end;
16031 17084                            ;   end;
16032 17084  e.                        ; end;
16033 17084  \f


16033 17084  
16033 17084  b.   i10,  j10   w.       ; 
16034 17084  
16034 17084  o31:                      ; answer remove link
16035 17084                            ; --------------------
16036 17084                            ; begin
16037 17084       al  w0     8.377     ;   if main.result <> ok then
16038 17086       la  w0  x1+a500      ;      panic;
16039 17088       se  w0     1         ;
16040 17090       jl        -1         ;
16041 17092                            ;
16042 17092       rl  w2  x1+a503      ;   proc := main.proc_id;
16043 17094       rl  w0  x2+a10       ;
16044 17096       sn  w0     q8        ;   if proc.kind = terminal then
16045 17098       jl. w3     n7.       ;      remove_attention_buffer(proc);
16046 17100                            ;
16047 17100       jl. w3     n8.       ;   free_process(proc);
16048 17102                            ;
16049 17102       al  w2  x2+a54       ;   clear_queue(normal, proc.event_q);
16050 17104       al  w0     0         ;
16051 17106       jl. w3     n1.       ;
16052 17108                            ;
16053 17108       rs  w0     g20       ;   answer_0 := 0; <* status *>
16054 17110       jl  w3     g18       ;   deliver_result(1);
16055 17112                            ;
16056 17112       jl.        o1.       ;   goto common_end;
16057 17114                            ;
16058 17114  e.                        ; end;
16059 17114  
16059 17114  \f


16059 17114  
16059 17114  b.   i10,  j25  w.        ; - - - data - - -
16060 17114  
16060 17114                            ; ------ message ------
16061 17114  i0:  -3<12 + 0            ; + 0: operation (= answer attention)
16062 17116  i1:  0                    ; + 2: att_result, result
16063 17118  i2:  0                    ; + 4: device_id
16064 17120  i3:  0                    ; + 6: proc_id
16065 17122  i5:  0                    ; internal receiver of att_message
16066 17124  i6:  0                    ; remoter event_q
16067 17126  i7:  0                    ; remoter message
16068 17128                            ;
16069 17128  o40:                      ; attention
16070 17128                            ; --------------------
16071 17128                            ; begin
16072 17128                            ;   <* prepare answer attention message *>
16073 17128       dl  w3  x1+a503      ;   mess_2 := main.device_id;
16074 17130       ds. w3     i3.       ;   mess_3 := main.proc_id;
16075 17132       al  w0     1         ;   mess_1.att_result := ok; mess_1.result := ok;
16076 17134       rs. w0     i1.       ;   <* initialized to ok; might be changed later on *>
16077 17136                            ;
16078 17136       al  w2  x3           ;   proc := main.proc_id;
16079 17138       rl  w0  x2+a10       ;   if proc.kind = disk then
16080 17140       se  w0     q6        ;   begin
16081 17142       jl.        j5.       ;
16082 17144                            ;
16083 17144       al  w0     8.377     ;
16084 17146       la  w0  x1+a511      ;     event := main.mess_1;
16085 17148       se  w0     1         ;     if event = intervention then
16086 17150       jl.       j4.        ;     begin
16087 17152                            ;
16088 17152       al  w0     l40       ;       proc := proc.next_logical_disk;
16089 17154  j2:  rl  w2  x2+a70       ;       while proc <> 0 do
16090 17156       sn  w2     0         ;       begin
16091 17158       jl.        j3.       ;         proc.state := intervention;
16092 17160       hs  w0  x2+a78+1     ;         proc := proc.next_logical_disk;
16093 17162       jl.        j2.       ;       end;
16094 17164  j3:  jl.        j20.      ;
16095 17166  j4:  sl  w0     1         ;     end else 
16096 17168       sl  w0     4         ;     if envent <> test buffer full and event <> data correction performed then
16097 17170       jl         -1        ;     panic
16098 17172       jl.        j20.      ;   end
16099 17174  j5:                       ;   else
16100 17174       se  w0     q18       ;   if proc.kind = tape then
16101 17176       jl.        j15.      ;   begin
16102 17178                            ;
16103 17178       al  w0     8.377     ;
16104 17180       la  w0  x1+a511      ;     event := main.mess_1;
16105 17182       se  w0     0         ;     if event = online then
16106 17184       jl.        j10.      ;     begin
16107 17186                            ;
16108 17186       al  w0     l46       ;       proc.document_state :=
16109 17188       rs  w0  x2+a70       ;            unidentified_document_mounted;
16110 17190       al  w0     0         ;       proc.name := 0;
16111 17192       rs  w0  x2+a11       ;
16112 17194       rs  w0  x2+a52       ;       proc.reserver := 0;
16113 17196                            ;
16114 17196       rl  w3  x2+a75       ;       if proc.remoter<>0 then
16115 17198       sn  w3     0         ;       begin
16116 17200       jl.        j9.       ;
16117 17202       al  w1  x3+a54       ;         message:=proc.remoter.eventq.first;
16118 17204       rl  w3  x1           ;
16119 17206       rs. w1     i6.       ;
16120 17208       rs. w3     i7.       ;
16121 17210  j6:  sn. w3    (i6.)      ;         while message<>none do
16122 17212       jl.        j9.       ;         begin
16123 17214       rl  w0  x3+a140      ; 
16124 17216       rs. w0     i7.       ;           if message.operation=wait for online and
16125 17218       zl  w0  x3+a150      ;            ((message.mode=specific main and
16126 17220       se  w0     0         ;              message.main=this main) or
16127 17222       jl.        j8.       ;              message.mode=all main) then
16128 17224       zl  w0  x3+a150+1    ;           begin
16129 17226       so  w0     2.1       ;
16130 17228       jl.        j7.       ;
16131 17230       rl  w0  x3+a151      ;
16132 17232       se  w0    (b19)      ;
16133 17234       jl.        j8.       ;
16134 17236  j7:  rs  w3     b18       ;             message.status:=0;
16135 17238       al  w0     0         ;             message.mt-addr:=proc;
16136 17240       rs  w0     g20       ;
16137 17242       rs  w2     g21       ;
16138 17244       jl  w3     g18       ;             deliver_result(1);
16139 17246  j8:  rl. w2     i2.       ;           end;
16140 17248       rl. w3     i7.       ;           message:=message.next;
16141 17250       jl.        j6.       ;         end ;
16142 17252  j9:                       ;       end;
16143 17252       jl.        j11.      ;     end 
16144 17254                            ;     else
16145 17254  j10: se  w0     1         ;     if event = offline then
16146 17256       jl        -1         ;     begin
16147 17258       al  w0     l45       ;       proc.document state := no document mounted;
16148 17260       rs  w0  x2+a70       ;
16149 17262       al  w0     0         ;       proc.name := 0  ;
16150 17264       rs  w0  x2+a11       ;
16151 17266       rs  w0  x2+a52       ;       proc.reserver := 0;
16152 17268                            ;     end
16153 17268                            ;     else panic; <* not defined *>;
16154 17268  j11:                      ;
16155 17268       jl.        j20.      ;   end
16156 17270  j15:                      ;   else
16157 17270       se  w0     q8        ;   if proc.kind = terminal or
16158 17272       sn  w0     q9        ;      proc.kind = ssp terminal then
16159 17274       sz                   ;
16160 17276       jl.        j21.      ;   begin
16161 17278                            ;
16162 17278       rl  w0  x2+a52       ;     if terminal.reserver <> 0 then
16163 17280       sn  w0     0         ;     begin
16164 17282       jl.        j16.      ;
16165 17284       rl  w0  x2+a71       ;       if terminal.attention_buffer_address <> 0 then
16166 17286       se  w0     0         ;       goto skip_att_message; <* att already sent to
16167 17288       jl.        j19.      ;                               reserving internal *>
16168 17290       rl  w2  x2+a74       ;       att_receiver := terminal.att_receiver;
16169 17292       jl.        j18.      ;     end
16170 17294  j16:                      ;     else
16171 17294       al  w2  x1+a514      ;     begin
16172 17296       rl. w1     i3.       ;
16173 17298       dl  w1  x1+a49       ;   
16174 17300       jl  w3     d71       ;       i := search_name(main.mess_4, terminal.name_base);
16175 17302       rl  w2  x3           ;       att_receiver := name_table(i);
16176 17304       rl  w0  x2+a10       ;       if i = name_table_end or
16177 17306       se  w3    (b7)       ;          att_receiver.kind <> internal and
16178 17308       sz  w0    -1-64      ;          att_receiver.kind <> pseudo_process then
16179 17310       sz                   ;       begin
16180 17312       jl.        j18.      ;  
16181 17314       al  w0     1         ;         mess_1.att_result := unknown;
16182 17316       hs. w0     i1.+0     ;         goto skip_att_message;
16183 17318       jl.        j19.      ;
16184 17320                            ;       end;
16185 17320                            ;     end;
16186 17320  j18:                      ;
16187 17320       rs. w2     i5.       ;     <* save att_receiver *>
16188 17322       rl. w1     i3.       ;
16189 17324       al  w2     0         ;     if terminal.attention_buffer <> 0 then
16190 17326       rx  w2  x1+a71       ;     regret_message(terminal.attention_buffer);
16191 17328       se  w2     0         ;
16192 17330       jl  w3     d75       ; 
16193 17332       am         (b21)     ;
16194 17334       zl  w0     +a19      ;
16195 17336       sh  w0     5         ;     if bufferclaim.driverproc < 6 then
16196 17338       jl.        j19.      ;       no message to receiver
16197 17340       rl. w1     i5.       ;
16198 17342       rl  w0  x1+a10       ;     if att_receiver.kind = pseudo_process then
16199 17344       se  w0     0         ;     att_receiver := att_receiver.main;
16200 17346       rl  w1  x1+a50       ;
16201 17348       rl. w2     i3.       ; 
16202 17350       jl  w3     d126      ;     insert_user(att_receiver, terminal);
16203 17352       rl  w1     b19       ;
16204 17354       rl  w0  x1+a511      ;  
16205 17356       rs  w0     g21       ;     att_mess_1 := main.event; <*returned messages *>
16206 17358                            ;
16207 17358       ld  w0    -48        ;     <* clear att message *>
16208 17360       rs  w0     g20       ;
16209 17362       ds  w0     g23       ;
16210 17364       al  w1     g20       ;
16211 17366       rl. w3     i5.       ;   
16212 17368       jd      1<11+17      ;     send_att_message(message, terminal, att_receiver);
16213 17370       rl. w1     i3.       ;
16214 17372       rs  w2  x1+a71       ;     terminal.attention_buffer := message_buffer;
16215 17374                            ;
16216 17374  j19:                      ; skip_att_message:
16217 17374                            ;
16218 17374       jl.        j20.      ;   end
16219 17376                            ;   else panic;
16220 17376  
16220 17376  j21: se  w0     q24       ;   if proc_kind = ssp main then
16221 17378       jl         -1        ;   begin
16222 17380       rl  w0  x1+a511      ;
16223 17382       se  w0     1         ;     if event<>temperatur_too_high and
16224 17384       sn  w0     2         ;        event<>power_warning then
16225 17386       jl         -1        ;     panic;
16226 17388       jl.        j20.      ;     <* do nothing yet *>
16227 17390                            ;   end;
16228 17390                            ;
16229 17390  j20:                      ;
16230 17390       rl  w1     b19       ;
16231 17392       al. w2     i0.       ;
16232 17394       jl. w3     n13.      ;   send_main_message(main, message);
16233 17396       jl.        o1.       ;   goto common_end;
16234 17398                            ;
16235 17398  e.                        ; end;
16236 17398  
16236 17398  \f


16236 17398  
16236 17398  b.  i10, j10    w.        ; - - - data - - - 
16237 17398                            ;             --------- message ---------
16238 17398                            ;       answer_remove_link_request   remove_link
16239 17398  i4:  0                    ; + 0:  -2 < 12 + 0                  10 < 12 + 0
16240 17400  i5:  0                    ; + 2:  result                       proc.devno
16241 17402  i6:  0                    ; + 4:  device_id                    proc address
16242 17404  i7:  0                    ; + 6:  proc_id (address)
16243 17406                            ;
16244 17406  o80:                      ; remove link request:
16245 17406                            ; --------------------
16246 17406                            ; begin
16247 17406       dl  w3  x1+a503      ;   mess_2 := main.device_id;
16248 17408       ds. w3     i7.       ;   mess_3 := proc := main.proc_id; 
16249 17410       al  w0     2.000111  ;
16250 17412       la  w0  x3+a78       ;
16251 17414       sn  w1 (x3+a50)      ;   mess_1 := <* result *>
16252 17416       se  w0     l38       ;   if proc.main <> main or
16253 17418       am         2         ;      proc.state <> connected then
16254 17420       al  w0     1         ;   3 else 1;
16255 17422       rs. w0     i5.       ;
16256 17424       al  w0    -2         ;   mess_0.operations := -2;
16257 17426       hs. w0     i4.+0     ;   <* answer remove link request *>
16258 17428                            ;
16259 17428       al. w2     i4.       ;
16260 17430       jl. w3     n13.      ;   send_main_message(main, message);
16261 17432                            ;
16262 17432       rl. w0     i5.       ;   if message.result = ok <* mess_1 *>
16263 17434       se  w0     1         ;   begin
16264 17436       jl.        j1.       ;
16265 17438                            ;
16266 17438       rl  w1     b19       ;     <* main *>
16267 17440       rl  w3  x1+a503      ;     mess_1 := proc.device_no;
16268 17442       rl  w2  x3+a59       ;     mess_2 := proc;
16269 17444       ds. w3     i6.       ;
16270 17446       al  w0     10        ;     mess_0.operation := remove_link;
16271 17448       hs. w0     i4.+0     ;
16272 17450       al. w2     i4.       ;
16273 17452       jl. w3     n13.      ;     send_main_message(main, message);
16274 17454                            ;   end;
16275 17454  j1:                       ;
16276 17454       jl.        o1.       ;   goto common_end;
16277 17456                            ;
16278 17456  e.                        ; end <* ----- remove link request ----- *>
16279 17456  ;
16280 17456  ;
16281 17456  b. i10, j10 w.
16282 17456  o91:                      ; answer initialize controller;
16283 17456       al  w0     8.377     ; begin
16284 17458       la  w0  x1+a500      ;
16285 17460       se  w0     1         ;   if main.result <> ok then
16286 17462       jl         -1        ;     panic;
16287 17464       rl  w0  x1+a511      ;   main.free_buffers:=
16288 17466       hs  w0  x1+a78+0     ;   main.mess_1;
16289 17468       rl  w0  x1+a78       ;
16290 17470       ea. w0     1         ;   main.state:=connected;
16291 17472       hs  w0  x1+a78+1     ;   <* a bit diry - is was in state during connect *>
16292 17474       rl  w0  x1+a502      ;   main.supervisor_id:=
16293 17476       rs  w0  x1+a76       ;   main.device_id;
16294 17478       al  w0     0         ;
16295 17480       rs  w0     g20       ;   answer_0:=0; <* status *>
16296 17482       jl  w3     g18       ;   deleiver_result(1);
16297 17484       jl.        o1.       ;   goto common end;
16298 17486  e.                        ; end;
16299 17486  \f


16299 17486  b.  i10,  j10  w.
16300 17486  
16300 17486  i2:  0                    ; saved message to answer
16301 17488  
16301 17488  o111:                     ; answer reset and answer stop
16302 17488  o121:                     ; ---------------------
16303 17488       al  w0     8.377     ; begin
16304 17490       la  w0  x1+a500      ;
16305 17492       se  w0     1         ;   if main.result <> ok then
16306 17494       jl        -1         ;      panic;
16307 17496                            ;
16308 17496       jl  w3     d5        ;   unlink(message);
16309 17498       rs. w2     i2.       ;   <* unlink and save message to prevent it from
16310 17500                            ;      being returned with result 4 *>
16311 17500       jl. w3     n9.       ;   cleanup;
16312 17502       rl  w1     b19       ;
16313 17504       al  w0     3         ;   main.free_buffers := 3;
16314 17506       hs  w0  x1+a78+0     ;   <* give it a few buffers to play with *>
16315 17508       al  w0     0         ;   main.controller_stat := ok and not busy;
16316 17510       hs  w0  x1+a78+1     ;   main.connect_state := free;
16317 17512       rs  w0     g20       ;   answer.status := 0;
16318 17514       al  w0     1         ;
16319 17516       rs  w0  x1+a86       ;   main.no_of_outstanding := 1  <* it will be decreased at commen end *>
16320 17518       al  w2  x1+a242      ;   
16321 17520       se  w2     (x2)      ;   if in timeout queue then
16322 17522       jl  w3     d5        ;     unlink (main, timeout_queue)
16323 17524       rl  w0  x1+a511      ;
16324 17526       rs  w0     g21       ;   answer.mess_1 := main.mess_1;
16325 17528       rl. w0     i2.       ;
16326 17530       rs  w0     b18       ;
16327 17532       jl  w3     g18       ;   deliver_result(1);
16328 17534       jl.        o1.       ;   goto common_end;
16329 17536                            ; 
16330 17536  e.                        ; end;
16331 17536  \f


16331 17536  
16331 17536  ; timeout_interrupt      ;
16332 17536  b. i4 w.                 ;  <*** begin io result <> 0 ***>
16333 17536  
16333 17536  i1:  -4<12 + 0           ; stop
16334 17538  i2:   4<12 + 1           ; reset hard                                    
16335 17540  
16335 17540  o3:
16336 17540  c.l53  b.  f4  w.         ; ****** test 44 ******
16337 17540       rs. w3     f1.       ;
16338 17542       rs. w1     f0.       ;
16339 17544       jl. w3    (f3.)      ;
16340 17546       44                   ;
16341 17548  f0:  0                    ; main
16342 17550  f1:  0                    ;
16343 17552       jl.        f2.       ;
16344 17554       al  w0  x1+a86       ; dump main.communication area
16345 17556       al  w1  x1+a81+2     ;
16346 17558       jl. w3    (f4.)      ;
16347 17560       jl.        f2.       ;
16348 17562  f3:  d150                 ;
16349 17564  f4:  d151                 ;
16350 17566  f2:                       ;
16351 17566  e.z.                      ; ****** end test 44 ******
16352 17566       al  w0     0        ; clear interrupt
16353 17568       rs  w0  x1+a244     ;
16354 17570       zl  w0  x1+a78+1    ; if main.state = connected then
16355 17572       se  w0     l38      ; message := stop communication
16356 17574       am      i2-i1       ;  else
16357 17576       al. w2     i1.      ; message := reset hard
16358 17578       la  w0     8.40     ; state := not ok
16359 17580       hs  w0  x1+a78+1    ;
16360 17582       jl. w3     n13.     ;
16361 17584       jl.        o0.      ; return
16362 17586  
16362 17586  
16362 17586  o2:                       ; power_interrupt:
16363 17586  c.l53  b.  f4  w.         ; ****** test 43 ******
16364 17586       rs. w3     f1.       ;
16365 17588       rs. w1     f0.       ;
16366 17590       jl. w3    (f3.)      ;
16367 17592       43                   ;
16368 17594  f0:  0                    ; main
16369 17596  f1:  0                    ;
16370 17598       jl.        f2.       ;
16371 17600       al  w0  x1+a86       ; dump main.communication area
16372 17602       al  w1  x1+a81+2     ;
16373 17604       jl. w3    (f4.)      ;
16374 17606       jl.        f2.       ;
16375 17608  f3:  d150                 ;
16376 17610  f4:  d151                 ;
16377 17612  f2:                       ;
16378 17612  e.z.                      ; ****** end test 43 ******
16379 17612       al  w3    0          ; 
16380 17614       rs  w3  x1+a244      ; clear interrupt
16381 17616       rs  w3  x1+a78       ; main.free_buffers := 0; main.stat := free;
16382 17618       rl  w2  x1+a10       ; insert timeout depending of kind
16383 17620       ws. w2     i3.       ;
16384 17622       rl. w0  x2+i0.       ; main.timeout := default 
16385 17624       ds  w0  x1+a87       ; main.no_of_outstanding := 0
16386 17626       jl.       o0.        ; return;
16387 17628  
16387 17628  i0: 0                     ; default timeout: 20 ida 
16388 17630      0                     ;  - - - - - - - : 22 not used
16389 17632      0                     ;  - - - - - - - : 24 (not invented yet)
16390 17634      600000                ;  - - - - - - - : 26 ifp
16391 17636  i3: 20
16392 17638  
16392 17638  
16392 17638  o1:                       ; common_end:
16393 17638                            ; --------------------
16394 17638  
16394 17638       am        (b19)      ;
16395 17640       rl  w1    +a59       ;
16396 17642       al  w2    -1         ;
16397 17644       jd        1<11+128   ;   start_controller(this main.device_no, answer_device);
16398 17646  
16398 17646       rl  w1     b19       ;
16399 17648       rl  w0     b218      ;
16400 17650       la  w0  x1+a500      ;
16401 17652       ls  w0     -15       ;
16402 17654       jl. w3     d156.     ;   decrease no_of_outstanding(main,function);
16403 17656  
16403 17656       rl  w2  x1+a81       ;   element := main.waiting_q.first;
16404 17658       sn  w2  x1+a81       ;   if element = none then
16405 17660       jl.        o0.       ;      return;
16406 17662       al  w0     0         ;   force :=
16407 17664       sl  w2     (b8+4)    ;
16408 17666       sl  w2     (b8+6)    ;   if element <> message then no
16409 17668       jl.        i4.       ;
16410 17670       al  w0     2.1000000 ;   else message.state.force;
16411 17672       la  w0  x2+a138      ;
16412 17674       ls  w0     -6
16413 17676  i4:                       ;
16414 17676       rl  w1     x1+a59    ;
16415 17678       jd         1<11+128  ;   start_controller(this main.device_no, message);
16416 17680                            ; end;
16417 17680  o0:  jl         (b20)     ;   goto driverproc.wait_event;
16418 17682  
16418 17682  e.                        ;   end <*** io result <> 0 **>
16419 17682  e.                        ; end <*** interrupt received ***>
16420 17682  
16420 17682  
16420 17682  
16420 17682  
16420 17682  \f


16420 17682  m.
16420 17682                     commen procedures

16421 17682  
16421 17682  ;
16422 17682  ; ========================================================================
16423 17682  ;
16424 17682  ;             common procedures used by main processes
16425 17682  ;
16426 17682  ; ========================================================================
16427 17682  ;
16428 17682  
16428 17682  
16428 17682  ; 
16429 17682  ; procedure start controller(force)
16430 17682  ; ------------------------------------------------------------------------
16431 17682  ;
16432 17682  ; the controller supervised by current receiver (b19) will be started
16433 17682  ; with current message (b18).
16434 17682  ; controll will be returned to 'wait event' in driverproc.
16435 17682  ; the parameter force will be passed to the procedure test_ready_and_setup.
16436 17682  ;
16437 17682  ;        call
16438 17682  ;
16439 17682  ;   w0   force
16440 17682  ;   w1   -
16441 17682  ;   w2   -
16442 17682  ;   w3   -
16443 17682  ;
16444 17682  
16444 17682  n0:                    ; procedure start controller;
16445 17682       rl  w1     b19    ; begin
16446 17684       rl  w1  x1+a59    ;   
16447 17686       rl  w2     b18    ;   start_controller(force, this main.devno, message);
16448 17688       jd      1<11+128  ;
16449 17690                         ;
16450 17690       se  w0     0      ;   if result <> ok then 
16451 17692       jl         g4     ;   deliver result(4)
16452 17694       jl        (b20)   ;   else goto wait event;
16453 17696                         ; end;
16454 17696  
16454 17696  \f


16454 17696  
16454 17696  ;
16455 17696  ; procedure clear queue(io result,queue head);
16456 17696  ; ------------------------------------------------------------------------
16457 17696  ;
16458 17696  ; all messages in the specified queue are returned with result 4.
16459 17696  ; for each message the receiver is tested. if the receiver is a monitor
16460 17696  ; driven driver then the receiver is changed to the driverprocess of the
16461 17696  ; mainprocess. this will make it possible for driverproc to send the answer.
16462 17696  ;
16463 17696  ;     call            return
16464 17696  ;
16465 17696  ; w0  io result       io result
16466 17696  ; w1  -               unchanged
16467 17696  ; w2  queue head      queue head
16468 17696  ; w3  link            destroyed
16469 17696  ;
16470 17696  
16470 17696  b.  i10, j10  w.
16471 17696  
16471 17696  n1:                   ; procedure clear queue(io result, queue head); 
16472 17696       sn  w2 (x2+0)    ; begin
16473 17698       jl      x3       ;
16474 17700       ds. w3     i3.   ;
16475 17702       ds. w1     i1.   ;
16476 17704       dl  w1     b19   ;
16477 17706       ds. w1     i5.   ;
16478 17708                        ;   while not queue head.empty do
16479 17708  j1:  rl  w2  x2+0     ;   begin
16480 17710       rs  w2     b18   ;     cur buf := queue head.first;
16481 17712       jl  w3     g32   ;     decrease stopcount(cur buf);
16482 17714       rl  w2     b18   ;
16483 17716       ac  w3 (x2+a141) ;
16484 17718       rl  w0  x3+a10   ;     if message.receiver.kind <> main_kinds then
16485 17720       se  w0     q20   ;     begin <* monitor driven driver *>
16486 17722       sn  w0     q26   ;       message.receiver := driverproc;
16487 17724       jl.        j2.   ;       <* simulate that the message hasn't been claimed
16488 17726       rl  w1     b21   ;          this will force 'deliver result' to decrease
16489 17728       rs  w1  x2+a141  ;          bufferclaime of driverproc before sending the
16490 17730                        ;          answer *>
16491 17730                        ;     end;
16492 17730  j2:  rl. w0     i0.   ;     message.io result := io result;
16493 17732       rs  w0     g23   ;
16494 17734       al  w0     4     ;
16495 17736       jl  w3     g19   ;     deliver result(4);
16496 17738       rl. w2     i2.   ;
16497 17740       se  w2 (x2+0)    ;
16498 17742       jl.        j1.   ;   end;
16499 17744                        ;
16500 17744       dl. w1     i5.   ;
16501 17746       ds  w1     b19   ;
16502 17748       dl. w1     i1.   ;
16503 17750       jl.       (i3.)  ;
16504 17752                        ;
16505 17752  i0:  0                ;  saved w0
16506 17754  i1:  0                ;  saved w1
16507 17756  i2:  0                ;  saved w2
16508 17758  i3:  0                ;  saved w3
16509 17760       0                ;  saved current buffer
16510 17762  i5:  0                ;  saved current receiver
16511 17764                        ;
16512 17764  e.                    ; end;
16513 17764  \f


16513 17764  
16513 17764  ;
16514 17764  ; procedure clear process(proc);
16515 17764  ; ------------------------------------------------------------------------
16516 17764  ;
16517 17764  ; the specified process is cleared, i.e. name, users and reserver
16518 17764  ; are zeroized.
16519 17764  ;
16520 17764  ;     call              return
16521 17764  ;
16522 17764  ; w0  -                 unchanged
16523 17764  ; w1  -                 unchanged
16524 17764  ; w2  proc              proc
16525 17764  ; w3  link              link
16526 17764  ;
16527 17764  
16527 17764  b.  i10, j10  w.
16528 17764  
16528 17764  n2:                    ; procedure clear process(proc);
16529 17764       ds. w1     i1.    ; begin
16530 17766       ld  w1    -100    ;
16531 17768       ds  w1  x2+a11+2  ;   proc.name := 0;
16532 17770       rs  w1  x2+a52    ;   proc.reserver := 0;
16533 17772                         ;
16534 17772  j0:  am      x1        ;   users := 0;
16535 17774       rs  w0  x2+a402   ;
16536 17776       al  w1  x1+2      ;
16537 17778       sh  w1     a403-2 ;
16538 17780       jl.        j0.    ;
16539 17782       dl. w1     i1.    ;
16540 17784       jl      x3        ;
16541 17786                         ;
16542 17786       0                 ;  saved w0
16543 17788  i1:  0                 ;  saved w1
16544 17790                         ;
16545 17790  e.                     ; end;
16546 17790                         ;
16547 17790  \f


16547 17790  
16547 17790  ;
16548 17790  ; procedure include all users(main, proc);
16549 17790  ; -----------------------------------------------------------------------------
16550 17790  ;
16551 17790  ; all users of the main process are included as users of the specified process.
16552 17790  ;
16553 17790  ;       call            return
16554 17790  ;  w0   -               destroyed
16555 17790  ;  w1   main            main
16556 17790  ;  w2   proc            proc
16557 17790  ;  w3   link            destroyed
16558 17790  ;
16559 17790  
16559 17790  b.  i10,  j10  w.
16560 17790  
16560 17790  n3:                    ; include all users
16561 17790       rs. w3     i3.    ; begin
16562 17792       al  w3     a401   ;
16563 17794       al  w1  x1+a402   ;   for i:=1 step 1 until no of words do
16564 17796       al  w2  x2+a402   ;   proc.userbittable(i) :=
16565 17798  j1:  rl  w0  x1        ;   main.userbittable(i);
16566 17800       rs  w0  x2        ;
16567 17802       al  w1  x1+2      ;
16568 17804       al  w2  x2+2      ;
16569 17806       al  w3  x3-1      ;
16570 17808       se  w3     0      ;
16571 17810       jl.        j1.    ;
16572 17812       al  w1  x1-a48    ;
16573 17814       al  w2  x2-a48    ;
16574 17816       jl.       (i3.)   ;
16575 17818                         ;
16576 17818  i3:  0                 ;   saved return;
16577 17820  e.                     ; end;
16578 17820  \f


16578 17820  
16578 17820  ;
16579 17820  ; procedure decrease stopcount and deliver result_3(message);
16580 17820  ; procedure decrease stopcount and deliver result_1(message);
16581 17820  ; ------------------------------------------------------------------------------
16582 17820  ;
16583 17820  ; the stopcount of the sender of the message is decreased and the message is
16584 17820  ; answered with result 3 or 1.
16585 17820  ;
16586 17820  ;         call 
16587 17820  ;  w0     -
16588 17820  ;  w1     -
16589 17820  ;  w2     message
16590 17820  ;  w3     -
16591 17820  ;
16592 17820  
16592 17820  b.  i5, j5  w.
16593 17820  
16593 17820  n4:                    ; decrease stopcount and deliver result 3:
16594 17820       am         1      ;
16595 17822  n5:  al  w0     0      ; decrease stopcount and deliver result 1:
16596 17824       rs. w0     i0.    ; begin
16597 17826       jl  w3     d132   ;   decrease stopcount(message);
16598 17828       rl. w0     i0.    ;
16599 17830       se  w0     1      ;   goto deliver result (3 or 1);
16600 17832       am         g7-g5  ;
16601 17834       jl         g5     ;
16602 17836                         ;
16603 17836  i0:  0                 ;
16604 17838  e.                     ; end;
16605 17838  \f


16605 17838  
16605 17838  ; procedure remove_attention_buffer(proc)
16606 17838  ; -----------------------------------------------------------------------------
16607 17838  ;
16608 17838  ; regretted message is called if an attention buffer exist
16609 17838  ;
16610 17838  ;         call             return
16611 17838  ;  w0      -               unchanged
16612 17838  ;  w1      -               unchanged
16613 17838  ;  w2     terminal         unchanged
16614 17838  ;  w3     return address   unchanged
16615 17838  ;
16616 17838  
16616 17838  b.   i5,  j5   w.
16617 17838  
16617 17838  n7:  ds. w3     i3.    ; procedure remove_attention_buffer
16618 17840       al  w3  x2        ; begin
16619 17842       al  w2     0      ;
16620 17844       rx  w2  x3+a71    ;
16621 17846       se  w2     0      ;   if proc.attention_buffer <> 0 then 
16622 17848       jl  w3     d75    ;      regretted_message(proc.attention_buffer);
16623 17850       dl. w3     i3.    ;
16624 17852       jl      x3        ;  
16625 17854                         ;
16626 17854  i2:  0                 ;
16627 17856  i3:  0                 ;
16628 17858  e.                     ; end;
16629 17858  \f


16629 17858  
16629 17858  ;
16630 17858  ; procedure free_process(proc);
16631 17858  ; -----------------------------------------------------------------------------
16632 17858  ;
16633 17858  ; the specified process is set free i.e. kind is set to free process and
16634 17858  ; state is set to 'free'.
16635 17858  ;
16636 17858  ;      call            return
16637 17858  ;
16638 17858  ; w0   -               unchanged
16639 17858  ; w1   -               unchanged
16640 17858  ; w2   proc            proc
16641 17858  ; w3   link            destroyed
16642 17858  ;
16643 17858  
16643 17858  b.  i5,  j5  w.
16644 17858  
16644 17858  n8:                      ; free_process
16645 17858       rs. w0     i0.      ; begin
16646 17860       al  w0     q68      ;
16647 17862       rs  w0  x2+a10      ;   proc.kind := free;
16648 17864       ac  w0     2.0111+1 ;
16649 17866       la  w0  x2+a78      ; 
16650 17868       lo. w0     i1.      ;
16651 17870       hs  w0  x2+a78+1    ;   proc.state := free;
16652 17872       rl. w0     i0.      ;
16653 17874       jl      x3          ; 
16654 17876                           ;
16655 17876  i0:  0                   ; save w0
16656 17878  i1:  l36                 ; proc state free
16657 17880                           ;
16658 17880  e.                       ; end;
16659 17880  \f


16659 17880  
16659 17880  ;
16660 17880  ; procedure cleanup
16661 17880  ; -----------------------------------------------------------------------------
16662 17880  ;
16663 17880  ; The process complex in rc8000 concerning the controller supervised by the
16664 17880  ; mainprocess in b19, is cleaned up, i.e. all pending messages are returned
16665 17880  ; with result 4 and all processes for devices on the controller are removed.
16666 17880  ;
16667 17880  ;         call           return
16668 17880  ;  w0     -              destroyed
16669 17880  ;  w1     -              destroyed
16670 17880  ;  w2     -              destroyed
16671 17880  ;  w3     link           destroyed
16672 17880  
16672 17880  b.  i10,  j10  w.
16673 17880  
16673 17880  n9:                    ; begin
16674 17880                         ;
16675 17880       rs. w3     i3.    ;
16676 17882       rl  w1     b4     ;for proc := first external, next until last external do
16677 17884  j2:  rl  w2  x1        ;   begin
16678 17886       rl  w0  x2+a10    ;
16679 17888       rl  w3  x2+a50    ;
16680 17890       se  w3    (b19)   ;     if proc.main = this main and 
16681 17892       jl.        j3.    ;        proc.kind <> mainkind then
16682 17894       se  w0     q20    ;     begin
16683 17896       sn  w0     q26    ;       <* disc, mt or ifpgsd *>
16684 17898       jl.        j3.    ;
16685 17900                         ;
16686 17900       al  w2  x2+a54    ;
16687 17902       rl  w0  x2+a10    ;       if proc.kind = terminal then
16688 17904       sn  w0     q8     ;          remove_attention_buffer(proc);
16689 17906       jl. w3     n7.    ;
16690 17908       al  w0     0      ;
16691 17910       jl. w3     n1.    ;       clear_queue(normal, proc.event_queue);
16692 17912       al  w2  x2-a54    ;
16693 17914       jl. w3     n2.    ;       clear_process(proc);
16694 17916       jl. w3     n8.    ;       free_process();
16695 17918       jl.        j4.    ;     end 
16696 17920                         ;     else
16697 17920  j3:  se  w2    (b19)   ;     if proc = this main then
16698 17922       jl.        j4.    ;     begin
16699 17924       al  w0     0      ;
16700 17926       al  w2  x2+a54    ;
16701 17928       jl. w3     n1.    ;       clear queue(normal,this main.event queue); 
16702 17930       al  w2  x2-a54+a81;
16703 17932       jl. w3     n1.    ;       clear queue(normal,this main.waiting queue); 
16704 17934       al  w2  x2-a81    ;
16705 17936       al  w3     0      ;       this main.statistics := 0;
16706 17938       ds  w0  x2+a216+2 ;
16707 17940       ds  w0  x2+a218   ;     end;
16708 17942                         ;
16709 17942  j4:  al  w1  x1+2      ;
16710 17944       se  w1    (b5)    ;
16711 17946       jl.        j2.    ;   end;
16712 17948       jl.       (i3.)   ;
16713 17950  i3:  0                 ; saved link
16714 17952                         ;
16715 17952  e.                     ; end;
16716 17952  
16716 17952  \f


16716 17952  
16716 17952  ; procedure check_remoter(type, main, terminal)
16717 17952  ; -----------------------------------------------------------------------------
16718 17952  ;
16719 17952  ; the message queue of the remoter is searched for an terminal supervisor
16720 17952  ; message (operation = 2).
16721 17952  ; if such a message is found the terminal is reserved and the internal is 
16722 17952  ; returned.
16723 17952  ;
16724 17952  ;          call           return
16725 17952  ; w0       att type       undefined
16726 17952  ; w1       main           main
16727 17952  ; w2       terminal       terminal
16728 17952  ; w3       link           internal_supervisor (reserver) or 0
16729 17952  ;
16730 17952  
16730 17952  b.  i10,  j10   w.
16731 17952  
16731 17952  n12: ds. w3     i3.    ; begin
16732 17954       ds. w1     i1.    ;
16733 17956       al  w0     0      ;
16734 17958       rs. w0     i4.    ;   internal_supervisor := 0;
16735 17960       rl  w3    (b3)    ;   
16736 17962       al  w0  x3+a54    ;   message:= remoter.eventq.first;
16737 17964       rl  w3  x3+a54    ;   while message <> none do
16738 17966       rs. w0     i6.    ;   begin
16739 17968  j3:  sn. w3    (i6.)   ;   
16740 17970       jl.        j6.    ;
16741 17972       rs. w3     i5.    ;
16742 17974       zl  w0  x3+a150+0 ;     if message.operation = wait for connect then
16743 17976       se  w0     2      ;     begin
16744 17978       jl.        j5.    ;
16745 17980       zl  w0  x3+a150+1 ;       if (message.mode = all connections) or
16746 17982       so  w0     2.1    ;          (message.mode = specific main and
16747 17984       jl.        j4.    ;           message.mainaddress = this main) then
16748 17986       rl  w0  x3+a151   ;       begin
16749 17988       se. w0    (i1.)   ;
16750 17990       jl.        j5.    ;
16751 17992  j4:  rl  w1  x3+a142   ;         sender:= message.sender;
16752 17994       rl  w0  x1+a10    ;         if sender.kind<>internal then
16753 17996       se  w0     0      ;         sender:=sender.main; <*pseudo proc*>
16754 17998       rl  w1  x1+a50    ;
16755 18000       rl. w0     i0.    ;              
16756 18002       se  w0     1<0    ;         if type = connected then
16757 18004       jl.        j6.    ;         begin
16758 18006       rs. w1     i4.    ;           internal_supervisor := sender;
16759 18008       jl  w3     d125   ;           include_reserver(sender, proc);
16760 18010                         ;         end;
16761 18010                         ;       end;
16762 18010                         ;     end;
16763 18010  j5:  rl. w3     i5.    ;
16764 18012       rl  w3  x3+a140   ;     message:=message.next;
16765 18014       jl.        j3.    ;   end;
16766 18016  j6:                    ; done:
16767 18016       dl. w2     i2.    ;   <* restore and return *>
16768 18018       rl. w0     i0.    ;
16769 18020       rl. w3     i4.    ;   <* return reserving process *>
16770 18022       jl.       (i3.)   ;
16771 18024                         ;
16772 18024  i0:  0                 ; save w0  att_type
16773 18026  i1:  0                 ;      w1  main
16774 18028  i2:  0                 ;      w2  terminal
16775 18030  i3:  0                 ;      w3  link
16776 18032  i4:  0                 ; internal_supervisor or 0
16777 18034  i5:  0                 ; remoter message
16778 18036  i6:  0                 ; remoter queue
16779 18038  e.                     ; end;
16780 18038  
16780 18038  \f


16780 18038  
16780 18038  ; procedure send_main_message(receiver, message);
16781 18038  ; ----------------------------------------------------------------------------
16782 18038  ;
16783 18038  ; send the specified message to the receiver.
16784 18038  ;
16785 18038  ;    call        return
16786 18038  ; w0 -           destroyed
16787 18038  ; w1 receiver    destroyed
16788 18038  ; w2 message     destroyed
16789 18038  ; w3 link        destroyed
16790 18038  ;
16791 18038  
16791 18038  b.  i5, j5  w.
16792 18038  
16792 18038  i3:  0                 ; saved return
16793 18040  i4:  0,0,0,0,0         ; namearea and nta
16794 18050  
16794 18050  n13:                   ; send_main_message
16795 18050       rs. w3     i3.    ; begin
16796 18052       dl  w0  x1+a11+2  ;   namearea := receiver.name;
16797 18054       ds. w0     i4.+2  ;
16798 18056       dl  w0  x1+a11+6  ;
16799 18058       ds. w0     i4.+6  ;
16800 18060       al. w3     i4.    ;
16801 18062       al  w1  x2        ;   
16802 18064       jd         1<11+16;   send message(message, receiver.name);
16803 18066       jl.       (i3.)   ; 
16804 18068  e.                     ; end;
16805 18068  \f


16805 18068  
16805 18068  ; procedure send_remoter_att(type, main, terminal)
16806 18068  ; -----------------------------------------------------------------------------
16807 18068  ;
16808 18068  ; an attention message is sent to the internal process which has reserved the
16809 18068  ; terminal process.
16810 18068  ; the attention message has the following format:
16811 18068  ;
16812 18068  ;    sender:     terminal or main
16813 18068  ;    receiver:   sender of message to remoter
16814 18068  ;    + 0         0       (attention)
16815 18068  ;    + 2         state   (1<0: terminal connected, 1<1: terminal disconnected)
16816 18068  ;    + 4         terminal address
16817 18068  ;    + 6- +12    terminal name  
16818 18068  ;
16819 18068  ; if state = disconnected mainproc is inserted as sender of att message
16820 18068  ;
16821 18068  ;          call           return
16822 18068  ; w0       att type       att type
16823 18068  ; w1       main           main
16824 18068  ; w2       terminal       terminal
16825 18068  ; w3       link           undefined
16826 18068  ;
16827 18068  
16827 18068  b.  i10,  j10   w.
16828 18068  
16828 18068  n14: ds. w3     i3.    ; begin
16829 18070       ds. w1     i1.    ;
16830 18072       al  w3     0      ;   att_mess.mess_0 := 0;
16831 18074       ds  w0     g21    ;   att-mess.status := type;
16832 18076       rs  w2     g22    ;   att-mess.terminal := terminal 
16833 18078       dl  w0  x2+a11+2  ;   att-mess.name := terminal.name
16834 18080       ds  w0     g23+2  ;         
16835 18082       dl  w0  x2+a11+6  ;
16836 18084       ds  w0     g23+6  ;
16837 18086       rl  w3  x2+a74    ;   receiver := terminal.att_receiver;
16838 18088       rl. w2     i2.    ;   if type = disconnect then 
16839 18090       rl. w1     i0.    ;      sender := this main
16840 18092       sn  w1     1<1    ;   else
16841 18094       rl. w2     i1.    ;      sender := terminal;
16842 18096       al  w1     g20    ;
16843 18098       jd         1<11+17;   send_att_message(message, sender, receiver);
16844 18100       am.       (i2.)   ;
16845 18102       rs  w2    +a71    ;   terminal.att_buffer := buffer;
16846 18104       rl. w0     i0.    ;
16847 18106       dl. w2     i2.    ;   <* restore and return *>
16848 18108       jl.       (i3.)   ;
16849 18110                         ;
16850 18110  i0:  0                 ; save w0  att_type
16851 18112  i1:  0                 ;      w1  main
16852 18114  i2:  0                 ;      w2  terminal
16853 18116  i3:  0                 ;      w3  link
16854 18118  e.                     ; end;
16855 18118  
16855 18118  e.                     ; end of main driver
16856 18118  \f


16856 18118  
16856 18118  m.
16856 18118                  monfpaline - fpa-main, -transmitter and -receiver drivers 17.0 beta

16857 18118  
16857 18118  b.i30 w.
16858 18118  i0= 86 10 10, i1=15 40 00
16859 18118  
16859 18118  ; if newtime (i0,i1) > oldtime (a133,a134) then oldtime:=newtime;
16860 18118  c.i0-a133
16861 18118    c.i0-a133-1, a133=i0, a134=i1, z.
16862 18118    c.i1-a134-1,          a134=i1, z.
16863 18118  z.
16864 18118  
16864 18118  i10=i0, i20=i1
16865 18118  
16865 18118  i15=i10/100000 , i10=i10-i15*100000 , i25=i20/100000 , i20=i20-i25*100000 
16866 18118  i14=i10/10000  , i10=i10-i14*10000  , i24=i20/10000  , i20=i20-i24*10000 
16867 18118  i13=i10/1000   , i10=i10-i13*1000   , i23=i20/1000   , i20=i20-i23*1000
16868 18118  i12=i10/100    , i10=i10-i12*100    , i22=i20/100    , i20=i20-i22*100
16869 18118  i11=i10/10     , i10=i10-i11*10     , i21=i20/10     , i20=i20-i21*10
16870 18118  
16870 18118  i2:  <:                              date  :>
16871 18142       (:i15+48:)<16+(:i14+48:)<8+46
16872 18144       (:i13+48:)<16+(:i12+48:)<8+46
16873 18146       (:i11+48:)<16+(:i10+48:)<8+32
16874 18148  
16874 18148       (:i25+48:)<16+(:i24+48:)<8+46
16875 18150       (:i23+48:)<16+(:i22+48:)<8+46
16876 18152       (:i21+48:)<16+(:i20+48:)<8+ 0
16877 18154  
16877 18154  i3:  al. w0  i2.       ; write date:
16878 18156       rs  w0  x2+0      ;   first free:=start(text);
16879 18158       al  w2  0         ;
16880 18160       jl      x3        ;   return to slang(status ok);
16881 18162  
16881 18162       jl.     i3.       ;
16882 18164  e.
16883 18164  j.
16883 18118                                date  86.10.10 15.40.00

16884 18118     c.(: a80>8 a.1 :)-1       ; if fpacomplex included then
16885 18118  \f


16885 18118  
16885 18118  
16885 18118  ; fpa 801 driver complex.
16886 18118  ;  the fpa 801 driver complex consists of a number of drivers --
16887 18118  ;      mainprocess driver
16888 18118  ;      line-process drivers: receiver driver
16889 18118  ;                            transmitter driver
16890 18118  ;      subprocess drivers:   hostprocess driver
16891 18118  ;                            general driver
16892 18118  ;                            terminal driver
16893 18118  ;                            magtape driver
16894 18118  ;                            disc driver
16895 18118  ;
16896 18118  
16896 18118  ; block including all drivers.
16897 18118  
16897 18118  b.f12,p340,v120 w.
16898 18118  
16898 18118  ; block including main- and line-drivers.
16899 18118  
16899 18118  b.e12 w.
16900 18118  
16900 18118  ; block including main-process driver.
16901 18118  
16901 18118  b.m20,n20,s20 w.
16902 18118  
16902 18118  m.
16902 18118                  fpa mainprocess

16903 18118  
16903 18118  
16903 18118  
16903 18118  ; the following define global formats and constants
16904 18118  
16904 18118  v0   =     8               ; highest number of buffers at the same time transmitted to a device
16905 18118  v1   =     12              ; number of bytes in private part of subproc description
16906 18118  v2   =     1<16-1          ; maximum buffer size for datanet
16907 18118  v3   =     16              ; max number of operations at the same time transmitted from a hostproc
16908 18118  
16908 18118  ; function codes for mainproc
16909 18118  ; bit 1<0 should be added if data follows
16910 18118  
16910 18118  v31  =     0<2      ;   0  ; create
16911 18118  v32  =     v31+1<1  ;   2  ; answer create
16912 18118  v37  =     1<2      ;   4  ; remove
16913 18118  v38  =     v37+1<1  ;   6  ; answer remove
16914 18118  v35  =     2<2      ;   8  ; release
16915 18118  v36  =     v35+1<1  ;  10  ; answer release
16916 18118  v33  =     3<2      ;  12  ; lookup
16917 18118  v34  =     v33+1<1  ;  14  ; answer lookup
16918 18118  
16918 18118  v22  =     10<2     ;  40  ; operator output-input
16919 18118  v23  =     v22+1<1  ;  42  ; answer operator output-input
16920 18118  v24  =     11<2     ;  44  ; operator output
16921 18118  v25  =     v24+1<1  ;  46  ; answer operator output
16922 18118  
16922 18118  ; smallest function value for the subprocs
16923 18118  
16923 18118  v40  = 1<7+0<2      ;  128 ; min subproc func value
16924 18118  
16924 18118  ; function codes for subprocs
16925 18118  ; bit 1<0 should be added, if data follows
16926 18118  
16926 18118  v50  = 1<7+3<2      ;  140 ; input
16927 18118  v51  =     v50+1<1  ;  142 ; answer input
16928 18118  v52  = 1<7+4<2      ;  144 ; output
16929 18118  v53  =     v52+1<1  ;  146 ; answer output
16930 18118  v54  = 1<7+5<2      ;  148 ; message
16931 18118  v55  =     v54+1<1  ;  150 ; answer message
16932 18118  v56  = 1<7+6<2      ;  152 ; user name
16933 18118  v57  =     v56+1<1  ;  154 ; answer user name
16934 18118  v58  = 1<7+7<2      ;  156 ; attention
16935 18118  v59  =     v58+1<1  ;  158 ; answer attention
16936 18118  
16936 18118  ; definition of bitpatterns in state-field of subprocs (p12)
16937 18118  
16937 18118  v70  =     2.0001 <8       ; subproc blocked
16938 18118  v71  =     2.0010 <8       ; answer attention pending
16939 18118  v72  =     2.0100 <8       ; messages pending
16940 18118  
16940 18118  ; bit 0 - 7 are reserved for bufno (used in answer attention)
16941 18118  \f


16941 18118  
16941 18118  
16941 18118  ; process description of subprocess:
16942 18118  ;
16943 18118  ; monitor part:
16944 18118  ; a250:                    ;  driver process description address
16945 18118  ; a402:                    ;  user bit table
16946 18118  ; a48:                     ;  interval 
16947 18118  ; a49:                     ;  interval 
16948 18118  ; a10:                     ;  kind 
16949 18118  ; a11:                     ;  name 
16950 18118  ; a50:                     ;  mainproc 
16951 18118  ; a52:                     ;  reserver 
16952 18118  ; a57, a58:                ;  work0, work1
16953 18118  ; a54:                     ;  first message 
16954 18118  ; a55:                     ;  last message 
16955 18118  ; a56:                     ;  external state 
16956 18118  
16956 18118  ; specific part:
16957 18118  p0 =a56+2                  ; first(specific part)
16958 18118  p1 =p0+v1                  ; top(specific part)
16959 18118  
16959 18118  ; mainprocess part:
16960 18118  p11=p1     , p9=p11+1      ;  devhost linkno, jobhost linkno
16961 18118  p10=p11+2  , p8=p10+1      ;  subkind, data quality
16962 18118  p12=p10+2                  ;  state(sub) 
16963 18118  p14=p12+2                  ;  next subprocess 
16964 18118  p15=p14+2                  ;  last subprocess 
16965 18118  p16=p15+2  , p17=p16+1     ;  buffers free  ,  current bufno 
16966 18118  p18=p16+2                  ;  max bufsize(in bytes) 
16967 18118  p7=p18+2   , p6=p7+1       ;  devhost net-id, devhost home-reg
16968 18118  p5=p7+2                    ;  devhost host-id
16969 18118  p13=p5+2                   ;  current message 
16970 18118  p19=p13+2                  ; start(mess buf table):
16971 18118  a79=p19+v0<1               ; top(mess buf table)
16972 18118  
16972 18118  c.(:a63-p10:)*(:a63-p10:)-1, m. name error a63
16973 18118  z.
16974 18118  c.(:a64-p12:)*(:a64-p12:)-1, m. name error a64
16975 18118  z.
16976 18118  
16976 18118  ; process description of mainprocess:
16977 18118  ;
16978 18118  ; monitor part:
16979 18118  ; a250:                    ;  driver process description address
16980 18118  ; a402:                    ;  user bit table
16981 18118  ; a48:                      ;  interval 
16982 18118  ; a49:                      ;  interval 
16983 18118  ; a10:                      ;  kind 
16984 18118  ; a11:                      ;  name 
16985 18118  ; a50:                      ;
16986 18118  ; a52:                      ;  reserver 
16987 18118  ; a57, a58:                ;  work0, work1
16988 18118  ; a54:                      ;  first message 
16989 18118  ; a55:                      ;  last message 
16990 18118  ; a56:                      ; 
16991 18118  
16991 18118  ; p0                        ; start of spec part:
16992 18118  s0=p0                       ;  start(ne t record) 
16993 18118  s1=s0+2                     ;  top(test buffer) 
16994 18118  s4=s1+2                     ;  start(testbuffer)
16995 18118  s5=s4+2                     ;  top(testbuffer)
16996 18118                              ;  mask0(00:23) 
16997 18118  s2=s5+4                     ;  mask0(24:47) 
16998 18118                              ;  mask1(48:71) 
16999 18118  s3=s2+4                     ;  mask1(72:95) 
17000 18118  
17000 18118  ; subprocess queue:
17001 18118  ;                           ; not used
17002 18118  ; p14                       ;  next subprocess
17003 18118  ; p15                       ;  last subprocess
17004 18118  s16=p15+2     , s17=s16+1   ;  ready flag (protocol-flag,mode from message)   0: DCP; <>0: direct
17005 18118  s6=s16+2                    ;  counter
17006 18118  s7=s6+2                    ;  home-reg<16+host-id
17007 18118  \f


17007 18118  
17007 18118  ; transmit parameters:
17008 18118  ; ********************
17009 18118  
17009 18118  b. i0 w.
17010 18118  i0=s7+2
17011 18118  
17011 18118  ; line parameters
17012 18118  p66=i0            , i0=i0+2;  size
17013 18118  p60=i0 ,          , i0=i0+2;  internal status, unused
17014 18118  p65=i0            , i0=i0+2;  first data
17015 18118  p72=i0            , i0=i0+2;  address code, unused
17016 18118  p71=i0            , i0=i0+2;  message buffer
17017 18118  
17017 18118  ; intermediate control parameters
17018 18118  
17018 18118  p79=i0            , i0=i0+2; local function
17019 18118  
17019 18118  ; packet control parameters
17020 18118  
17020 18118  p301=i0 , p302=i0 , i0=i0+2;  rec net-id, rec home-reg
17021 18118  p303=i0           , i0=i0+2;  rec host-id
17022 18118  p304=i0           , i0=i0+2;  packet-id
17023 18118  p305=i0           , i0=i0+2;  facility mask
17024 18118  p306=i0           , i0=i0+2;  priority
17025 18118  
17025 18118  ; device control parameters
17026 18118  
17026 18118  p69=i0 , p78=i0+1 , i0=i0+2;  rec linkno, sender linkno
17027 18118  p64=i0            , i0=i0+2;  size
17028 18118  p61=i0 , p68=i0+1 , i0=i0+2;  function, bufno
17029 18118  p62=i0 , p308=i0+1, i0=i0+2;  state, data quality
17030 18118  p63=i0            , i0=i0+2;  mode
17031 18118  
17031 18118  ; internal mainproc parameters
17032 18118  
17032 18118  p67=i0 ,          , i0=i0+2;  error count, unused
17033 18118  p70=i0            , i0=i0+2;  proc. description
17034 18118  p73=i0 , p76=i0+1 , i0=i0+2;  operation, blockcontrol
17035 18118  p77=i0 , p74=i0+1 , i0=i0+2;  contents, result
17036 18118  p75=i0            , i0=i0+16; header transmit area
17037 18118  \f


17037 18118  
17037 18118  ; receive parameters
17038 18118  ; ******************
17039 18118  
17039 18118  ; line parameters
17040 18118  
17040 18118  p86=i0            , i0=i0+2;  size
17041 18118  p80=i0 ,          , i0=i0+2;  internal status, unused
17042 18118  p85=i0            , i0=i0+2;  first data
17043 18118  p92=i0 ,          , i0=i0+2;  address code, unused
17044 18118  p91=i0            , i0=i0+2;  message buffer
17045 18118  
17045 18118  ; intermediate control parameters
17046 18118  
17046 18118  p99=i0 ,          , i0=i0+2;  local function, unused
17047 18118  
17047 18118  ; packet control parameters
17048 18118  
17048 18118  p321=i0, p322=i0+1, i0=i0+2;  sender net-id, sender home-reg
17049 18118  p323=i0           , i0=i0+2;  sender host-id
17050 18118  p324=i0           , i0=i0+2;  packet-id
17051 18118  p325=i0           , i0=i0+2;  facility mask
17052 18118  p326=i0, p327=i0+1, i0=i0+2;  packets in unit, packetno in unit
17053 18118  
17053 18118  ; device control parameters
17054 18118  
17054 18118  p89=i0 , p98=i0+1 , i0=i0+2;  rec linkno, sender linkno
17055 18118  p84=i0            , i0=i0+2;  size
17056 18118  p81=i0 , p88=i0+1 , i0=i0+2;  function, bufno
17057 18118  p82=i0 , p328=i0+1, i0=i0+2;  result, data quality
17058 18118  p83=i0            , i0=i0+2;  status
17059 18118  
17059 18118  ; internal mainproc parameters
17060 18118  
17060 18118  p87=i0 ,          , i0=i0+2;  error count, unused
17061 18118  p90=i0            , i0=i0+2;  proc. description
17062 18118  p93=i0 , p96=i0+1 , i0=i0+2;  operation, blockcontrol
17063 18118  p97=i0 , p94=i0+1 , i0=i0+2;  contents, result
17064 18118  p95=i0            , i0=i0+16;  header rec. area
17065 18118  
17065 18118  p100=i0                    ;  top of std process description
17066 18118  
17066 18118  e.                         ;
17067 18118  \f


17067 18118  
17067 18118  
17067 18118  ; definition of internal constants.
17068 18118  
17068 18118  p101=(:a84>2a.1:)-1    ; test switch, on: 0, off: -1
17069 18118  p102=(:a82>2a.1:)-1    ; statistics , on: 0, off: -1
17070 18118  p103=1                 ; rc4000: 0, rc8000: 1
17071 18118  
17071 18118  a65=p100               ; top of process description
17072 18118  
17072 18118  p109=100               ; monitor procedure number of start-io
17073 18118  
17073 18118  p110=80                ; kind of mainproc
17074 18118  p111=82                ; kind of hostproc
17075 18118  p112=84                ; kind of local subproc
17076 18118  p113=85                ; kind of free or remote subproc
17077 18118  p114=86                ; kind of receiver
17078 18118  p115=88                ; kind of transmitter
17079 18118  
17079 18118  p120=2.0000            ; state:=ready
17080 18118  p121=2.0001            ; state:=waiting for buffers
17081 18118  p122=2.0010            ; state:=waiting for poll
17082 18118  
17082 18118  p140=20                ; max number of errors
17083 18118  p141=50                ; max number of errors using short timer under initiation
17084 18118  
17084 18118  p160=0                 ; internal status:=ok
17085 18118  p161=1                 ; internal status:=wait
17086 18118  p162=2                 ; internal status:=skip
17087 18118  p163=3                 ; internal status:=reject
17088 18118  p164=-1                ; internal status:=regret
17089 18118  
17089 18118  p210=p0+42+7*6         ; rel top of proc desc(rec)
17090 18118  p211=p0+58+7*6         ; rel top of proc desc(trm)
17091 18118  
17091 18118  p200=p100-a220         ; start(receiver proc) - start (mainproc)
17092 18118  p201=p200+p210-a220    ; start(transmitter proc) - start(mainproc)
17093 18118  p202=p201+p211-a250    ; start(hostproc) - start(mainproc)
17094 18118  
17094 18118  
17094 18118  ; format of startbyte:
17095 18118  ;  (0:0)  blocknumber mod 2
17096 18118  ;  (1:3)  not used
17097 18118  ;  (4:4)  data bit
17098 18118  ;  (5:5)  header bit
17099 18118  ;  (6:6)  data flag
17100 18118  ;  (7:7)  special function bit
17101 18118  
17101 18118  ; format of header block:
17102 18118  ;  line control:
17103 18118  ;   word0   (00:15)  size of succeeding text block
17104 18118  ;  host control:
17105 18118  ;           (16:23)  local function
17106 18118  ;   word1   (08:15)  net-id
17107 18118  ;           (16:23)  home-reg
17108 18118  ;   word2   (00:15)  host-id
17109 18118  ;  message control:
17110 18118  ;   word4   (15:23)  format
17111 18118  ;   word5   (00:23)  depends on format
17112 18118  ;   word6   (00:23)  depends on format
17113 18118  ;   word7   (00:23)  depends on format
17114 18118  ;
17115 18118  ; if device control protocol (format=0) then
17116 18118  ;  device control:
17117 18118  ;           (15:23)  sender linkno
17118 18118  ;   word5   (00:05)  data quality
17119 18118  ;           (06:15)  receiver linkno
17120 18118  ;   word5,6 (16:07)  size
17121 18118  ;   word6   (08:15)  bufferno
17122 18118  ;           (16:23)  function
17123 18118  ;   word7   (00:02)  state/result
17124 18118  ;           (03:15)  mode/status
17125 18118  
17125 18118  ; format of statusbyte:
17126 18118  ;  (0:0)  blocknumber mod 2
17127 18118  ;  (1:3)  not used
17128 18118  ;  (4:5)  blockcontrol
17129 18118  ;  (6:6)  blocklength flag
17130 18118  ;  (7:7)  parity flag
17131 18118  
17131 18118  ; the value of operation should be interpreted in this way:
17132 18118  ;    value= 2.00xxxxxx1x : the block contains a data area
17133 18118  ;           2.00xxxxx1xx : the block contains a header area
17134 18118  ;           2.00xxxx11xx : the header implies a data block
17135 18118  ;           2.xxxx01xxxx : short delay (wait delay, reset delay)
17136 18118  ;           2.xxxx10xxxx : long delay (poll delay)
17137 18118  ;           2.xxxxxxxxx1 : error actions off
17138 18118  ;           2.xxx1xxxxxx : initiate
17139 18118  ;           2.xx1xxxxxxx : reset
17140 18118  ;           2.01xxxxxxxx : master clear
17141 18118  ;           2.10xxxxxxxx : accept master clear
17142 18118  \f


17142 18118  
17142 18118  
17142 18118  ; log and test facility.
17143 18118  
17143 18118  ;  format of test record:
17144 18118  ;   +0 :  type, length(record)
17145 18118  ;   +2 :  time1
17146 18118  ;   +4 :  time2
17147 18118  ;   +6 :  test information
17148 18118  ;   +8 :  ...
17149 18118  ;   +10:  ...
17150 18118  ;
17151 18118  ;  the call of the test facility is performed like this:
17152 18118  ; b.f1 w.              ;
17153 18118  ;    rs. w3  f0.       ; save w3;
17154 18118  ;    jl. w3  f4.       ; check condition(type,on/off);
17155 18118  ;    <type>            ;  type of test point
17156 18118  ; f0:<saved w3>        ;  saved w3
17157 18118  ;                      ;  off: w0-w2: unchanged, w3: saved w3;
17158 18118  ;    jl.     f1.       ;   goto end of test;
17159 18118  ;    .....             ;  on:  w0-w2: unchanged, w3: start(internal test area);
17160 18118  ;    .....             ;   pack testinformation;
17161 18118  ;    al  w0  <first>   ;  first:=first(test area);
17162 18118  ;    al  w1  <last>    ;  last:=last(test area);
17163 18118  ;    jl. w3  f5.       ;  create test record;
17164 18118  ; f1:                  ; end of test:
17165 18118  ; e.                   ;
17166 18118  
17166 18118  ; the entry f6 may be used instead of f5 to
17167 18118  ; generate the testrecord.
17168 18118  ; additionally it will cause testoutput-generation to stop after
17169 18118  ; the number of records specified in w2. 
17170 18118  
17170 18118  c.p101
17171 18118  
17171 18118  ; saved w-registers:
17172 18118  f0:  0                 ;  w0
17173 18120  f1:  0                 ;  w1
17174 18122  f2:  0                 ;  w2
17175 18124  f3:  0                 ;  w3
17176 18126  
17176 18126  ; parameters:
17177 18126  f7:  0                 ;  proc
17178 18128  f8:  0                 ;  buffer
17179 18130  f9:  0                 ;  type, length
17180 18132  
17180 18132  ; internal test area:
17181 18132  f10: 0, r.12           ; start:
17182 18156  f11=k-f10              ;   size of test area
17183 18156  
17183 18156  
17183 18156  ; check condition(type,on/off).
17184 18156  ;  checks the type of the test point stored in link against the test mask.
17185 18156  ;  if test is off then the procedure returns to link+4. test on implies
17186 18156  ;  that the test record is initiated, the registers are saved and return is made to link+6.
17187 18156  ;        call:         return:
17188 18156  ; w0                   unchanged
17189 18156  ; w1                   unchanged
17190 18156  ; w2                   unchanged
17191 18156  ; w3     link          saved w3 (off), start(internal test area) (on)
17192 18156  b.i0,j1 w.
17193 18156  f4:  ds. w1  f1.       ; check condition:
17194 18158       rs. w2  f2.       ;
17195 18160       rs. w3  i0.       ;   save link;
17196 18162       rl  w0  x3+2      ;
17197 18164       rs. w0  f3.       ;   save saved w3;
17198 18166       gg  w0  8.61<1    ;   w0:=register select switches;
17199 18168       so  w0  1<5<1     ;   if left bit off then
17200 18170       jl.     j0.       ;     goto exit2;
17201 18172       rl  w1  b19       ;   proc:=current proc;
17202 18174       rl  w0  x1+a10    ;
17203 18176       se  w0  p110      ;   if kind(proc)<>mainprockind then
17204 18178       rl  w1  x1+a50    ;     proc:=mainproc(proc);
17205 18180       rl  w0  x1+a10    ;
17206 18182       se  w0  p110      ;   if kind(proc)<>mainprockind then
17207 18184       jl.     j0.       ;     goto exit2;
17208 18186       rs. w1  f7.       ;   save proc;
17209 18188       rl  w3  x3        ;
17210 18190       sl  w3  48        ;   if type>=48 then
17211 18192       am      s3-s2     ;     mask:=mask1;
17212 18194       dl  w1  x1+s2     ;     shift:=type-48;
17213 18196       sl  w3  48        ;   else
17214 18198       am      -48       ;     mask:=mask0;
17215 18200       ld  w1  x3        ;     shift:=type;
17216 18202       sl  w0  0         ;   if mask shifted shift>=0 then
17217 18204       jl.     j0.       ;     goto exit2;
17218 18206       hs. w3  f9.       ;   type:=type of test point;
17219 18208       dl. w1  f1.       ;
17220 18210       rl. w2  f2.       ;   restore w0-w2;
17221 18212       al. w3  f10.      ;   w3:=start(test area);
17222 18214       am.    (i0.)      ;
17223 18216       jl      +6        ; exit1: return to link+6;
17224 18218  
17224 18218  j0:  dl. w1  f1.       ; exit2:
17225 18220       dl. w3  f3.       ;   restore w0-w3;
17226 18222       am.    (i0.)      ;
17227 18224       jl      +4        ;   return to link+4;
17228 18226  
17228 18226  i0:  0                 ; saved link;
17229 18228  e.
17230 18228  
17230 18228  ; create test record.
17231 18228  ;  creates a test record with the format shown above.
17232 18228  ;        call:         return:
17233 18228  ; w0     first         saved w0
17234 18228  ; w1     last          saved w1
17235 18228  ; w2                   saved w2
17236 18228  ; w3     link          saved w3
17237 18228  b.i6,j6 w.
17238 18228  f5:  al  w1  x1+2      ; create test record:
17239 18230       ds. w1  i1.       ;   top:=last+2;
17240 18232       ds. w3  i3.       ;   save w0-w3;
17241 18234       rl  w1  b19       ;
17242 18236       rx. w1  f7.       ;   current proc:=mainproc;
17243 18238       rs  w1  b19       ;   save old buffer;
17244 18240  j0:  rl. w2  i1.       ; start:
17245 18242       ws. w2  i0.       ;   length(record):=
17246 18244       al  w2  x2+6      ;     top-first+6;
17247 18246       hs. w2  f9.+1     ;   save length;
17248 18248       wa  w2  x1+s0     ;   start(next record):=
17249 18250       sh  w2 (x1+s1)    ;     start(next record)+length;
17250 18252       jl.     j2.       ;   if start(next record)>top(test buffer) then
17251 18254                         ;     goto insert;
17252 18254  j1:  rl  w2  x1+s1     ; insert dummy end record:
17253 18256       ws  w2  x1+s0     ;   length(dummy record):=top(test buffer)-start(next record);
17254 18258       sl  w2  1         ;   if length(dummy record)>0 then
17255 18260       rs  w2 (x1+s0)    ;     dummy record:=0,length;
17256 18262  j5:  al  w0  0         ; send answer:
17257 18264       rs  w0  x1+s0     ;   start(next record):=0;
17258 18266       dl  w0  x1+s5     ;
17259 18268       ds  w0  x1+s1     ;
17260 18270       jl.     j0.       ;   goto start;
17261 18272                         ; insert:
17262 18272  j2:  rx  w2  x1+s0     ;
17263 18274       rl. w0  f9.       ;   insert
17264 18276       rs  w0  x2        ;     type, length;
17265 18278       jd      1<11+36   ;   get clock;
17266 18280       ds  w1  x2+4      ;   insert time in testrecord;
17267 18282       al  w2  x2+4+2    ;
17268 18284       rl. w3  i0.       ;
17269 18286  j3:  sl. w3 (i1.)      ;   transfer test information;
17270 18288       jl.     j4.       ;
17271 18290       rl  w0  x3        ;
17272 18292       rs  w0  x2        ;
17273 18294       al  w2  x2+2      ;
17274 18296       al  w3  x3+2      ;
17275 18298       jl.     j3.       ;
17276 18300  j4:  rl. w1  f7.       ; exit:
17277 18302       rx  w1  b19       ;   restore current proc
17278 18304       rl  w2  x1+s6     ;   if counter(main)<>0 then
17279 18306       sn  w2  0         ;   begin comment: generation stopping;
17280 18308       jl.     j6.       ;     counter(main):= counter(main)-1
17281 18310       al  w2  x2-1      ;
17282 18312       rs  w2  x1+s6     ;     if counter(main)=0 then
17283 18314       se  w2  0         ;     testmask(main):= 0
17284 18316       jl.     j6.       ;
17285 18318       ld  w0  -100      ;
17286 18320       ds  w0  x1+s2     ;
17287 18322       ds  w0  x1+s3     ;
17288 18324  j6:  dl. w1  f1.       ;
17289 18326       dl. w3  f3.       ;   restore w0-w3;
17290 18328       jl.    (i3.)      ;   return to calling program;
17291 18330  
17291 18330  i0:  0                 ;  first
17292 18332  i1:  0                 ;  last
17293 18334  i2:  0                 ;
17294 18336  i3:  0                 ;  link
17295 18338  
17295 18338  e.
17296 18338  
17296 18338  ; procedure stop testoutput
17297 18338  ;
17298 18338  ; this procedure will generate a testrecord.
17299 18338  ;
17300 18338  ; additionally it will stop testoutput after generation
17301 18338  ; of the number of records specified in w2 at call.
17302 18338  ; 
17303 18338  ; function: a counter in mainproc is set to the value
17304 18338  ; specified in w2. when the counter is nonzero, it is decreased
17305 18338  ; by one after generation of each testrecord. if this makes
17306 18338  ; the counter zero, the testmask is set to zero.
17307 18338  ; 
17308 18338  ; after one call of f6, further calls will only change
17309 18338  ; the counter, if the value specified in w2 is less than the
17310 18338  ; current value of the counter (provided, the counter is
17311 18338  ; nonzero).
17312 18338  ;
17313 18338  ;        call          return
17314 18338  ; w0                   value before testpoint
17315 18338  ; w1                   value before testpoint
17316 18338  ; w2     counter       value before testpoint
17317 18338  ; w3     link          value before testpoint
17318 18338  
17318 18338  b. i0 w.               ;
17319 18338  f6:                    ;
17320 18338       rs. w3  i0.       ;  save link
17321 18340       rl. w3  f7.       ;  
17322 18342       rx  w2  x3+s6     ;  if counter(main)=0 or
17323 18344       se  w2  0         ;     counter(main)>counter then
17324 18346       sl  w2  (x3+s6)   ;
17325 18348       jl.     +4        ;
17326 18350       rx  w2  x3+s6     ;  counter(main):= counter
17327 18352       rl. w3  i0.       ;  link:= saved link
17328 18354       jl.     f5.       ;  goto create testrecord
17329 18356                         ;
17330 18356  i0:  0                 ; saved link
17331 18358  e.                     ;
17332 18358  
17332 18358  z.
17333 18358  \f


17333 18358  
17333 18358  ; mainprocess.
17334 18358  ;
17335 18358  ; the mainprocess accepts messages of the following types:
17336 18358  ;   start transmitter  0<12
17337 18358  ;   start receive      3<12
17338 18358  ;   reset              4<12
17339 18358  ;   transfer block     5<12
17340 18358  ;   autoload           6<12
17341 18358  ;   master clear       8<12
17342 18358  ;   set mask          12<12
17343 18358  ;
17344 18358  ;  mode in start transmit mess:
17345 18358  ;   0  poll
17346 18358  ;   1  accept master clear
17347 18358  ;   2  reset, initiate, poll
17348 18358  ;   3  reset, initiate, accept master clear
17349 18358  ;
17350 18358  ;
17351 18358    
17351 18358  ;  mode in reset mess:
17352 18358  ;   0  remote subprocs are removed; local subprocs are cleaned i. e.
17353 18358  ;      pending messages are returned with result 4 (malfunction).
17354 18358  ; 
17355 18358  ;   2  all subprocs are removed.
17356 18358    
17356 18358  ; to execute operations the sender must be
17357 18358  ;  op: 0  ..
17358 18358  ;      3  reserver of main or receiver
17359 18358  ;      4  reserver of main
17360 18358  ;      5  reserver of main or transmitter
17361 18358  ;      6  reserver of main
17362 18358  ;      8  reserver of main
17363 18358  ;     12  neither reservation nor user inclusion is demanded
17364 18358  \f


17364 18358  
17364 18358  b.i10,j10 w.
17365 18358  
17365 18358       a0=1<23           ;
17366 18358       a0>0+a0>3+a0>4+a0>5+a0>6+a0>8+a0>12
17367 18360  i0:  a0>0+a0>1+a0>2+a0>3
17368 18362  
17368 18362  
17368 18362  h80: bz  w0  x2+8      ; start main:
17369 18364       sn  w0  12        ;   if op=12 then
17370 18366       jl.     j10.      ;     goto setmask;
17371 18368       sz  w0  2.1       ;   if operation odd then
17372 18370       am      g14-g15   ;     check user;
17373 18372       jl  w3  g15       ;   else check reserver;
17374 18374       dl. w1  i0.       ;
17375 18376       jl  w3  g16       ;   check operation(0.3.4.6.8.12,0);
17376 18378       rl  w1  b19       ;
17377 18380       jl.     m10.      ;   goto supervise;
17378 18382  
17378 18382  j10: rl  w1  b19       ; set mask:
17379 18384       dl  w0  x2+12     ;
17380 18386       ds  w0  x1+s2     ;   mask0:=mask(0:47);
17381 18388       dl  w0  x2+16     ;
17382 18390       ds  w0  x1+s3     ;   mask1:=mask(48:95);
17383 18392       al  w0  0         ;
17384 18394       rs  w0  g20       ;   status:=0;
17385 18396       jl  w3  g18       ;   deliver result1;
17386 18398       jl     (b20)      ; exit: return to sender;
17387 18400  e.
17388 18400  \f


17388 18400  
17388 18400  
17388 18400  ; initiate part.
17389 18400  
17389 18400  b.i10,j10 w.
17390 18400  i2:  0<12+2.00         ; message: start transmitter, poll
17391 18402  i6:  0<12+2.10         ; message: start transmitter, reset, initiate, poll
17392 18404  i7:  0<12+2.11         ; message: start transmitter, reset, initiate, accept master clear
17393 18406  i4:  0,r.8             ; answer: dummy
17394 18422  i5:  0                 ; saved message buffer
17395 18424  
17395 18424  
17395 18424  ; entry from send message.
17396 18424  
17396 18424  ; w1: main, w2: addr(message buffer).
17397 18424  m10:                   ; supervise:
17398 18424       zl  w0  x2+8      ; load operation
17399 18426       al  w3     1      ; if operation <> reset then 
17400 18428       se  w0     4      ; mode = direct
17401 18430       hs  w3  x1+s16    ;
17402 18432       rl  w3  x2+8      ;
17403 18434       hs  w3  x1+s17    ; save mess.mode
17404 18436       rs. w2      i5.   ; save message buffer addr
17405 18438  c.p101 b.f1 w.         ;*****test1*****
17406 18438       rs. w3  f0.       ;
17407 18440       jl. w3  f4.       ;
17408 18442       1                 ;
17409 18444  f0:  0                 ;
17410 18446       jl.     f1.       ;
17411 18448       al  w0  x2+8      ;   dump message(0:8);
17412 18450       al  w1  x2+8+8    ;
17413 18452       jl. w3  f5.       ;
17414 18454  f1:                    ;
17415 18454  e.z.                   ;*****test1*****
17416 18454       bz  w3  6         ;
17417 18456       am      x3        ;
17418 18458       jl.    (x3+2)     ;   goto case operation of
17419 18460       m11               ;    (0: start transmitter(mode),
17420 18462       -1                ;     1: not allowed,
17421 18464       -1                ;     2: not allowed,
17422 18466       m12               ;     3: receive block,
17423 18468       m13               ;     4: reset,
17424 18470       m14               ;     5: transmit block,
17425 18472       m14               ;     6: autoload,
17426 18474       -1                ;     7: not allowed,
17427 18476       m15               ;     8: master clear);
17428 18478  
17428 18478  ; reset.
17429 18478  m13: al  w0  4         ; reset:
17430 18480  
17430 18480       jl. w3  n14.      ;   clear subprocesses(main,function);
17431 18482       al  w0     0      ;   w1 := receiver
17432 18484       al  w1  x1+p200   ;   receiver.state := idle
17433 18486       rs  w0  x1+p0     ;   
17434 18488       rl  w1  x1+a235   ;
17435 18490       al  w0     4      ;   reset receiver
17436 18492       jd      1<11+2    ;
17437 18494       rl. w2  i5.       ;   load mess buffer;
17438 18496       al  w0  0         ;
17439 18498       rs  w0  g20       ;   status(mess):=0;
17440 18500       jl  w3  g18       ;   deliver result(status);
17441 18502       jl     (b20)      ;   goto std waiting point;
17442 18504  
17442 18504  ; start transmitter.
17443 18504  ; message received from main when a master clear or accept master clear
17444 18504  ; operation must be send to the front end. 
17445 18504  m11: jl  w3  g18       ; start transmitter: deliver result1(dummy);
17446 18506       al. w1  i4.       ;
17447 18508       rl. w2  i5.       ;
17448 18510  ;     jl  w3     d81   ;
17449 18510       jd     1<11+18   ; wait answer
17450 18512  ;     jl  w3     d80   ;  lock monitor
17451 18512       rl  w1  b19       ;
17452 18514       jl. w3  n5.       ;   set host-id;
17453 18516       al  w0  0         ;
17454 18518       hs  w0  x1+p67    ;   errorcount:=0;
17455 18520  j2:  al  w0  0         ; repeat: function:= remove remote, clean local;
17456 18522       jl. w3  n14.      ;   clear subprocesses(main,function);
17457 18524       bz  w0  x1+p67    ;
17458 18526       ba. w0  1         ;   errorcount:=errorcount + 1;
17459 18528       hs  w0  x1+p67    ;
17460 18530       sl  w0  p141      ;   if errorcount>max errorcount then
17461 18532       am      4.00200   ;     operation:=long delay;
17462 18534       al  w3  4.00000   ;   else operation:=no delay;
17463 18536       bz  w0  x1+s17    ;
17464 18538       sz  w0  2.01      ;   if mode=accept master clear then
17465 18540       am      4.20000   ;     operation:=operation and acc master clear,no test;
17466 18542       al  w3  x3+4.00001;   else operation:=operation and dummy,no test;
17467 18544       sz  w0  2.10      ;   if mode=initiate then
17468 18546       al  w3  x3+4.03100;     operation:=operation and reset,short delay, initiate;
17469 18548       hs  w3  x1+p73    ;   operation(trm):=operation;
17470 18550       jl. w3  e11.      ;   call transmitter(operation);
17471 18552  c.p101 b.f1 w.         ;*****test4*****
17472 18552       rs. w3  f0.       ;
17473 18554       jl. w3  f4.       ;
17474 18556       4                 ;
17475 18558  f0:  0                 ;
17476 18560       jl.     f1.       ;
17477 18562       al  w0  x1+p73    ;
17478 18564       al  w1  x1+p77    ;
17479 18566       jl. w3  f5.       ;
17480 18568  f1:                    ;
17481 18568  e.z.                   ;*****test4*****
17482 18568       bl  w0  x1+p74    ;
17483 18570       jl. w3     n2.    ; check errorcount
17484 18572       se  w0       0    ; if result ok then 
17485 18574       jl.         j2.   ; begin
17486 18576       hs  w0  x1+s16    ; protocol mode:  dcp 
17487 18578       al  w2       0    ; clear message block
17488 18580       rx  w2  x1+a56    ; if pending master clear message then 
17489 18582       sn  w2       0    ; 
17490 18584       jl.         m2.   ;
17491 18586       rs  w2     b18    ; begin 
17492 18588       al  w0       1    ;    if not regretted deliver(message, result, return)
17493 18590       so  w2     2.01   ; end
17494 18592       jl  w3     g18    ; end
17495 18594       jl.     m2.       ;   goto continue transmit;
17496 18596  
17496 18596  ; receive block.
17497 18596  m12: al  w1  x1+p200   ; receive block:
17498 18598       rs  w1  b19       ;   curr:=receiver;
17499 18600       jl.     h86.      ;   goto receiver;
17500 18602  
17500 18602  ; transmit block, autoload.
17501 18602  m14: al  w1  x1+p201   ; transmit block, autoload:
17502 18604       rs  w1  b19       ;   curr:=transmitter;
17503 18606       jl.     (h87.)    ;   goto transmitter;
17504 18608  
17504 18608  ; transmit master clear.
17505 18608  ; all (remote and local (temp and perm)) links must be cleaned i.e. messages
17506 18608  ; returned with result 4.
17507 18608  ; All remote (=temp) subprocesses must be removed.
17508 18608  ; the subhost must be cleaned.
17509 18608  ; This applies to the local fe as well as to all dh connected through
17510 18608  ; this fe.
17511 18608  m15:                   ; transmit master clear:
17512 18608       rl  w0  x1+a56    ; if pending master clear message then
17513 18610       se  w0  0         ; deliver result(unintelligble)
17514 18612       jl      g5        ; goto std waiting point
17515 18614       rs  w2  x1+a56    ;
17516 18616       al  w1  x1+a54    ; link message in q
17517 18618       jl  w3  d6        ;
17518 18620       rl  w1  b19       ; restore main
17519 18622  m16: al  w0  0         ; break-down:
17520 18624       hs  w0  x1+p67    ;   errorcount:=0;
17521 18626  c.p101 b.f1 w.         ;*****test7*****
17522 18626       rs. w3  f0.       ;
17523 18628       jl. w3  f4.       ;
17524 18630       7                 ;
17525 18632  f0:  0                 ;
17526 18634       jl.     f1.       ;
17527 18636       al  w0  x1+2      ;
17528 18638       jl. w3  f5.       ;
17529 18640  f1:                    ;
17530 18640  e.z.                   ;*****test7*****
17531 18640       jl. w3  n5.       ;   set host-id;
17532 18642  j0:  al  w0  0         ; repeat: function:= remove remote, clean local;
17533 18644       jl. w3  n14.      ;   clear subprocesses(main,function);
17534 18646       bz  w0  x1+p67    ;
17535 18648       ba. w0  1         ;   errorcount:=errorcount + 1;
17536 18650       hs  w0  x1+p67    ;
17537 18652       sl  w0  p141      ;   if errorcount>max errorcount then
17538 18654       am      4.00100   ;     delay:=long delay;
17539 18656       al  w0  4.13101   ;   else delay:=short delay;
17540 18658       hs  w0  x1+p73    ;   operation(trm):=master clear,initiate,reset,delay,error action off;
17541 18660       jl. w3  e11.      ;   call transmitter(operation);
17542 18662       bl  w0  x1+p74    ;
17543 18664  c.p101 b.f1 w.         ;*****test5*****
17544 18664       rs. w3  f0.       ;
17545 18666       jl. w3  f4.       ;
17546 18668       5                 ;
17547 18670  f0:  0                 ;
17548 18672       jl.     f1.       ;
17549 18674       al  w0  x1+2      ;
17550 18676       jl. w3  f5.       ;
17551 18678  f1:                    ;
17552 18678  e.z.                   ;*****test5*****
17553 18678       jl. w3     n2.    ; check errorcount
17554 18680  
17554 18680       se  w0  0         ;   if result<>ok then
17555 18682       jl.     j0.       ;     goto repeat;
17556 18684  j1:  al  w0  4.03111   ;   operation(rec):=initiate,reset,short delay,
17557 18686       hs  w0  x1+p93    ;                   header,error actions off;
17558 18688       zl  w0  x1+p67    ;  update no of retries
17559 18690       ba. w0       1    ;
17560 18692       hs  w0  x1+p67    ;
17561 18694       jl. w3  e10.      ;   call receiver(operation);
17562 18696       bl  w0  x1+p94    ;
17563 18698  c.p101 b.f1 w.         ;*****test6*****
17564 18698       rs. w3  f0.       ;
17565 18700       jl. w3  f4.       ;
17566 18702       6                 ;
17567 18704  f0:  0                 ;
17568 18706       jl.     f1.       ;
17569 18708       al  w0  x1+2      ;
17570 18710       jl. w3  f5.       ;
17571 18712  f1:                    ;
17572 18712  e.z.                   ;*****test6*****
17573 18712       jl. w3     n2.    ; check errorcount
17574 18714       sn  w0  8         ;   if result=abnormal termination(reset rec) then
17575 18716       jl.     j1.       ;     goto restart rec;
17576 18718       se  w0  10        ;   if result<>accept master clear then
17577 18720       jl.     j0.       ;     goto repeat;
17578 18722       al. w2  i2.       ;   message:=start trm, poll;
17579 18724       jl. w3  n4.       ;   send trm message(message);
17580 18726       al  w0  4.01010   ;
17581 18728       hs  w0  x1+p93    ;   operation:=initiate,header;
17582 18730       jl.     m0.       ;   goto start receiver;
17583 18732  
17583 18732  
17583 18732  ; master clear received from device controller.
17584 18732  ; all (remote and local (temp and perm)) links must be cleaned i.e. messages
17585 18732  ; returned with result 4.
17586 18732  ;all remote (=temp) subprocesses must be removed.
17587 18732  ; the subhost must be cleaned.
17588 18732  ; this applies to the local fe as well as to all dh connected through
17589 18732  ; this fe.
17590 18732  m8:  al  w0  0         ; master clear received: function:= remove remote, clean local;
17591 18734       jl. w3  n14.      ;   clear subprocesses(main,function);
17592 18736  c.p101 b.f1 w.         ;*****test2*****
17593 18736       rs. w3  f0.       ;
17594 18738       jl. w3  f4.       ;
17595 18740       2                 ;
17596 18742  f0:  0                 ;
17597 18744       jl.     f1.       ;
17598 18746       al  w0  x1+2      ;
17599 18748       jl. w3  f5.       ;
17600 18750  f1:                    ;
17601 18750  e.z.                   ;*****test2*****
17602 18750       al. w2  i7.       ;   message:=start trm, reset, initiate, acc master clear;
17603 18752       jl. w3  n4.       ;   send trm message(message);
17604 18754       al  w0  4.01010   ;
17605 18756       hs  w0  x1+p93    ;   operation:=initiate,header;
17606 18758       jl.     m0.       ;   goto start receiver;
17607 18760  
17607 18760  e.
17608 18760  h87:         h88       ; address of start transmit
17609 18762  \f


17609 18762  
17609 18762  ; receive part.
17610 18762  
17610 18762  b.j20,i10 w.
17611 18762  
17611 18762  m0:  jl. w3  e10.      ; start receive: call receiver;
17612 18764  m3:  bz  w3  x1+p94    ; continue receive:
17613 18766  c.p101 b.f1 w.         ;*****test8*****
17614 18766       rs. w3  f0.       ;
17615 18768       jl. w3  f4.       ;
17616 18770       8                 ;
17617 18772  f0:  0                 ;
17618 18774       jl.     f1.       ;
17619 18776       al  w0  x1+p95    ;
17620 18778       al  w1  x1+p95+14 ;
17621 18780       jl. w3  f5.       ;
17622 18782  f1:                    ;
17623 18782  e.z.                   ;*****test8*****
17624 18782       se  w3  0         ;   if result<>ok then
17625 18784       jl.     j8.       ;     goto check result;
17626 18786       bz  w0  x1+p97    ;
17627 18788       so  w0  4.00002   ;   if no dataflag then
17628 18790       jl.     j0.       ;    goto header;
17629 18792       hs  w3  x1+p80    ; data: internal status:=result(:=0);
17630 18794       rl  w2  x1+p90    ;   sub:=sub(rec);
17631 18796       jl. w3  e4.       ;   call entry4(sub);
17632 18798       bz  w0  x1+p97    ;
17633 18800  j0:  so  w0  4.00010   ; header: if no headerbit then
17634 18802       jl.     j4.       ;     goto ok;
17635 18804       jl. w3  n0.       ;   packout(header);
17636 18806       bz  w0  x1+p99    ;  if local function=
17637 18808       sn  w0  1         ;     host disconnect then
17638 18810       jl.     j9.       ;  goto clear up
17639 18812       sn  w0  2         ; if local function = host connected
17640 18814       jl.     j10.      ; then remove all links
17641 18816       sn  w0  4         ;  if local function=link not present then
17642 18818       jl.     j11.      ;    goto clean and remove subprocess;
17643 18820       se  w0  0         ;
17644 18822       sn  w0  3         ;  if local function<>0 and
17645 18824       jl.     +4        ;     local function<>3 then
17646 18826       jl.     j2.       ;  goto reject
17647 18828       bl  w0  x1+p81    ;
17648 18830       al  w2  x1+p202   ;   if func(header)>=min subproc func value then
17649 18832       sh  w0  v40-1     ;     sub:=subproc(rec);
17650 18834       rs  w2  x1+p90    ;   else
17651 18836       rl  w2  x1+p90    ;     sub:=hostproc(main);
17652 18838       se  w1 (x2+a50)   ;   if main(sub)<>main then
17653 18840       jl.     j2.       ;     goto reject;
17654 18842       bz  w0  x1+p97    ;   if no databit then
17655 18844       so  w0  4.00020   ;     goto out;
17656 18846       jl.     j1.       ;
17657 18848       zl  w0  x1+p81    ;   if headerfunction.databit is off then
17658 18850       sz  w0  1         ;   begin
17659 18852       jl.     j7.       ;
17660 18854  c.p101 b. f1 w.        ;***** test 14 *****
17661 18854       rs. w3  f0.       ;
17662 18856       jl. w3  f4.       ;
17663 18858       14
17664 18860  f0:  0                 ; dump receiver parameters:
17665 18862       jl.     f1.       ;   line param
17666 18864       al  w0  x1+p86    ;   packet control param
17667 18866       al  w1  x1+p95    ;   device control param
17668 18868                         ;   internal mainproc param
17669 18868       jl. w3  f5.       ; 
17670 18870  f1:                    ;
17671 18870  e.z.                   ;***** test 14 *****
17672 18870       jl. w3  e4.       ;     call sub(entry 4);
17673 18872       jl.     j3.       ;     goto setup(blockcontrol=skip);
17674 18874  j7:                    ;   end;
17675 18874       jl. w3  e3.       ;   call entry3(sub);
17676 18876       bz  w0  x1+p80    ;
17677 18878       al  w3  4.00012   ;  operation:= if internal status=ok then
17678 18880       se  w0  p160      ;              data else header
17679 18882       al  w3  4.00010   ;
17680 18884       jl.     j6.       ;   goto setup1;
17681 18886  j1:  jl. w3  e4.       ; out:
17682 18888       bz  w0  x1+p80    ;   call entry4(sub);
17683 18890       jl.     j5.       ;   goto setup;
17684 18892  
17684 18892  j2:  am      p163-p162 ; reject: blockcontrol:=reject;
17685 18894  j3:  am      p162-p160 ; skip:   blockcontrol:=skip;
17686 18896  j4:  al  w0  p160      ; ok:     blockcontrol:=ok;
17687 18898  j5:  al  w3  4.00010   ; setup: operation:=header;
17688 18900  j6:  hs  w0  x1+p96    ; setup1: blockcontrol(main):=blockcontrol;
17689 18902       hs  w3  x1+p93    ;   operation(main):=operation;
17690 18904       ld  w0  -100      ;
17691 18906       ds  w0  x1+p95+2  ;   clear header rec area;
17692 18908       ds  w0  x1+p95+6  ;
17693 18910       ds  w0  x1+p95+10 ;
17694 18912       ds  w0  x1+p95+14 ;
17695 18914       jl.     m0.       ;   goto start receive;
17696 18916  
17696 18916  j8:                    ; check result:
17697 18916  c.p101 b.f1 w.         ;*****test9*****
17698 18916       rs. w3  f0.       ;
17699 18918       jl. w3  f4.       ;
17700 18920       9                 ;
17701 18922  f0:  0                 ;
17702 18924       jl.     f1.       ;
17703 18926       al. w0  f0.       ;
17704 18928       al. w1  f1.       ;
17705 18930       al  w2  2         ;
17706 18932       jl. w3  f6.       ;
17707 18934  f1:                    ;
17708 18934  e.z.                   ;*****test9*****
17709 18934       sn  w3  9         ;   if result=master clear then
17710 18936       jl.     m8.       ;     goto master clear;
17711 18938       sl  w3  4         ;   i result>3 then
17712 18940       jl.     m16.      ;     goto break-down;
17713 18942       al  w3  x3+3      ;   internal status:=result+3;
17714 18944       hs  w3  x1+p80    ;
17715 18946       rl  w2  x1+p90    ;   sub:=sub(rec);
17716 18948       jl. w3  e4.       ;   call entry4(sub);
17717 18950       jl.     j3.       ;   goto skip;
17718 18952  
17718 18952  ; a host has been disconnected from the network.
17719 18952  ; messages queued up at the subhost concerning the disconnected host must
17720 18952  ; be returned with result 4 (receiver malfunction).
17721 18952  ; all remote (temp) and local (perm) subprocesses concerning this host must
17722 18952  ; be cleaned (i.e. return messages with result 4), and the remote subprocesses
17723 18952  ; must be removed too.
17724 18952  ;
17725 18952  ; w1 = main.
17726 18952  
17726 18952  j9:                    ;
17727 18952  c.p101 b. f1 w.        ;***** test 10 *****
17728 18952       rs. w3     f0.    ;
17729 18954       jl. w3     f4.    ;  dump receive area
17730 18956       10                ;
17731 18958  f0:  0                 ;
17732 18960       jl.        f1.    ;
17733 18962       al  w0  x1+p80    ;
17734 18964       al  w1  x1+p90    ;
17735 18966       jl. w3     f5.    ;
17736 18968  f1:                    ;
17737 18968  e.z.                   ;***** test 10 *****
17738 18968                         ;
17739 18968       al  w3  x1        ;
17740 18970       zl  w1  x3+p322   ;  homereg := sender.homereg;
17741 18972       ls  w1    +12     ;
17742 18974       ba  w1  x3+p321   ;  netid := sender.netid;
17743 18976       rl  w0  x3+p323   ;  hostid := sender.hostid;
17744 18978       al  w2  x3+p202   ;  subhost := this fpa.subhost;
17745 18980       jl. w3     n18.   ;  partly cleaning of subhost(homereg, netid,
17746 18982                         ;                             hostid, subhost);
17747 18982       al  w1  x2-p202   ;  main := this fpa.main;
17748 18984       rl  w0  x1+p323   ;  hostid := sender.hostid;
17749 18986       zl  w2  x1+p321   ;  netid := sender.netid;
17750 18988       jl. w3     n17.   ;  remove remote clear local subprocs(hostid, main, netid);
17751 18990       jl.        j4.    ;  goto ok;
17752 18992  
17752 18992  
17752 18992  ;
17753 18992  ; local host connected.
17754 18992  ; the fe has just been autoloaded.
17755 18992  ; all (temp and perm) links to this fe must be cleaned (messages returned
17756 18992  ; with result 4) and removed.
17757 18992  ; all links to dh connected through this fe must be cleaned and temp links
17758 18992  ; must be removed.
17759 18992  ; the subhost must be cleaned.
17760 18992  ;
17761 18992  ; w1 = main
17762 18992  
17762 18992  j10:                   ;
17763 18992  c.p101  b. f1 w.       ;***** test 11 *****
17764 18992       rs. w3     f0.    ;
17765 18994       jl. w3     f4.    ;  dump receive area
17766 18996       11                ;
17767 18998  f0:  0                 ;
17768 19000       jl.        f1.    ;
17769 19002       al  w0  x1+p80    ;
17770 19004       al  w1  x1+p90    ;
17771 19006       jl. w3     f5.    ;
17772 19008  f1:                    ;                    
17773 19008  e.z.                   ;***** test 11 *****
17774 19008                         ;
17775 19008       al  w2  x1+p202   ;  subhost := this fpa.subbhost;
17776 19010       jl. w3     n16.   ;  clean subproc(subhost);
17777 19012                         ;  <* clean and remove all links to devices connected
17778 19012                         ;     to the local fe *>
17779 19012       rl  w0  x1+p323   ;  hostid := sender.hostid; <* i.e. local fe *>
17780 19014       zl  w2  x1+p321   ;  netid := sender.netid;
17781 19016       jl. w3     n15.   ;  clear and remove subproc(hostid, main, netid);
17782 19018                         ;
17783 19018                         ;<* only local and remote subprocs to dh connected
17784 19018                         ;   through this fe should be left now - clean the
17785 19018                         ;   local and remove the remote subprocs *>
17786 19018       al  w0     0      ;  hostid := dummy;
17787 19020       zl  w2  x1+p321   ;  netid := sender.netid;
17788 19022       jl. w3     n17.   ;  remove remote clean local subprocs(hostid, main, netid);
17789 19024       jl.        j4.    ;  goto ok;
17790 19026  
17790 19026  
17790 19026  
17790 19026  ; link not present at device host.
17791 19026  ; a communication to a link which was not present at the device host,
17792 19026  ; was initiated. clean and remove the specified link in rc8000.
17793 19026  ; w1=main
17794 19026  
17794 19026  j11: rl  w2  x1+p90    ;  subproc := main.current subproc;
17795 19028       jl. w3     n16.   ;  clean subproc(subproc);
17796 19030       jl. w3    (i0.)   ;  remove subproc(subproc);
17797 19032       jl.        j4.    ;  goto ok;
17798 19034                         ;
17799 19034  i0:  v102              ;  address of remove subprocess  
17800 19036  
17800 19036  
17800 19036  
17800 19036  e.
17801 19036  \f


17801 19036  
17801 19036  ; transmit part.
17802 19036  
17802 19036  b.j10, i10 w.
17803 19036  
17803 19036  m1:  jl. w3  e11.      ; start transmit: call transmitter;
17804 19038  m2:  bz  w3  x1+p74    ; continue transmit:
17805 19040  c.p101 b.f1 w.         ;*****test12*****
17806 19040       rs. w3  f0.       ;
17807 19042       jl. w3  f4.       ;
17808 19044       12                ;
17809 19046  f0:  0                 ;
17810 19048       jl.     f1.       ;
17811 19050       al  w0  x1+p75    ;
17812 19052       al  w1  x1+p75+14 ;
17813 19054       jl. w3  f5.       ;
17814 19056  f1:                    ;
17815 19056  e.z.                   ;*****test12*****
17816 19056       se  w3  0         ;   if result<>0 then
17817 19058       jl.     j6.       ;     goto result-error;
17818 19060       bz  w3  x1+p76    ;   status:=blockcontrol;
17819 19062  j2:  hs  w3  x1+p60    ; insert: internal status:=status;
17820 19064       bz  w0  x1+p77    ;
17821 19066       sn  w0  2.0000    ;   if contents=dummy then
17822 19068       jl.     j1.       ;     goto get-next;
17823 19070       sz  w0  2.1000    ;   if databit 
17824 19072       se  w3  p160      ;   or result<>ok then
17825 19074       jl.     j0.       ;     goto aftertrm;
17826 19076       al  w0  4.00002   ;
17827 19078       hs  w0  x1+p73    ;   operation:=data;
17828 19080       jl.     m1.       ;   goto start transmit;
17829 19082                         ; aftertrm:
17830 19082  
17830 19082  j0:  rl  w2  x1+p70    ;   sub:=subproc(trm);
17831 19084       jl. w3   n12.     ;   queue out(sub);
17832 19086       rl  w0  x2+a50    ;   if main(sub)<>main then
17833 19088       se  w0  x1        ;
17834 19090       jl.     j1.       ;   goto get next subprocess
17835 19092       jl. w3  e2.       ;   call entry2(sub);
17836 19094                         ;   goto get next subprocess;
17837 19094  e7:                    ; entry-get next:
17838 19094  j1:  rl  w2  x1+p14    ; get next:
17839 19096       sn  w2  x1+p14    ;    if queue is empty then
17840 19098       jl.     j4.       ;     goto poll;
17841 19100       al  w2  x2-p14    ;
17842 19102       bz  w0  x1+p60    ;
17843 19104       sn  w0  p161      ;   if internal status=wait and
17844 19106       se  w2 (x1+p70)   ;   and new sub=proc desc then
17845 19108       am      -4.00100  ;     operation:=short delay
17846 19110       al  w0  4.00100   ;   else operation:=no delay;
17847 19112       hs  w0  x1+p73    ;
17848 19114       ld  w0  -100      ;
17849 19116       ds  w0  x1+p60    ;
17850 19118       ds  w0  x1+p72    ;
17851 19120       ds  w0  x1+p79    ;
17852 19122       ds  w0  x1+p303   ;
17853 19124       ds  w0  x1+p64    ;
17854 19126       ds  w0  x1+p62    ;
17855 19128       rs  w0  x1+p63    ;
17856 19130       rs  w2  x1+p70    ;   subproc(rec):=subproc(queue);
17857 19132       jl. w3  e1.       ;   call entry1(sub);
17858 19134       bz  w0  x1+p60    ;
17859 19136       se  w0  p160      ;   if internal status<>ok then
17860 19138       jl.     j3.       ;     goto regretted;
17861 19140       jl. w3  n1.       ;   packin(header);
17862 19142       rl  w0  x1+p66    ;
17863 19144       bz  w3  x1+p73    ;
17864 19146       se  w0  0         ;  if lineparam.size<>0 then
17865 19148       am      4.00020   ;     operation:=header, data;
17866 19150       al  w3  x3+4.00010;   else
17867 19152       hs  w3  x1+p73    ;     operation:=transmit header;
17868 19154       jl.     m1.       ;   goto start transmit;
17869 19156  
17869 19156  j3:  jl. w3  n12.      ; regretted: queue out(sub);
17870 19158       jl.     j1.       ;   goto get next;
17871 19160  
17871 19160  j4:  al  w0  4.00200   ; poll:
17872 19162       hs  w0  x1+p73    ;   operation:=long delay;
17873 19164       jl.     m1.       ;   goto start transmit;
17874 19166  
17874 19166  j5:                    ; special actions:
17875 19166  
17875 19166  j6:                    ; result-error:
17876 19166  c.p101 b.f1 w.         ;*****test13*****
17877 19166       rs. w3  f0.       ;
17878 19168       jl. w3  f4.       ;
17879 19170       13                ;
17880 19172  f0:  0                 ;
17881 19174       jl.     f1.       ;
17882 19176       al. w0  f0.       ;
17883 19178       al. w1  f0.       ;
17884 19180       al  w2  4         ;
17885 19182       sh. w2 (f0.)      ;
17886 19184       am      f6-f5     ;
17887 19186       jl. w3  f5.       ;
17888 19188  f1:                    ;
17889 19188  e.z.                   ;*****test13*****
17890 19188       sl  w3  4         ;   if max errors exceeded then
17891 19190       jl.     m16.      ;     goto break-down;
17892 19192       al  w3  x3+3      ;   status:=result+3;
17893 19194       jl.     j2.       ;   goto insert;
17894 19196  
17894 19196  e.
17895 19196  
17895 19196  \f


17895 19196  
17895 19196  ; main help procedures.
17896 19196  ; packout.
17897 19196  ;        call:        return:
17898 19196  ; w0                  destroyed
17899 19196  ; w1     main         unchanged
17900 19196  ; w2                  unchanged
17901 19196  ; w3     link         destroyed
17902 19196  
17902 19196  
17902 19196  b. i10 w.
17903 19196  n0:                    ; packout:
17904 19196       ds. w3  i1.       ;  save link and w2
17905 19198       dl  w0  x1+p95+2  ;  unpack
17906 19200       al  w2  0         ;
17907 19202       ld  w3  16        ;
17908 19204       rs  w2  x1+p86    ;   line.size
17909 19206       al  w2  0         ;
17910 19208       ld  w3  8         ;
17911 19210       hs  w2  x1+p99    ;   local function
17912 19212                         ;
17913 19212       ld  w0  16        ;
17914 19214       la. w3  i2.       ;
17915 19216       hs  w3  x1+p321   ;   sender net-id
17916 19218       ld  w0  8         ;
17917 19220       la. w3  i2.       ;   sender home-reg
17918 19222       hs  w3  x1+p322   ;
17919 19224                         ;
17920 19224       rl  w0  x1+p95+4  ;
17921 19226       ls  w0  -8        ;
17922 19228       rs  w0  x1+p323   ;   sender host-id
17923 19230                         ;
17924 19230       dl  w3  x1+p95+10 ;
17925 19232       ld  w3  8         ;
17926 19234       la. w2  i3.       ;
17927 19236       hs  w2  x1+p98    ;   sender linkno
17928 19238       al  w2  0         ;
17929 19240       ld  w3  6         ;   
17930 19242       hs  w2  x1+p328   ;   data quality
17931 19244       ls  w3  -14       ;
17932 19246       bz  w0  x1+p99    ;
17933 19248       se  w0  3         ;   if local function=3 (regretted) then
17934 19250       jl.     i10.      ;     exchange sender linkno, receiver linkno;
17935 19252       bz  w0  x1+p98    ;
17936 19254       hs  w3  x1+p98    ;
17937 19256       rl  w3  0         ;
17938 19258  i10: hs  w3  x1+p89    ;
17939 19260       ls  w3  1         ;   index:=rec linkno*2 + name table start;
17940 19262       wa  w3  b4        ;
17941 19264       rl  w3  x3        ;  current proc(main):= proc(index)
17942 19266       rs  w3  x1+p90    ;
17943 19268                         ;
17944 19268       dl  w0  x1+p95+14 ;
17945 19270       al  w2  0         ;
17946 19272       ld  w3  16        ;
17947 19274       rs  w2  x1+p84    ;   header.size
17948 19276       al  w2  0         ;
17949 19278       ld  w3  8         ;
17950 19280       hs  w2  x1+p88    ;   bufno
17951 19282                         ;
17952 19282       rl  w2  0         ;  
17953 19284       la. w2  i4.       ;
17954 19286       rs  w2  x1+p83    ;   status
17955 19288       al  w3  0         ;
17956 19290       ld  w0  8         ;
17957 19292       hs  w3  x1+p81    ;   function
17958 19294       al  w3  0         ;
17959 19296       ld  w0  3         ;
17960 19298       hs  w3  x1+p82    ;   result
17961 19300                         ;
17962 19300       dl. w3  i1.       ;  restore w2
17963 19302       jl      x3        ;  goto link  
17964 19304  
17964 19304  i0:  0                 ;  saved w2
17965 19306  i1:  0                 ;  saved w3
17966 19308  i2:  8.377             ;  last 8 bits
17967 19310  i3:  8.1777            ;  last 10 bits
17968 19312  i4:  8.177777          ;  last 16 bits
17969 19314  
17969 19314  e.                     ; end of packout
17970 19314  
17970 19314  ; packin.
17971 19314  ;        call:         return:
17972 19314  ; w0                   destroyed
17973 19314  ; w1     main          unchanged
17974 19314  ; w2                   unchanged
17975 19314  ; w3     link          unchanged
17976 19314  b. i10 w.
17977 19314  n1:                    ; packin:
17978 19314       rs. w3  i0.       ;  save link
17979 19316       rl  w2  x1+p66    ;  packin
17980 19318       ls  w2  8         ;  size
17981 19320       ba  w2  x1+p79    ;
17982 19322       rs  w2  x1+p75+0  ;   local function
17983 19324                         ;
17984 19324       bz  w3  x1+p301   ;   format(packet):= 0
17985 19326       ls  w3  8         ;   rec net-id
17986 19328       ba  w3  x1+p302   ;
17987 19330       ds  w3  x1+p75+2  ;   rec home-reg
17988 19332                         ;
17989 19332       rl  w2  x1+p303   ;   rec host-d
17990 19334       rl  w3  x1+p304   ;   packet-id
17991 19336       rl  w0  x1+p305   ;   facility mask
17992 19338                         ;
17993 19338       ls  w2  8         ;
17994 19340       ls  w0  8         ;
17995 19342       ld  w0  -8        ;
17996 19344       wa  w2  6         ;
17997 19346       rs  w2  x1+p75+4  ;
17998 19348       rs  w0  x1+p75+6  ;
17999 19350                         ;
18000 19350       bz  w2  x1+p78    ;   format(mes):= 0, sender linkno
18001 19352       al  w3  0         ;
18002 19354       ld  w3  -8        ;
18003 19356       rs  w2  x1+p75+8  ;   data quality
18004 19358       bz  w2  x1+p308   ;
18005 19360       ls  w2  10        ; 
18006 19362       wa  w2  6         ;
18007 19364       ba  w2  x1+p69    ;   receiver linkno
18008 19366       rs  w2  x1+p75+10 ;
18009 19368                         ;
18010 19368       rl  w2  x1+p64    ;   size
18011 19370       ls  w2  8         ;
18012 19372       ba  w2  x1+p68    ;   bufferno
18013 19374       rs  w2  x1+p75+12 ;
18014 19376                         ;
18015 19376       bz  w3  x1+p61    ;
18016 19378       ls  w3  3         ;   function
18017 19380       ba  w3  x1+p62    ;
18018 19382       ls  w3  13        ;
18019 19384       lo  w3  x1+p63    ;   mode
18020 19386       rs  w3  x1+p75+14 ;
18021 19388                         ;
18022 19388       jl.     (i0.)     ;  goto return
18023 19390  
18023 19390  i0:  0                 ; saved link
18024 19392  
18024 19392  e.                     ; end of packin
18025 19392  
18025 19392  ; check errorcount
18026 19392  ; returns a possible masterclear message if errorcount(trm) > max tries
18027 19392  ;
18028 19392  ;     call      return
18029 19392  ; w0            unchanged
18030 19392  ; w1 main       unchanged
18031 19392  ; w2            destroyed
18032 19392  ; w3 link       destroyed
18033 19392  ;
18034 19392  b. i2  w.
18035 19392  n2:  zl  w2  x1+p67    ; if errorcount(trm) < maxtries then
18036 19394       sh  w2     p140   ; return
18037 19396       jl      x3        ; else
18038 19398       al  w2       0    ;  answer (possible) master clear message
18039 19400       rs  w2     g20    ; with result malfunction
18040 19402       rx  w2  x1+a56    ;
18041 19404       sn  w2     0      ;
18042 19406       jl      x3        ;
18043 19408       rs  w2     b18    ; start transmitter(master clear)
18044 19410       ds. w1     i1.    ; save  w0 w1 w3
18045 19412       rs. w3     i2.    ;
18046 19414       al  w0       4    ; ( if fe later sends a master clear the protocol will start
18047 19416       so  w2      2.01  ;
18048 19418       jl  w3     g19    ;
18049 19420       dl. w1     i1.    ;
18050 19422       jl.       (i2.)   ;
18051 19424  
18051 19424  i0: 0                  ; saved w0
18052 19426  i1: 0                  ; saved w1 (main)
18053 19428  i2: 0                  ; saved w3 (return)
18054 19430  
18054 19430  e.
18055 19430  
18055 19430  
18055 19430  ; send trm message.
18056 19430  ;        call:         return:
18057 19430  ; w0                   destroyed
18058 19430  ; w1     main          unchanged
18059 19430  ; w2     addr(mess)    destroyed
18060 19430  ; w3     link          destroyed
18061 19430  b.i4 w.
18062 19430  n4:  rs. w3  i0.       ; send trm message: save link;
18063 19432       dl  w0  x1+a11+2  ;
18064 19434       ds. w0  i2.       ;
18065 19436       dl  w0  x1+a11+6  ;   transfer name of main proc;
18066 19438       ds. w0  i3.       ;
18067 19440       al  w1  x2        ;   message:=message;
18068 19442       al. w3  i1.       ;   receiver:=main;
18069 19444       jd      1<11+16   ;   send message;
18070 19446       rl  w1  b19       ;
18071 19448       jl.    (i0.)      ; exit: return to link;
18072 19450  i0:  0                 ;  saved link
18073 19452  i1:  0                 ;  name of mainproc
18074 19454  i2:  0                 ;
18075 19456       0                 ;
18076 19458  i3:  0                 ;
18077 19460       0                 ;  name table entry
18078 19462  e.
18079 19462  
18079 19462  
18079 19462  ; set host-id.
18080 19462  ;        call:         return:
18081 19462  ; w0
18082 19462  ; w1     main          unchanged
18083 19462  ; w2
18084 19462  ; w3     link          destroyed
18085 19462  b.i1 w.
18086 19462  n5:  rs. w3  i0.       ; set host-id: save link;
18087 19464       rl  w0  x1+s7     ;
18088 19466       la. w0  i1.       ;   host-id(main):=
18089 19468       rs  w0  x1+p303   ;     host-id(main);
18090 19470       rl  w0  x1+s7     ;
18091 19472       ls  w0  -16       ;   home-reg(trm):= home-reg(main);
18092 19474       hs  w0  x1+p302   ;
18093 19476       al  w0  2         ;   local function(trm):= host-up;
18094 19478       hs  w0  x1+p79    ;
18095 19480       jl. w3  n1.       ;   packin;
18096 19482       jl.    (i0.)      ; exit: return to link;
18097 19484  i0:  0                 ;  saved link
18098 19486  i1:  8.17 7777         ;  last 16 bits
18099 19488  e.
18100 19488  
18100 19488  
18100 19488  ; queue out(sub).
18101 19488  ; removes a subprocess from the process queue of the mainprocess.
18102 19488  ;        call:         return:
18103 19488  ; w0                   unchanged
18104 19488  ; w1                   unchanged
18105 19488  ; w2     subproc       unchanged
18106 19488  ; w3     link          destroyed
18107 19488  b.i6 w.
18108 19488  v103:                  ;
18109 19488  n12: ds. w3  i1.       ; queue out:
18110 19490       al  w2  x2+p14    ;
18111 19492       jl  w3  d5        ;   remove element;
18112 19494       rl. w2  i0.       ;
18113 19496       jl.    (i1.)      ; exit: return;
18114 19498  i0:  0                 ; saved w2
18115 19500  i1:  0                 ; saved link
18116 19502  e.
18117 19502  ; clear all subprocesses(main,function).
18118 19502  ;         call:         return:
18119 19502  ; w0      function      destr.
18120 19502  ; w1      main          unchanged
18121 19502  ; w2                    destr.
18122 19502  ; w3      link          destr.
18123 19502  ;
18124 19502  ; function = 0: remote subprocs are removed ; local subprocs are cleaned
18125 19502  ;               i. e. pending messages are returned with result 4.
18126 19502  ;  
18127 19502  ;            2: all subprocs are removed.
18128 19502  ;
18129 19502  ;            4: all subprocs are cleaned.
18130 19502    
18130 19502  b.i10,j10 w.
18131 19502  n14: ds. w0  i8.       ; clear subprocesses:
18132 19504       al  w2  x1+p202   ;   proc:=host;
18133 19506       jl. w3  n16.      ;   clean subprocess(proc);
18134 19508       al  w2  x2+p19    ;
18135 19510       al  w0  0         ;
18136 19512  j4:  rs  w0  x2        ;   for bufno:=0,1,..,v3-1 do
18137 19514       al  w2  x2+2      ;     message(bufno):=0;
18138 19516       sh  w2  x1+p100-a48+p19+v3<1-2 ;
18139 19518       jl.     j4.       ;
18140 19520       al  w0  0         ;   host-id:=undefined;
18141 19522       jl. w3  n15.      ;   clear subprocesses(host-id,main,net-id);
18142 19524       al  w0  2         ; 
18143 19526       rs. w0  i8.       ;   function:= 2(remove);
18144 19528       jl.     (i7.)     ; exit: return
18145 19530  i7:  0                 ;   saved link
18146 19532  i8:  2                 ;   function
18147 19534  
18147 19534  
18147 19534  ; remove remote clean local subprocs(hostid, main, netid);
18148 19534  ;
18149 19534  ; all permanent and temporary links connected to the specified devicehost
18150 19534  ; are cleaned i.e. messages are returned with result 4 (receiver malfunction).
18151 19534  ; all temporary (remote) links are then removed.
18152 19534  ; if the hostid has dummy value (= 0) then all subprocesses connected to the
18153 19534  ; main process are processed.
18154 19534  ;
18155 19534  ;       call                      return
18156 19534  ; w0:  hostid                    destroyed
18157 19534  ; w1:  main                      unchanged
18158 19534  ; w2:  netid                     destroyed
18159 19534  ; w3:  link                      destroyed
18160 19534  ;
18161 19534  
18161 19534  n17:                   ;begin
18162 19534       rs. w3     i9.    ;  save link;
18163 19536       al  w3     0      ;
18164 19538       rs. w3     i8.    ;  function := remove remote and clean local;
18165 19540       jl. w3     n15.   ;  clear subprocesses(hostid, main, netid);
18166 19542                         ;
18167 19542       al  w3     2      ;  function := remove all subprocesses;
18168 19544       rs. w3     i8.    ;  <* default value *>
18169 19546       jl.       (i9.)   ;  return;
18170 19548                         ;
18171 19548  i9:             0      ;  save link
18172 19550                         ;end;
18173 19550  
18173 19550  
18173 19550  
18173 19550  
18173 19550  ; clear subprocesses(host-id,main,net-id).
18174 19550  ; the procedure clears all subprocesses that are connected to the device
18175 19550  ; host in question. if the host-id has dummy value (=0) then all
18176 19550  ; subprocesses connected to the main process are cleared.
18177 19550  ;        call          return
18178 19550  ; w0     host-id       destroyed
18179 19550  ; w1     main          unchanged
18180 19550  ; w2     net-id        destroyed
18181 19550  ; w3     link          destroyed
18182 19550  n15: ds. w1  i1.       ; clear subprocesses:
18183 19552       ds. w3  i3.       ;   save w0-w3;
18184 19554       rl  w3  b4        ;   entry:=first entry in name table ;
18185 19556       al  w3  x3-2      ;
18186 19558  j0:  al  w3  x3+2      ; next: entry:=next entry in name table;
18187 19560       sl  w3 (b5)       ;   if entry>last dev entry then
18188 19562       jl.    (i3.)      ; exit: return;
18189 19564       rl  w2  x3        ;   proc:=proc(entry);
18190 19566       se  w1 (x2+a50)   ;   if mainproc(proc)<>mainproc then
18191 19568       jl.     j0.       ;     goto next;
18192 19570       rl  w0  x2+a10    ;   kind:= kind(proc);
18193 19572       se  w0  p112      ;   if kind <> remote subkind and
18194 19574       sn  w0  p113      ;      kind <> local subkind
18195 19576       jl.     j7.       ;      then goto next;
18196 19578       jl.     j0.       ;
18197 19580  j7:
18198 19580       rl. w0  i0.       ;
18199 19582       sn  w0  0         ;   if host-id<>dummy then
18200 19584       jl.     j1.       ;     if host-id<>host-id(sub)
18201 19586       se  w0 (x2+p5)    ;     or net-id<>net-id(sub) then
18202 19588       jl.     j0.       ;       goto next;
18203 19590  ;    bz  w0  x2+p7     ;
18204 19590  ;    se. w0 (i2.)      ;***fjernet indtil net-id er defineret
18205 19590  ;    jl.     j0.       ;
18206 19590  j1:  rs. w3  i4.       ;
18207 19592       rl. w3  i8.       ;
18208 19594       jl.     (x3+2)    ;   goto case function of
18209 19596               j5        ;   (0: remove temp,
18210 19598               j6        ;    2: remove subproc,
18211 19600               j2        ;    4: clean subproc)
18212 19602  j5:  rl  w0  x2+a10    ; remove temp:
18213 19604       sn  w0  p112      ;   if proc = local subproc 
18214 19606       jl.     j2.       ;      then goto clean subproc;
18215 19608       se  w0  p113      ;   if proc = remote subproc
18216 19610       jl.     j3.       ;      then goto remove subproc;
18217 19612  j6:  am      +2        ; remove subproc: remove subproc(proc);
18218 19614  j2:  jl. w3  (i5.)     ; clean subproc:  clean subproc(proc);
18219 19616  j3:  rl. w3  i4.       ;
18220 19618       jl.     j0.       ;
18221 19620  i0:  0                 ;   saved host-id
18222 19622  i1:  0                 ;   saved main
18223 19624  i2:  0                 ;   saved net-id
18224 19626  i3:  0                 ;   saved link
18225 19628  i4:  0                 ;   name table address
18226 19630  i5:  v101              ;   address of clean subproc
18227 19632  i6:  v102              ;   address of remove remote subprocess
18228 19634  e.
18229 19634  
18229 19634  ; clean subproc(proc).
18230 19634  ; cleans the sub process by returning all messages in the mess buffer queue with dummy answer.
18231 19634  ;        call:         return:
18232 19634  ; w0                   destroyed
18233 19634  ; w1                   unchanged
18234 19634  ; w2     sub           unchanged
18235 19634  ; w3     link          destroyed
18236 19634  b.i3 w.
18237 19634  v101:                  ;
18238 19634  n16: rs. w3  i0.       ; clean subproc:
18239 19636       rs. w1  i1.       ;   save w1;
18240 19638       al  w1  x2        ;
18241 19640       rx  w2  b19       ;   cur proc:=sub;
18242 19642       rs. w2  i2.       ;   save old curr proc;
18243 19644       jl. w3 (i3.)      ;   clear subproc message queue;
18244 19646       dl. w2  i2.       ;
18245 19648       rx  w2  b19       ;   curr proc:=old curr proc;
18246 19650       jl. w3  n12.      ;   queue out;
18247 19652       jl.    (i0.)      ; exit: return;
18248 19654  i0:  0                 ; saved link
18249 19656  i1:  0                 ; saved w1
18250 19658  i2:  0                 ; saved old curr proc
18251 19660  i3:  v100              ;   address of clear subproc mess queue;
18252 19662  e.
18253 19662  
18253 19662  
18253 19662  
18253 19662  ; partly cleaning of subhost(dh-id, dh-netid, dh-homereg, subhost);
18254 19662  ;
18255 19662  ; all messages queued up at the specified subhost is scanned.
18256 19662  ; if a message is met which is send to the specified device host it is
18257 19662  ; returned with result 4 (receiver malfunction).
18258 19662  ;
18259 19662  ;      call                   return
18260 19662  ; w0:  dh-id                 destroyed
18261 19662  ; w1:  dh-homereg, dh-netid  destroyed
18262 19662  ; w2:  subhost               unchanged
18263 19662  ; w3:  link                  destroyed
18264 19662  ;
18265 19662  b.  i10, j10  w.
18266 19662  
18266 19662  n18:                   ;begin
18267 19662       ds. w1     j1.    ;  save parameters;
18268 19664       ds. w3     j3.    ;
18269 19666       dl  w1     b19    ;  save current message and
18270 19668       ds. w1     j5.    ;       current receiver;
18271 19670       rs  w2     b19    ;  current receiver := subhost;
18272 19672       rl  w0  x2+a10    ;  if subhost.kind <> hostproc kind
18273 19674       se  w0     p111   ;
18274 19676       jl.        i6.    ;  then return;
18275 19678                         ;
18276 19678       al  w1     0      ;  for messno := 0 step 1 until maxmessno do
18277 19680  i1:  rs. w1     j6.    ;  begin
18278 19682       am      x1        ;    message := subhost.message table(2 * messno);
18279 19684       am      x1        ;
18280 19686       rl  w2  x2+p19    ;    if message <> 0 then
18281 19688       sn  w2     0      ;
18282 19690       jl.        i3.    ;    begin
18283 19692       la  w2     g50    ;      <* clear bit 23 in message addr *>
18284 19694       dl. w1     j1.    ;      test message destination(dh-id, dh-homereg,
18285 19696       jl. w3     n19.   ;                               dh-netid, message);
18286 19698       jl.        i3.    ;+0: wrong message destination: goto next message entry;
18287 19700                         ;+2: right message destination:
18288 19700       rl. w1     j2.    ;
18289 19702       rl. w2     j6.    ;      test and decrease stopcount(subhost, messno);
18290 19704       jl. w3    (j7.)   ;
18291 19706                         ;
18292 19706       rl  w0  x1+p13    ;
18293 19708       rl. w2     j6.    ;      if subhost.messagetable(2 * messno) =
18294 19710       am      x2        ;
18295 19712       am      x2        ;
18296 19714       se  w0 (x1+p19)   ;         subhost.current message 
18297 19716       jl.        i2.    ;      then begin
18298 19718       al  w0     0      ;        subhost.current message := 0;
18299 19720       rs  w0  x1+p13    ;
18300 19722       rs  w0  x1+p12    ;        subhost.internal state := ready;
18301 19724  i2:                    ;      end;
18302 19724       al  w3     1      ;      subhost.freebuf := subhost.freebuf + 1;
18303 19726       ba  w3  x1+p16    ;
18304 19728       hs  w3  x1+p16    ;
18305 19730       al  w3     0      ;      subhost.messagetable(2 * messno) := 0;
18306 19732       am      x2        ;
18307 19734       am      x2        ;
18308 19736       rs  w3  x1+p19    ;
18309 19738  i3:                    ;    end <* if message <> 0 *>;
18310 19738       rl. w2     j2.    ;
18311 19740       rl. w1     j6.    ;
18312 19742       al  w1  x1+1      ;
18313 19744       se  w1     v3     ;
18314 19746       jl.        i1.    ;  end <* for messno ... *>;
18315 19748                         ;
18316 19748       al  w0  x2+a54    ;  store subhost.q-head;
18317 19750       rs. w0     j8.    ;
18318 19752       rl  w2  x2+a54    ;  mess :- subhost.q-head.first;
18319 19754  i4:                    ;  while mess<>none do
18320 19754       sn. w2    (j8.)   ;  begin
18321 19756       jl.        i6.    ;    next mess:-mess.next;
18322 19758       rl  w0  x2        ;
18323 19760       rs. w0     j6.    ;
18324 19762       dl. w1     j1.    ;    test message destination(dh-id, dh-homereg,
18325 19764       jl. w3     n19.   ;                             dh-netid, message);
18326 19766       jl.        i5.    ;+0: wrong message destination:
18327 19768                         ;+2: right message destination:
18328 19768       rs  w2     b18    ;
18329 19770       al  w0     4      ;    deliver message(message, result 4);
18330 19772       jl  w3     g19    ;
18331 19774                         ;
18332 19774  i5:  rl. w2     j6.    ;
18333 19776       jl.        i4.    ;  end <* while ... *>;
18334 19778                         ;
18335 19778                         ;
18336 19778  i6:  dl. w1     j5.    ;  restore current message and
18337 19780       ds  w1     b19    ;          current receiver and
18338 19782       rl. w2     j2.    ;          subhost;
18339 19784       jl.       (j3.)   ;end;
18340 19786                         ;
18341 19786  j0:             0      ; save w0: dh-id
18342 19788  j1:             0      ;  "   w1: dh-homereg, dh-netid
18343 19790  j2:             0      ;  "   w2: subhost
18344 19792  j3:             0      ;  "   w3: link
18345 19794  j4:             0      ; save current messae
18346 19796  j5:             0      ; save current receiver
18347 19798  j6:             0      ; messno or next message
18348 19800  j7:             v104   ; address of test and decrease stopcount
18349 19802  j8:             0      ; subhost q-head
18350 19804  
18350 19804  
18350 19804  
18350 19804  ; test message destination(dh-hostid, dh-homereg, dh-netid, message)
18351 19804  ;
18352 19804  ; It is checked whether or not the specified message is a message
18353 19804  ; concerning the device host specified in the parameters.
18354 19804  ;
18355 19804  ;          call               return
18356 19804  ; w0:  dh-hostid             unchanged
18357 19804  ; w1:  dh-homereg, dh-netid  unchanged
18358 19804  ; w2:  message               unchanged
18359 19804  ; w3:  link                  unchanged
18360 19804  ;
18361 19804  ; return: link + 0: message not to device host
18362 19804  ;         link + 2: message to device host
18363 19804  ;
18364 19804  
18364 19804  n19:                   ;
18365 19804       se  w0 (x2+16)    ; if dh-hostid = message.dh-hostid then
18366 19806       jl      x3        ;   
18367 19808  ;    se  w1 (x2+18)    ; and dh-homereg=message.dh-homereg 
18368 19808  ;    jl      x3        ; and dh-netid=message.dh-netid 
18369 19808  ;                      ; <* excluded until defined in net *>
18370 19808       jl      x3+2      ; then return(link+2)
18371 19810                         ; else return(link);
18372 19810  
18372 19810  
18372 19810  e.
18373 19810  \f


18373 19810  
18373 19810  ; each subdriver has six entry points with the functions:
18374 19810  ;
18375 19810  ; entry0 (deliver message):
18376 19810  ;   used when send message delivers a message to the subexternal process.
18377 19810  ;
18378 19810  ; entry1 (set up operation):
18379 19810  ;   used when the mainproc wants the subdriver to start an operation.
18380 19810  ;
18381 19810  ; entry2 (end transfer):
18382 19810  ;   used when the operation - and the datablock - has been sent, and
18383 19810  ;   the receipt received.
18384 19810  ;
18385 19810  ; entry3 (receive operation):
18386 19810  ;   used when a header that includes a following datablock is received.
18387 19810  ;
18388 19810  ; entry4 (end receive):
18389 19810  ;   used when the receive operations are finished.
18390 19810  ;
18391 19810  ; entry5 (initiate process):
18392 19810  ;   used after creation of the subprocess.
18393 19810  ;
18394 19810  ; contents of registers entering the subprocess:
18395 19810  ;   w0: , w1: subproc , w2: , w3: .
18396 19810  ;  current process (b19) : subprocess.
18397 19810  ; 
18398 19810  ; standard return from the subprocess is:
18399 19810  ;   jl    (b101)
18400 19810  ;  w0-w3 undefined.
18401 19810  ; return with initiation is:
18402 19810  ;   am    (b101)
18403 19810  ;   jl     -2
18404 19810  ;  with w2: process description addr of the subprocess which shall be initiated.
18405 19810  ;
18406 19810  ; the adresses of the different entry points are defined in a table at
18407 19810  ; top of the subprocess drivers:
18408 19810  ;  h-name(driver start addr): addr(entry0)
18409 19810  ;                             addr(entry1)
18410 19810  ;                             ....
18411 19810  ;
18412 19810  ;        call:         return:
18413 19810  ; w0                   destroyed
18414 19810  ; w1                   mainproc
18415 19810  ; w2     subproc       destroyed
18416 19810  ; w3     link          destroyed
18417 19810  
18417 19810  b.i10,j10 w.
18418 19810  e0:  am      0-2       ; call(entry0):
18419 19812  e1:  am      2-4       ; call(entry1):
18420 19814  e2:  am      4-6       ; call(entry2):
18421 19816  e3:  am      6-8       ; call(entry3):
18422 19818  e4:  am      8-10      ; call(entry4):
18423 19820  e5:  al  w0  10        ; call(entry5):
18424 19822       se  w0  10        ;   if entry<>entry 5 then
18425 19824       rs. w3  i0.       ;     return addr:=link;
18426 19826       rs  w2  b19       ;   current proc:=subproc;
18427 19828       bl  w3  x2+p10    ;
18428 19830  c.p101 b.f1 w.         ;*****test16*****
18429 19830       rs. w0  i10.      ;
18430 19832       rs. w3  f0.       ;
18431 19834       jl. w3  f4.       ;
18432 19836       16                ;
18433 19838  f0:  0                 ;
18434 19840       jl.     f1.       ;
18435 19842       rs  w0  x3        ;
18436 19844       rs  w1  x3+2      ;
18437 19846       rs  w2  x3+4      ;
18438 19848       rl. w0  f0.       ;
18439 19850       rs  w0  x3+6      ;
18440 19852       al  w0  x3        ;
18441 19854       al  w1  x3+6      ;
18442 19856       jl. w3  f5.       ;
18443 19858  f1:                    ;
18444 19858  e.z.                   ;*****test16*****
18445 19858       al  w1  x2        ;
18446 19860       rl  w2  0         ;
18447 19862       am.    (x3+j0.)   ;
18448 19864       jl     (x2)       ;
18449 19866  
18449 19866       h99               ; -2: hostprocess
18450 19868  j0:  h100              ;  0: general sequential device
18451 19870       h102              ;  2: clock
18452 19872       h104              ;  4: bs-area
18453 19874       h106              ;  6: disc
18454 19876       h108              ;  8: terminal
18455 19878       h110              ; 10: reader
18456 19880       h112              ; 12: punch
18457 19882       h114              ; 14: printer
18458 19884       h116              ; 16: cardreader
18459 19886       h118              ; 18: magtape
18460 19888       h120              ; 20: plotter
18461 19890       h122              ; 22: discette
18462 19892       h124              ; 24: character i-o
18463 19894  
18463 19894  
18463 19894  ; return points from the subprocesses.
18464 19894  
18464 19894       jl.     e5.       ; return(init): (w2: subproc(init)) goto entry 5;
18465 19896  b89: rl  w2  b19       ; return(std):
18466 19898       rl  w1  x2+a50    ;
18467 19900       rs  w1  b19       ;   cur proc:=mainproc;
18468 19902  c.p101 b.f1,j6 w.      ;*****test17*****
18469 19902       rs. w3  f0.       ;
18470 19904       jl. w3  f4.       ;
18471 19906       17                ;
18472 19908  f0:  0                 ;
18473 19910       jl.     f1.       ;
18474 19912       rl. w2  i10.      ;
18475 19914       jl.    (x2+2)     ;
18476 19916       j0                ; 0
18477 19918       j1                ; 1
18478 19920       j2                ; 2
18479 19922       j3                ; 3
18480 19924       j3                ; 4
18481 19926       j3                ; 5
18482 19928  j0:  al  w0  x1+2      ;
18483 19930       jl.     j6.       ;
18484 19932  j1:  al  w0  x1+p66    ;
18485 19934       al  w1  x1+p63    ;
18486 19936       jl.     j6.       ;
18487 19938  j2:  al  w0  x1+p60    ;
18488 19940       al  w1  x1+p60    ;
18489 19942       jl.     j6.       ;
18490 19944  j3:  al  w0  x1+p86    ;
18491 19946       al  w1  x1+p83    ;
18492 19948  j6:  jl. w3  f5.       ;
18493 19950  f1:                    ;
18494 19950  e.z.                   ;*****test17*****
18495 19950       jl.    (i0.)      ; exit: return to link;
18496 19952  
18496 19952  i0:  0                 ; return addr(subproc)
18497 19954  i10: 0                 ; saved entry no
18498 19956  
18498 19956  a66=j0
18499 19956  
18499 19956  e.
18500 19956  \f


18500 19956  
18500 19956  ; call of the receiver and the transmitter is carried out by use of
18501 19956  ; these procedures.
18502 19956  
18502 19956  ; by entry in the trm/rec:
18503 19956  ;   w1: rec/trm , w2: main
18504 19956  
18504 19956  ;        call:         return:
18505 19956  ; w0                   destroyed
18506 19956  ; w1                   main
18507 19956  ; w2                   receiver/transmitter
18508 19956  ; w3     link          destroyed
18509 19956  
18509 19956  e10: rl  w2  b19       ; call receiver:
18510 19958       al  w1  x2+p200   ;   proc:=receiver;
18511 19960       rs  w1  b19       ;
18512 19962       rs  w3  x1+p3     ;   link(rec):=link;
18513 19964       jl.     e8.       ;   goto start-receiver;
18514 19966  
18514 19966  
18514 19966  e11: rl  w2  b19       ; call transmitter:
18515 19968       al  w1  x2+p201   ;   proc:=transmitter;
18516 19970       rs  w1  b19       ;
18517 19972       rs  w3  x1+p3     ;   link(trm):=link;
18518 19974       jl.     e9.       ;   goto start-transmitter;
18519 19976  
18519 19976  e12: rl  w2  b19       ; return to main:
18520 19978       rl  w1  x2+a50    ;   main:=main(proc);
18521 19980       rs  w1  b19       ;   cur proc:=main;
18522 19982       jl     (x2+p3)    ;   return to main;
18523 19984  
18523 19984  \f


18523 19984  
18523 19984  ; dummy subprocess.
18524 19984  
18524 19984  b.q5, i0 w.
18525 19984  h96: q0                ; addr(entry0)
18526 19986       q1                ; addr(entry1)
18527 19988       q2                ; addr(entry2)
18528 19990       q3                ; addr(entry3)
18529 19992       q4                ; addr(entry4)
18530 19994       q5                ; addr(entry5)
18531 19996  
18531 19996  q0:  jl      g3        ; entry 0: goto result 5;
18532 19998  
18532 19998  q1:  al  w0  p163      ; entry 1:
18533 20000       am     (x1+a50)   ;
18534 20002       hs  w0  +p60      ;   internal status:=reject;
18535 20004  q2:  jl     (b101)     ; entry 2: return(std);
18536 20006  
18536 20006  q3:  al  w0  p163      ; entry 3:
18537 20008       am     (x1+a50)   ;
18538 20010       hs  w0  +p80      ;   internal status:=reject;
18539 20012  q4:                    ; entry 4:
18540 20012  q5:  jl     (b101)     ; entry 5: return(std);
18541 20014  
18541 20014  h102=h96 ,  h104=h96 
18542 20014  e.
18543 20014  \f


18543 20014  
18543 20014  ; subkind driver.
18544 20014  ; all messages to subproces passes through this block.
18545 20014  ; w3: subproc
18546 20014  h82:                   ; hostprocess:
18547 20014  h84: al  w2  x3        ; subprocess:
18548 20016       rl  w1  x2+a50    ;   main:=mainproc(sub);
18549 20018       sn  w1  0         ;  if main=0 then
18550 20020       jl      g6        ;  goto result 2 (rejected)
18551 20022       zl  w0  x1+s16    ;
18552 20024       se  w0  0         ;   if ready flag(main)=running then
18553 20026       jl      g4        ;     goto result4;
18554 20028       jl. w3  e0.       ;   call entry0(sub);
18555 20030                         ;   goto main-exit;
18556 20030  
18556 20030  e6:                    ; main-exit:
18557 20030       rl  w2  x1+p14    ;
18558 20032       am      x1+p201   ;
18559 20034       rl  w0  +p2       ;
18560 20036       se  w2  x1+p14    ;   if proc queue(main) is empty 
18561 20038       se  w0  1         ;   or state(trm)<>waiting before poll then
18562 20040       jl     (b20)      ;     return to program;
18563 20042       jl.     e7.       ;   goto get-next;
18564 20044  
18564 20044  e.   ; end of mainproc
18565 20044  
18565 20044  ; stepping stones:
18566 20044  
18566 20044       jl.     f4.       ;
18567 20046       f4=k-2            ;
18568 20046  
18568 20046       jl.     f5.       ;
18569 20048       f5=k-2            ;    ; end of mainprocess driver (m,n and s-names).
18570 20048  
18570 20048       jl.     f6.       ;
18571 20050       f6=k-2            ;
18572 20050  
18572 20050  \f


18572 20050  
18572 20050  
18572 20050  ; block including the receiver process.
18573 20050  
18573 20050  b.c6,n5,s16 w.
18574 20050  
18574 20050  ; receiver.
18575 20050  
18575 20050  m.
18575 20050                  fpa receiver

18576 20050  
18576 20050  ; process description:
18577 20050  ; a250:                          ; driver process description address
18578 20050  ; a402:                          ; user bit table
18579 20050  
18579 20050  ; a48:                           ; interval
18580 20050  ; a49:                           ; interval
18581 20050  ; a10:                           ; kind
18582 20050  ; a11:                           ; name
18583 20050  ; a50:                           ; mainproc
18584 20050  ; a52:                           ; reserver
18585 20050  ; a57, a58:                      ; work0, work1
18586 20050  ; a54:                           ; next message
18587 20050  ; a55:                           ; last message
18588 20050  ; a56:                           ; message regretted
18589 20050  
18589 20050  p2=p0                            ; state(rec)
18590 20050  p3=p2+2                          ; link
18591 20050  s0=p3+2                          ; transmit status, cur. ch. command
18592 20050                                   ;                , rem. char count
18593 20050                                   ;                , cur. status
18594 20050                                   ;                , event status
18595 20050  s1=s0+8                          ; receive status , cur. ch. command
18596 20050                                   ;                , rem. char count
18597 20050                                   ;                , cur. status
18598 20050                                   ;                , event status
18599 20050  s2=s1+8                          ; startbyte<16
18600 20050  s3=s2+2                          ; statusbyte<16
18601 20050  s4=s3+2                          ; expected blocknumber
18602 20050  s5=s4+2                          ; message buffer
18603 20050  s6=s5+2        ,                 ; errorbits      ,
18604 20050  s7=s6+2                          ; delay
18605 20050  
18605 20050  ; error parameters:
18606 20050  s10=s7+2       ,                 ; errorcount     , blocklength error
18607 20050                 ,                 ; parity error   , timeout(write)
18608 20050                 ,                 ; timeout(mon)   , abnormal termination
18609 20050                 ,                 ; master clear   , accept master clear
18610 20050                 ,                 ; blockno error  , 
18611 20050  s12=s10+10                       ; top of privat part proc desc
18612 20050  s13=s12                          ; start of channel program area
18613 20050  ; s14                            ; top of channel program area
18614 20050  
18614 20050  \f


18614 20050  
18614 20050  
18614 20050  ; receiver channel program:
18615 20050                         ; start1:
18616 20050  ; transmit statusbyte.
18617 20050  c0:  4<12+3<8          ;  addr code:=devi desc    , op:=write
18618 20052       +s3               ;  first addr:=addr(statusbyte)
18619 20054       1                 ;  char count:=1
18620 20056  ; sense status(trm).
18621 20056  c1:  4<12+0<8          ;  addr code:=devi desc    , op:=sense
18622 20058       +s0               ;  first addr:=addr trm status
18623 20060       12                ;  char count:=12
18624 20062   
18624 20062                         ; start2:
18625 20062  ; receive startbyte.
18626 20062  c2:  4<12+1<8+1<7      ;  addr code:=devi desc    , op:=read, continue
18627 20064       +s2               ;  first addr:=addr(startbyte)
18628 20066       1                 ;  char count:=1
18629 20068  ; receive header.
18630 20068  c3:  4<12+1<8+1<7      ;  addr code:=devi desc    , op:=read, continue
18631 20070       +p95-p200         ;  first addr:=addr(header area in main)
18632 20072       2+1+11+10         ;  char count
18633 20074  ; receive data.
18634 20074  c4:       1<8          ;  addr code               , op:=read
18635 20076       0                 ;  first addr
18636 20078       0                 ;  char count
18637 20080  ; sense status(rec).
18638 20080  c5:  4<12+0<8          ;  addr code:=devi desc    , op:=sense
18639 20082       +s1               ;  first addr:=addr rec status
18640 20084       12                ;  char count:=12
18641 20086  ; stop.
18642 20086  c6:      15<8          ;             dummy        , op:=stop
18643 20088       0                 ;  dummy
18644 20090       600 000           ;  timeout (in 0.1 msec)
18645 20092  
18645 20092  s14=s13+c6+6-c0
18646 20092  
18646 20092  c.(:(:p210-s14:)a.8.37777777:)-1, m.***name error p210
18647 20092  z.
18648 20092  
18648 20092  ; channelprogram used when operating direct on the receiver.
18649 20092  ; transmit statusbyte.
18650 20092  c10: 4<12+3<8          ;  addr code:=devi desc    , op:=write
18651 20094       +s3               ;  first addr:=addr(statusbyte)
18652 20096       1                 ;  char count:=1
18653 20098  ; sense status.
18654 20098       4<12+0<8          ;  addr code:=devi desc    , op:=sense
18655 20100       +s0               ;  first addr:=sense area
18656 20102       12                ;  char count:=12
18657 20104  ; receive startbyte.
18658 20104  c11: 4<12+0            ;  addr code:=devi desc    , op:=command1
18659 20106       +s2               ;  first addr:=addr(startbyte)
18660 20108       1                 ;  char count:=1
18661 20110  ; receive data.
18662 20110  c12: 0<12+0            ;  addr code:=sender(mess) , op:=command2
18663 20112       0                 ;  first addr
18664 20114       0                 ;  char count
18665 20116  ; stop.
18666 20116  c13:      15<8          ;  addr code:=dummy        , op:=stop
18667 20118       0                 ;  dummy
18668 20120       600 000           ;  timeout:=60 sec (in units of 0.1 msec)
18669 20122  \f


18669 20122  
18669 20122  b.i10,m20 w.
18670 20122  
18670 20122  b.j10 w.
18671 20122  h86: am   (x1+a50)  ; receiver:
18672 20124       rl  w0    +a52  ;
18673 20126       rl  w2  b18       ;
18674 20128       rs  w1  x2+4      ;   receiver.buf := fparec;
18675 20130       sn  w0  0         ;   if reserver(main)=0 then
18676 20132       jl  w3  g15       ;     check reserver;
18677 20134       jl  w3  g17       ;   link operation;
18678 20136  
18678 20136  j0:  bz  w0  x2+9      ; execute:
18679 20138  c.p101 b.f1 w.         ;*****test40*****
18680 20138       rs. w3  f0.       ;
18681 20140       jl. w3  f4.       ;
18682 20142       40                ;
18683 20144  f0:  0                 ;
18684 20146       jl.     f1.       ;
18685 20148       rl  w0  x2+8      ;   param0:=operation, mode;
18686 20150       rs  w0  x3        ;
18687 20152       al  w0  x3        ;
18688 20154       al  w1  x3        ;
18689 20156       jl. w3  f5.       ;
18690 20158  f1:                    ;
18691 20158  e.z.                   ;*****test40*****
18692 20158       so  w0  2.10      ;   if not mode.reset then
18693 20160       jl.     j1.       ;     goto cont;
18694 20162       al  w0  -2        ; reset:
18695 20164       rs  w0  x1+p2     ;   state:=direct reset;
18696 20166       rl  w3  x1+a235   ;   device:=device code(proc);
18697 20168       rl  w1  x1+s7     ;   timeout:=short delay;
18698 20170  ;    al  w0  2<2+1<1+1 ;   function:=reset, wait, exit;
18699 20170  ;    al  w2  0         ;   mess buff:=dummy;
18700 20170       al  w0  1<2+1<1+1 ;   function:=reset,start chpg, exit;
18701 20172       al. w1  c13.      ;   start(chpg):=stop;
18702 20174       jd      1<11+p109 ;   start io;
18703 20176  
18703 20176  m18: rl  w0  x1+a56    ; after wait:
18704 20178       se  w0  0         ;   if regret flag then
18705 20180       jl.     j7.       ;     goto result1;
18706 20182       rl  w2  b18       ;
18707 20184  j1:  rl  w0  x2+14     ;
18708 20186       sh  w0  0         ;
18709 20188       am      5<8-1<8   ;   if size=<0 then
18710 20190       al  w3  1<8       ;     command1:=dummy;
18711 20192       hs. w3  c12.+1    ;     command2:=dummy;
18712 20194       al  w3  x3+1<7    ;   else
18713 20196       hs. w3  c11.+1    ;     command1:=read, continue;
18714 20198       ld  w0  -100      ;     command2:=read;
18715 20200       ds  w0  x1+s0+2   ;
18716 20202       ds  w0  x1+s0+6   ;   clear status area;
18717 20204       al  w0  -1        ;
18718 20206       rs  w0  x1+s2     ;   startchar:=-1;
18719 20208       rs  w0  x1+p2     ;   state:=operate direct;
18720 20210  
18720 20210  
18720 20210       rl  w0  x2+12     ; receive:
18721 20212       ws  w0  x2+10     ;
18722 20214       ls  w0  -1        ;   maxcharcount:=
18723 20216       ba. w0  1         ;     ((last-first)//1-1)*3;
18724 20218       wm  w0  g48       ;
18725 20220       sl  w0 (x2+14)    ;   if charcount.mess>maxchar count then
18726 20222       se  w3  0         ;     goto deliver result3;
18727 20224       jl.     j6.       ;
18728 20226       rl  w0  x2+16     ;
18729 20228       ls  w0  4         ;
18730 20230       hs  w0  x1+s3     ;   statuschar:=statuschar(mess);
18731 20232       rl  w3  x2+10     ;   first addr:=mess.first;
18732 20234       rl  w0  x2+14     ;   charcount:=mess.charcount;
18733 20236       ds. w0  c12.+4    ;
18734 20238       bz  w0  x2+9      ;   if mode=trm statusbyte then
18735 20240       so  w0  2.1       ;     startchpg:=rec startbyte;
18736 20242       am      c11-c10   ;   else
18737 20244       al. w1  c10.      ;   startchpg:=trm statusbyte;
18738 20246       al  w0  1<2+1     ;   io-function:=start chpg, exit;
18739 20248       am     (b19)      ;
18740 20250       rl  w3  +a235     ;   devno:=devno(proc);
18741 20252  c.p101 b.f1 w.         ;*****test25*****
18742 20252       rs. w3  f0.       ;
18743 20254       jl. w3  f4.       ;
18744 20256       25                ;
18745 20258  f0:  0                 ;
18746 20260       jl.     f1.       ;
18747 20262       al  w0  x1        ;   dump channelpg;
18748 20264       al. w1  c12.+6    ;
18749 20266       jl. w3  f5.       ;
18750 20268  f1:                    ;
18751 20268  e.z.                   ;*****test25*****
18752 20268       jd      1<11+p109 ;   start io;
18753 20270       al  w2  1<8       ; error:
18754 20272       rs  w2  g20       ;   if io-result=2 (2: sender stopped) then
18755 20274       ld  w3  -100      ;     status:=1<8 (stopped);
18756 20276       ds  w3  g22       ;     bytes,chars trf:=0,0;
18757 20278       al  w2  -1        ;     startchar rec:=-1;
18758 20280       rs  w2  g23       ;     goto result1;
18759 20282       sn  w0  2         ;   else (1: buf regretted, 3: unintelligible)
18760 20284       jl.     j7.       ;     goto result3;
18761 20286       jl.     j6.       ;
18762 20288  
18762 20288  m19: rl  w2  b18       ; after operation:
18763 20290       rl  w3  x2+14     ;   chars:=mess.char count;
18764 20292       ws  w3  x1+a231   ;   chars:=chars-remaining char count(std status);
18765 20294       sl  w3 (x2+14)    ;   if chars>=mess.char count then
18766 20296       rl  w3  x2+14     ;     chars:=mess.char count;
18767 20298       se  w0  0         ;   if io-result<>0 then
18768 20300       al  w3  0         ;     chars:=0;
18769 20302       rs  w3  g22       ;   chars trf(answer):=chars;
18770 20304       al  w2  0         ;
18771 20306       al  w3  x3+2      ;
18772 20308       wd  w3  g48       ;
18773 20310       ls  w3  1         ;
18774 20312       rs  w3  g21       ;   bytes trf(answer):=(chars+2)//3*2;
18775 20314       rl  w3  x1+s2     ;   if no startchar received then
18776 20316       se  w3  -1        ;     startchar(answer):=-1;
18777 20318       ls  w3  -16       ;   else startchar(answer):=startchar received;
18778 20320       rs  w3  g23       ;
18779 20322       rl  w3  x1+a233   ;   status:=event status(std) or event status(proc);
18780 20324       lo  w3  x1+s0+6   ;   if io-result=3 then (monitor timeout)
18781 20326       sn  w0  3         ;     status:=execution timeout;
18782 20328       al  w3  1<9       ;
18783 20330       rs  w3  g20       ;   status(answer):=status;
18784 20332       se  w0  3         ;   if io-result=3 (monitor timeout)
18785 20334       sh  w3  -1        ;   or bit0(status)=1 then
18786 20336       al  w0  0         ;     io-result:=0;
18787 20338       sn  w0  0         ;   if io-result=0 then
18788 20340       jl.     j7.       ;     goto result1;
18789 20342  j5:  am      4-3       ; result4: result:=4;
18790 20344  j6:  am      3-1       ; result3: result:=3;
18791 20346  j7:  al  w0  1         ; result1:   or  :=1;
18792 20348  c.p101 b.f1 w.         ;*****test41*****
18793 20348       rs. w3  f0.       ;
18794 20350       jl. w3  f4.       ;
18795 20352       41                ;
18796 20354  f0:  0                 ;
18797 20356       jl.     f1.       ;
18798 20358       rs  w0  g24       ;
18799 20360       al  w0  g20       ;
18800 20362       al  w1  g24       ;   dump answer (g20,21,22,23) and result (g24);
18801 20364       jl. w3  f5.       ;
18802 20366  f1:                    ;
18803 20366  e.z.                   ;*****test41*****
18804 20366       rl  w1     b19    ;
18805 20368       rl  w3  x1+a56    ;
18806 20370       sn  w3  0         ;   if message not regretted then
18807 20372       jl  w3  g19       ; deliver: deliver result(result);
18808 20374       al  w0  0         ;
18809 20376       rs  w0  x1+a56    ;   clear (regretted flag);
18810 20378       rs  w0  x1+p2     ;   state:=idle;
18811 20380       jl  w3  g25       ;   next operation;
18812 20382       jl.     j0.       ;   goto execute;
18813 20384  e.
18814 20384  \f


18814 20384  
18814 20384  ; start receive.
18815 20384  ; w1: receiver
18816 20384  e8:  rl  w2  x1+a50    ; entry1: main:=main(rec);
18817 20386       bz  w0  x2+p93    ;
18818 20388       al  w3  2.0010    ;
18819 20390       la  w3  0         ;   contents:=operation(6:6);
18820 20392       hs  w3  x2+p97    ;
18821 20394       sz  w0  4.01000   ;   if initiate then
18822 20396       jl. w3  n3.       ;     initiate proc desc;
18823 20398       sz  w0  4.00300   ;   if delay then
18824 20400       jl.     m3.       ;     goto start wait;
18825 20402  
18825 20402  m0:  jl. w3  n1.       ; start trm-rec: setup statusbyte;
18826 20404       al  w3  1<2       ;   io-function:=start ch pg;
18827 20406       al. w0  c0.       ;   start:=start1;
18828 20408       jl.     m2.       ;   goto start operation;
18829 20410  
18829 20410  m3:  al  w3  2         ; start wait:
18830 20412       rs  w3  x1+p2     ;   state:=waiting;
18831 20414       rl  w3  x1+a235   ;   dev desc:=dev desc(rec);
18832 20416       sz  w0  4.00200   ;   if long delay then
18833 20418       am      s7-s7     ;     delay:=long delay;
18834 20420       rl  w1  x1+s7     ;   else delay:=short delay;
18835 20422       sz  w0  4.02000   ;   if reset then
18836 20424       am      1<1       ;     function:=reset and start waitpg;
18837 20426       al  w0  2<2       ;   else function:=start wait pg;
18838 20428       al  w2  0         ;   mess buffer:=0;
18839 20430  c.p101 b.f1 w.         ;*****test25*****
18840 20430       rs. w3  f0.       ;
18841 20432       jl. w3  f4.       ;
18842 20434       25                ;
18843 20436  f0:  0                 ;
18844 20438       jl.     f1.       ;
18845 20440       al  w0  x1+2      ;
18846 20442       jl. w3  f5.       ;
18847 20444  f1:                    ;
18848 20444  e.z.                   ;*****test25*****
18849 20444       jl.     m5.       ;   goto start io;
18850 20446  
18850 20446  m6:  jl. w3  n1.       ; after waiting: setup startbyte;
18851 20448       jl.     m1.       ;   goto rec;
18852 20450  
18852 20450  m1:  al  w3  1<2       ; rec: io-function:=start ch pg;
18853 20452       al. w0  c2.       ;   start:=start2;
18854 20454                         ;   goto start operation;
18855 20454  
18855 20454  m2:  ds. w0  i2.       ; start operation:
18856 20456       jl. w3  n2.       ;   setup channel program;
18857 20458       rl  w2  x1+s5     ;   mess buff:=mess buff(op);
18858 20460       al  w3  3         ;
18859 20462       rs  w3  x1+p2     ;   state(rec):=receiving;
18860 20464       rl  w3  x1+a235   ;   dev desc:=dev desc(rec);
18861 20466       dl. w1  i2.       ;   load io-function, start of ch pg;
18862 20468  c.p101 b.f1 w.         ;*****test24*****
18863 20468       rs. w3  f0.       ;
18864 20470       jl. w3  f4.       ;
18865 20472       24                ;
18866 20474  f0:  0                 ;
18867 20476       jl.     f1.       ;
18868 20478       al. w0  i1.       ;
18869 20480       al. w1  i2.       ;
18870 20482       jl. w3  f5.       ;
18871 20484  f1:                    ;
18872 20484  e.z.                   ;*****test24*****
18873 20484  c. p101 b. f1 w.       ; ***test 26***
18874 20484       rs. w3  f0.       ;*
18875 20486       jl. w3  f4.       ;*
18876 20488       26                ;*
18877 20490  f0:  0                 ;*
18878 20492       jl.     f1.       ;*
18879 20494       al. w0  c0.       ;*
18880 20496       al. w1  c6.+4     ;*
18881 20498       jl. w3  f5.       ;*
18882 20500  f1:                    ;*
18883 20500  e.z.                   ;* test 26***
18884 20500  m5:  jd      1<11+p109 ;   start io;
18885 20502       rl  w1  b19       ;
18886 20504       sn  w0  0         ;   if io-result=0 then
18887 20506       jl.     m9.       ;     wait;
18888 20508       rl  w2  x1+a50    ;
18889 20510       hs  w0  x2+p94    ;   result:=io-result;
18890 20512       jl.     m17.      ;   goto return;
18891 20514  
18891 20514  m8:  jl     (b20)      ; return: wait;
18892 20516  
18892 20516  m9:  rl  w1  x1+a50    ; wait:
18893 20518       rs  w1  b19       ;   curr proc:=main(rec);
18894 20520       jl.     e6.       ;   main-return;
18895 20522  
18895 20522  \f


18895 20522  
18895 20522  
18895 20522  ; after interrupt.
18896 20522  c43: rl  w2  x1+a50    ; interrupt entry:
18897 20524  c.p101 b.f1 w.         ;*****test42*****
18898 20524       rs. w3  f0.       ;
18899 20526       jl. w3  f4.       ;
18900 20528       42                ;
18901 20530  f0:  0                 ;
18902 20532       jl.     f1.       ;
18903 20534       al  w2  x3        ;
18904 20536       dl  w0  x1+a231   ;
18905 20538       ds  w0  x2+2      ;
18906 20540       dl  w0  x1+a233   ;
18907 20542       ds  w0  x2+6      ;   dump std status area
18908 20544       rl  w0  x1+a244   ;   io-result;
18909 20546       rs  w0  x2+8      ;
18910 20548       al  w0  x2        ;
18911 20550       al  w1  x2+8      ;
18912 20552       jl. w3  f5.       ;
18913 20554  f1:                    ;
18914 20554  e.z.                   ;*****test42*****
18915 20554  c.p101 b.f1 w.         ;*****test28*****
18916 20554       rs. w3  f0.       ;
18917 20556       jl. w3  f4.       ;
18918 20558       28                ;
18919 20560  f0:  0                 ;
18920 20562       jl.     f1.       ;
18921 20564       al  w0  x1+p2     ;
18922 20566       al  w1  x1+s3     ;
18923 20568       jl. w3  f5.       ;
18924 20570  f1:                    ;
18925 20570  e.z.                   ;*****test28*****
18926 20570       rl  w3  x1+p2     ;
18927 20572       am      x3        ;
18928 20574       jl.    (x3+6)     ;   goto case state of
18929 20576       m18               ;   ( -2: wait direct,
18930 20578       m19               ;     -1: operate direct,
18931 20580       m8                ;      0: idle,
18932 20582       m9                ;      1: wating before poll(not possible),
18933 20584       m6                ;      2: waiting,
18934 20586       m10               ;      3: receiving);
18935 20588  
18935 20588  m10: jl. w3  n0.       ; after receive: check state(rec,result);
18936 20590       hs  w3  x2+p94    ;   result(main):=result;
18937 20592  c.p101 b.f2 w.         ;*****test30*****
18938 20592       rs. w3  f0.       ;
18939 20594       jl. w3  f4.       ;
18940 20596       30                ;
18941 20598  f0:  0                 ;
18942 20600       jl.     f1.       ;
18943 20602       al  w0  x2+p95    ;
18944 20604       al  w1  x2+p95+14 ;
18945 20606       jl. w3  f5.       ;
18946 20608  f1:                    ;
18947 20608  e.z.                   ;*****test30*****
18948 20608  c.p101 b.f1 w.         ;*****test27*****
18949 20608       rs. w3  f0.       ;
18950 20610       jl. w3  f4.       ;
18951 20612       27                ;
18952 20614  f0:  0                 ;
18953 20616       jl.     f1.       ;
18954 20618       al  w0  x1+s13    ;
18955 20620       al  w1  x1+s14-2  ;
18956 20622       jl. w3  f5.       ;
18957 20624  f1:                    ;
18958 20624  e.z.                   ;*****test27*****
18959 20624       sn  w3  0         ;   if result=0 then
18960 20626       jl.     m15.      ;     goto ok;
18961 20628  c.p101 b.f1 w.         ;*****test29*****
18962 20628       rs. w3  f0.       ;
18963 20630       jl. w3  f4.       ;
18964 20632       29                ;
18965 20634  f0:  0                 ;
18966 20636       jl.     f1.       ;
18967 20638       al  w2  x3        ;
18968 20640       dl  w0  x1+a231   ;
18969 20642       ds  w0  x2+2      ;
18970 20644       dl  w0  x1+a233   ;
18971 20646       ds  w0  x2+6      ;
18972 20648       rl  w3  x1+a244   ;
18973 20650       rl. w0  f0.       ;
18974 20652       ds  w0  x2+10     ;
18975 20654       al  w0  x2        ;
18976 20656       al  w1  x2+10     ;
18977 20658       jl. w3  f5.       ;
18978 20660  f1:                    ;
18979 20660  e.z.                   ;*****test29*****
18980 20660       al  w0  x2       ; save w3
18981 20662       jl  w2  (b31)    ; call errorlog
18982 20664       rl  w2  0        ; restore w3
18983 20666       bz  w0  x2+p93    ;
18984 20668       sz  w0  2.00000001;   if no error recovery then
18985 20670       jl.     m13.      ;     goto check;
18986 20672                         ; errors:
18987 20672  c.p102                 ;*****statistics begin*****
18988 20672       al  w0  1         ;
18989 20674       ba  w0  x1+s10    ;   errorcount:=errorcount+1;
18990 20676       hs  w0  x1+s10    ;
18991 20678       al  w0  1         ;
18992 20680       am      x3-3      ;
18993 20682       ba  w0  x1+s10    ;   errorcount(result):=errorcount(result)+1;
18994 20684       am      x3-3      ;
18995 20686       hs  w0  x1+s10    ;
18996 20688  z.                     ;*****statistics end*****
18997 20688       am      x3-3      ;
18998 20690       jl.    (x3-3)     ;   goto case result of
18999 20692       m11               ;    ( 4: blocklength error,
19000 20694       m12               ;      5: parity error,
19001 20696       -1                ;      6: impossible,
19002 20698       m1                ;      7: timeout(mon),
19003 20700       m1                ;      8: abnormal termination,
19004 20702       m16               ;      9: master clear,
19005 20704       m16               ;     10: accept master clear,
19006 20706       m0                ;     11: blocknumber error);
19007 20708  
19007 20708  m11: am      2.10-2.01 ; blocklength error:
19008 20710  m12: al  w0  2.01      ; parity error: 
19009 20712       hs  w0  x1+s6     ;   errorbits:=error cause;
19010 20714       jl.     m0.       ;   goto start rec-trm;
19011 20716  
19011 20716  m13: se  w3  9         ; check: if result<>master clear
19012 20718       sn  w3  10        ;   or accept master clear then
19013 20720       jl.     m16.      ;     goto return
19014 20722       jl.     m17.      ;   goto countup;
19015 20724  
19015 20724  m15: bz  w0  x1+s2     ; ok:
19016 20726       ls  w0  -4        ;   contents:=startbyte(4:6);
19017 20728       la. w0  i0.       ;
19018 20730       hs  w0  x2+p97    ;   contents(main):=contents;
19019 20732  m16: al  w0  1         ; countup:
19020 20734       wa  w0  x1+s4     ;   blockcount:=blockcount+1;
19021 20736       rs  w0  x1+s4     ;
19022 20738  m17: al  w0  0         ; return:
19023 20740       rs  w0  x1+p2     ;   state(rec):=ready;
19024 20742       hs  w0  x1+s6     ;
19025 20744  c.p101 b.f1 w.         ;*****test31*****
19026 20744       rs. w3  f0.       ;
19027 20746       jl. w3  f4.       ;
19028 20748       31                ;
19029 20750  f0:  0                 ;
19030 20752       jl.     f1.       ;
19031 20754       al  w0  x1+2      ;
19032 20756       jl. w3  f5.       ;
19033 20758  f1:                    ;
19034 20758  e.z.                   ;*****test31*****
19035 20758       jl.     e12.      ;   return to main;
19036 20760  
19036 20760  i0:  2.00001110        ;   mask
19037 20762  i1:  0                 ;   io-function
19038 20764  i2:  0                 ;   start of ch pg
19039 20766  
19039 20766  e.
19040 20766  
19040 20766  \f


19040 20766  
19040 20766  ; check state(proc,result).
19041 20766  ; the procedure checks the result of the i/o operation by inspecting the timeout,
19042 20766  ; the receive status area and the startbyte received.
19043 20766  ;  result:   0  ok
19044 20766  ;            4  blocklength error
19045 20766  ;            5  parity error(write)
19046 20766  ;            7  time-out(monitor)
19047 20766  ;            8  abnormal termination, that is buserror, disconnected line,
19048 20766  ;                  reset received, disconnected controller, power up, etc.
19049 20766  ;            9  master clear
19050 20766  ;           10  accept master clear
19051 20766  ;           11  blocknumber error
19052 20766  ;        call:         return:
19053 20766  ; w0                   destroyed
19054 20766  ; w1     proc          unchanged
19055 20766  ; w2                   unchanged
19056 20766  ; w3     link          result
19057 20766  b.i1,j20 w.
19058 20766  n0:  rs. w3  i0.       ; check state:
19059 20768       rl  w0  x1+a244   ;
19060 20770       se  w0  0         ;   if timeout<>0 then
19061 20772       jl.     j1.       ;     goto timeout-error;
19062 20774       rl  w0  x1+s1+6   ;   event status:=event status(rec) or event status(std);
19063 20776       lo  w0  x1+a233   ;   if event status<>(0 or blocklength error) then
19064 20778       sz. w0 (i1.)      ;     goto event-error;
19065 20780       jl.     j0.       ;
19066 20782       bl  w0  x1+s2     ; ok or blocklength:
19067 20784       so  w0  2.1<4     ;   if special bit then
19068 20786       jl.     j3.       ;    begin
19069 20788       sn  w0  -1<4      ;     if startbyte=master clear then
19070 20790       jl.     j16.      ;       goto master clear;
19071 20792       sn  w0  -1<4-1<9  ;     if startbyte=accept master clear then
19072 20794       jl.     j17.      ;       goto accept master clear;
19073 20796       jl.     j12.      ;     goto parity error;
19074 20798  j3:  ld  w0  1         ;   if blockno expected mod 2 <>
19075 20800       lx  w3  x1+s4     ;   blockno rec then
19076 20802       sz  w3  2.1       ;     goto blocknumber error;
19077 20804       jl.     j18.      ;
19078 20806       rl  w3  x1+s1+2   ;   if rem char count<>0 then
19079 20808       se  w3  0         ;     goto blocklenght error;
19080 20810       jl.     j11.      ;   else
19081 20812       jl.     j10.      ;     goto ok;
19082 20814  j0:  bz  w3  0         ; event-error:
19083 20816       sz  w3  1<10      ;   if bit1 then
19084 20818       jl.     j12.      ;     goto parity error;
19085 20820       jl.     j15.      ;   goto abnormal termination;
19086 20822  j1:  sn  w0  3         ; timeout-error:
19087 20824       jl.     j14.      ;   if timeout=3 then goto timeout(mon);
19088 20826       jl.     j15.      ;   goto abnormal termination;
19089 20828  
19089 20828  j18: am      11-10     ; blocknumber error:    result:=11;
19090 20830  j17: am      10-9      ; accept master clear:  result:=10;
19091 20832  j16: am      9-8       ; master clear:         result:=9;
19092 20834  j15: am      8-7       ; abnormal termination: result:=8;
19093 20836  j14: am      7-5       ; timeout(mon):         result:=7;
19094 20838  j12: am      5-4       ; parity error:         result:=5;
19095 20840  j11: am      4-0       ; blocklength error:    result:=4;
19096 20842  j10: al  w3  0         ; ok:                   result:=0;
19097 20844       jl.    (i0.)      ;   return;
19098 20846  i0:  0                 ;  saved link;
19099 20848  i1:  8.7577 7777       ;   event status mask not including blocklenght error
19100 20850  e.
19101 20850  
19101 20850  ; setup statusbyte.
19102 20850  ;        call:         return:
19103 20850  ; w0                   destroyed
19104 20850  ; w1     rec           unchanged
19105 20850  ; w2     main          unchanged
19106 20850  ; w3     link          destroyed
19107 20850  b.i0 w.
19108 20850  n1:  rs. w3  i0.       ; setup statusbyte:
19109 20852       bz  w3  x2+p96    ;   statusbyte:=
19110 20854       ls  w3  2         ;     blockcontrol<2
19111 20856       bl  w0  x1+s2     ;     +(received blockno mod 2)<7
19112 20858       sz  w0  -1<11     ;
19113 20860       al  w3  x3+1<7    ;
19114 20862       ba  w3  x1+s6     ;     +errorbits;
19115 20864       ls  w3  4         ;
19116 20866       hs  w3  x1+s3     ;   insert statusbyte;
19117 20868       jl.    (i0.)      ;   return;
19118 20870  i0:  0                 ;  saved link
19119 20872  e.
19120 20872  
19120 20872  
19120 20872  ; setup channelprogram.
19121 20872  ;         call:         return:
19122 20872  ; w0                    destroyed
19123 20872  ; w1      rec           unchanged
19124 20872  ; w2      main          unchanged
19125 20872  ; w3      link          destroyed
19126 20872  b.i0,j1 w.
19127 20872  n2:  rs. w3  i0.       ; setup ch pg:
19128 20874       ld  w0  -100      ;  clear status area;
19129 20876       ds  w0  x1+s0+2   ;
19130 20878       ds  w0  x1+s0+6   ;
19131 20880       ds  w0  x1+s1+2
19132 20882       ds  w0  x1+s1+6   ;
19133 20884       al  w0  -1        ;  startbyte(rec):= dummy
19134 20886       rs  w0  x1+s2     ;
19135 20888       bz  w0  x2+p93    ;
19136 20890       so  w0  4.00002   ;   if dataflag(operation)=off then
19137 20892       jl.     j0.       ;     goto receive header;
19138 20894       rl  w0  x2+p91    ; receive header-data:
19139 20896       rs  w0  x1+s5     ;
19140 20898       al  w0  -1        ;   op(header):= dummy in cnain
19141 20900       hs. w0  c3.+1     ;
19142 20902       bz  w0  x2+p92    ;
19143 20904       hs. w0  c4.       ;   addr code:=addr code(main);
19144 20906       al  w0  1<8       ;   op(data):=read;
19145 20908       hs. w0  c4.+1     ;
19146 20910       rl  w0  x2+p85    ;
19147 20912       rs. w0  c4.+2     ;   first addr:=first data rec;
19148 20914       rl  w0  x2+p86    ;
19149 20916       rs. w0  c4.+4     ;   size:=size data rec;
19150 20918       jl.    (i0.)      ; exit: return;
19151 20920  j0:  al  w0  0         ;  receive-header:
19152 20922       rs  w0  x1+s5     ;   mess buff:=0;
19153 20924       al  w0  1<8       ;
19154 20926       hs. w0  c3.+1     ;   op(header):=read;
19155 20928       al  w0  5<8       ;
19156 20930       hs. w0  c4.+1     ;   op(data):=dummy;
19157 20932  j1:  jl.    (i0.)      ; exit: return;
19158 20934  i0:  0                 ;  saved link
19159 20936  e.
19160 20936  
19160 20936  ; initiate proc desc(rec).
19161 20936  ; clear the tail of the proc desc except the reset delay and
19162 20936  ; the testinformation.
19163 20936  ;        call:         return:
19164 20936  ; w0                   unchanged
19165 20936  ; w1     rec           unchanged
19166 20936  ; w2                   unchanged
19167 20936  ; w3     link          destroyed
19168 20936  b.i1,j0 w.
19169 20936  n3:  ds. w0  i1.       ; initiate proc desc:
19170 20938       al  w3  x1+s4     ;   clear proc desc from
19171 20940       al  w0  0         ;   start of status area
19172 20942  j0:  rs  w0  x3        ;   to start of test information area;
19173 20944       al  w3  x3+2      ;
19174 20946       se  w3  x1+s7     ;
19175 20948       jl.     j0.       ;
19176 20950       rl. w0  i1.       ;
19177 20952       jl.    (i0.)      ;
19178 20954  i0:  0                 ;
19179 20956  i1:  0                 ;
19180 20958  e.
19181 20958  
19181 20958  e.  ; end of receiver
19182 20958  \f


19182 20958  
19182 20958  ; block including transmitter.
19183 20958  
19183 20958  b.c16,n5,s16 w.
19184 20958  
19184 20958  ; transmitter.
19185 20958  
19185 20958  m.
19185 20958                  fpa transmitter

19186 20958  
19186 20958  ; process description:
19187 20958  ; a250:                          ; driver process description address
19188 20958  ; a402:                          ; user bit table
19189 20958  
19189 20958  ; a48:                           ; interval
19190 20958  ; a49:                           ; interval
19191 20958  ; a10:                           ; kind
19192 20958  ; a11:                           ; name
19193 20958  ; a50:                           ; mainproc
19194 20958  ; a52:                           ; reserver
19195 20958  ; a57, a58:                      ; work0, work1
19196 20958  ; a54:                           ; next message
19197 20958  ; a55:                           ; last message
19198 20958  ; a56:                           ; message regretted
19199 20958  
19199 20958  p2=p0                            ; state(trm)
19200 20958  p3=p2+2                          ; link
19201 20958  s0=p3+2                          ; transmit status, cur. ch. command
19202 20958                                   ;                , rem. char count
19203 20958                                   ;                , cur. status
19204 20958                                   ;                , event status
19205 20958  s1=s0+8                          ; receive status , cur. ch. command
19206 20958                                   ;                , rem. char count
19207 20958                                   ;                , cur. status
19208 20958                                   ;                , event status
19209 20958  s2=s1+8                          ; startbyte<16
19210 20958  s3=s2+2                          ; statusbyte<16
19211 20958  s4=s3+2                          ; current blocknumber
19212 20958  s5=s4+2                          ; message buffer
19213 20958  s6=s5+2                          ; long delay(in 0.1 msec)
19214 20958  s7=s6+2                          ; short delay(in 0.1 msec)
19215 20958  
19215 20958  ; error parameters:
19216 20958  s10=s7+2       ,                 ; errorcount     , blocklength error
19217 20958                 ,                 ; parity error   , timeout(write)
19218 20958                 ,                 ; timeout(mon)   , abnormal termination
19219 20958                 ,                 ; blocklength -  , parity error(statusbyte)
19220 20958                 ,                 ; waitpg term    ,
19221 20958  s11=s10+10                       ; start time(io op)
19222 20958                                   ;       -
19223 20958  s12=s11+4                        ;   0  <  execution time(io-op) =< 5 
19224 20958                                   ;   5  <       -                =< 10
19225 20958                                   ;   10 <       -                =< 20
19226 20958                                   ;   20 <       -                =< 40
19227 20958                                   ;   40 <       -                =< 80
19228 20958                                   ;   80 <       -
19229 20958  s13=s12+12                       ; start of channel program area
19230 20958  ; s14                            ; top of channel program area
19231 20958  
19231 20958  
19231 20958  
19231 20958  \f


19231 20958  
19231 20958  
19231 20958  ; transmitter channel program:
19232 20958  
19232 20958                         ; start1:
19233 20958  ; transmit startbyte.
19234 20958  c0:  4<12+3<8+1<7      ;  addr code:=devi desc    , op:=write, continue
19235 20960       +s2               ;  first addr:=addr(startbyte)
19236 20962       1                 ;  char count:=1
19237 20964  ; transmit header.
19238 20964  c1:  4<12+3<8+1<7      ;  addr code:=devi desc    , op:=write, continue
19239 20966       +p75-p201         ;  first addr:=start header (in mainproc)
19240 20968       2+1+11+10         ;  char count
19241 20970  ; transmit data.
19242 20970  c2:       3<8          ;  addr code               , op:=write
19243 20972       0                 ;  first addr
19244 20974       0                 ;  char count
19245 20976  ; sense status(trm).
19246 20976  c3:  4<12+0<8          ;  addr code:=devi desc    , op:=sense
19247 20978       +s0               ;  first addr:=addr(trm status)
19248 20980       12                ;  char count:=12
19249 20982  ; receive statusbyte.
19250 20982  c4:  4<12+1<8          ;  addr code:=devi desc    , op:=read
19251 20984       +s3               ;  first addr:=addr(statusbyte)
19252 20986       1                 ;  char count:=1
19253 20988  ; sense status(rec)
19254 20988  c5:  4<12+0<8          ;  addr code:=devi desc    , op:=sense
19255 20990       +s1               ;  first addr:=addr(rec status)
19256 20992       12                ;  char count:=12
19257 20994  ; stop.
19258 20994  c6:      15<8          ;  dummy                   , op:=stop
19259 20996       0                 ;  dummy
19260 20998       10 000            ;  timeout:=1 sec(in units of 0.1 msec)
19261 21000  
19261 21000  s14=s13+c6+6-c0
19262 21000  
19262 21000  c.(:(:p211-s14:)a.8.37777777:)-1, m.***name error p211
19263 21000  z.
19264 21000  
19264 21000  
19264 21000  ; channel program used of operations send directly 
19265 21000  ; to the transmitter.
19266 21000  ; transmit startbyte.
19267 21000  c10: 4<12+3<8+1<7      ;  addr code:=devi desc    , op:=write, continue
19268 21002       +s2               ;  first addr:=addr(startbyte)
19269 21004       1                 ;  char count:=1
19270 21006  ; command1 (transmit data block, autoload or dummy).
19271 21006  c11: 0<12+0            ;  addr code:=sender(mess) , op:=command1
19272 21008       0                 ;  first addr
19273 21010       0                 ;  char count
19274 21012  ; sense status.
19275 21012       4<12+0<8          ;  addr code:=devi desc    , op:=sense
19276 21014       +s0               ;  first addr:=sense area
19277 21016       12                ;  char count:=12
19278 21018  ; command2 (receive statusbyte or dummy).
19279 21018  c12: 4<12+0            ;  addr code:=devi desc    , op:=command2
19280 21020       +s3               ;  first addr:=addr(startbyte)
19281 21022       1                 ;  char count:=1
19282 21024  ; stop.
19283 21024           15<8          ;  addr code:=dummy        , op:=stop
19284 21026       0                 ;  dummy
19285 21028       50 000            ;  timeout:=5 sec (in units of 0.1 msec)
19286 21030  \f


19286 21030  
19286 21030  b.i10,m20 w.
19287 21030  
19287 21030  b.j10 w.
19288 21030  h88:  am (x1+a50)     ; transmitter:
19289 21032        rl w0   +a52    ;
19290 21034       rl  w2  b18       ;
19291 21036       rs  w1  x2+4      ;   receiver.buf := fpaxmit;
19292 21038       sn  w0  0         ;   if reserver(main)=0 then
19293 21040       jl  w3  g15       ;     check reserver;
19294 21042       jl  w3  g17       ;   link operation;
19295 21044  
19295 21044  j0:  bz  w0  x2+9      ; execute:
19296 21046  c.p101 b.f1 w.         ;*****test 32*****
19297 21046       rs. w3  f0.       ;
19298 21048       jl. w3  f4.       ;
19299 21050       32                ;
19300 21052  f0:  0                 ;
19301 21054       jl.     f1.       ;
19302 21056       rl  w0  x2+8      ;   param0:=operation, mode;
19303 21058       rs  w0  x3        ;
19304 21060       al  w0  x3        ;
19305 21062       al  w1  x3        ;
19306 21064       jl. w3  f5.       ;
19307 21066  f1:                    ;
19308 21066  e.z.                   ;*****test 32*****
19309 21066       so  w0  2.10      ;   if not mode.reset then
19310 21068       jl.     j1.       ;     goto cont;
19311 21070       al  w0  -2        ; reset:
19312 21072       rs  w0  x1+p2     ;   state:=direct reset;
19313 21074       rl  w3  x1+a235   ;   device:=device code(proc);
19314 21076       rl  w1  x1+s7     ;   timeout:=short delay;
19315 21078       al  w0  2<2+1<1+1 ;   function:=reset, wait, exit;
19316 21080       al  w2  0         ;   mess buff:=dummy;
19317 21082       jd      1<11+p109 ;   start io;
19318 21084  
19318 21084  m15: rl  w0  x1+a56    ; after wait:
19319 21086       se  w0  0         ;   if regret flag then
19320 21088       jl.     j7.       ;     goto result1;
19321 21090       rl  w2  b18       ;
19322 21092       bz  w0  x2+9      ;
19323 21094  
19323 21094  j1:  so  w0  2.01      ; cont: if mode.rec then
19324 21096       am      5<8-1<8   ;     command2:=read
19325 21098       al  w0  1<8       ;   else
19326 21100       hs. w0  c12.+1    ;     command2:=dummy;
19327 21102       ld  w0  -100      ;
19328 21104       ds  w0  x1+s0+2   ;
19329 21106       ds  w0  x1+s0+6   ;   clear status area;
19330 21108       al  w0  -1        ;
19331 21110       rs  w0  x1+s3     ;   statuschar:=-1;
19332 21112       rs  w0  x1+p2     ;   state:=operate direct;
19333 21114       bz  w0  x2+8      ;   if operation(buf)<>transmit then
19334 21116       se  w0  5         ;     goto autoload;
19335 21118       jl.     j3.       ;
19336 21120  
19336 21120  
19336 21120  j2:  rl  w0  x2+12     ; transmit:
19337 21122       ws  w0  x2+10     ;
19338 21124       ls  w0  -1        ;   maxcharcount:=
19339 21126       ba. w0  1         ;     ((last-first)//1-1)*3;
19340 21128       wm  w0  g48       ;
19341 21130       sl  w0 (x2+14)    ;   if charcount.mess>maxchar count then
19342 21132       se  w3  0         ;     goto deliver result3;
19343 21134       jl.     j6.       ;
19344 21136       al  w0  3<8       ;
19345 21138       hs. w0  c11.+1    ;   command1:=write;
19346 21140       rl  w3  x2+10     ;   first addr:=mess.first;
19347 21142       rl  w0  x2+14     ;   charcount:=mess.charcount;
19348 21144       sh  w0  0         ;   if charcount=<0 then
19349 21146       jl.     j4.       ;     goto receive;
19350 21148       ds. w0  c11.+4    ;
19351 21150       rl  w0  x2+16     ;
19352 21152       ls  w0  4         ;
19353 21154       hs  w0  x1+s2     ;   startchar:=startchar(mess);
19354 21156       al. w1  c10.      ;   startchpg:=trm startbyte;
19355 21158       jl.     j5.       ;   goto startop;
19356 21160  
19356 21160  j3:  al  w0  6<8       ; autoload:
19357 21162       hs. w0  c11.+1    ;   command2:=autoload;
19358 21164       am      c11-c12   ;   start(chpg):=start1;
19359 21166  
19359 21166  j4:  al. w1  c12.      ; receive: start(chpg):=start2;
19360 21168       al  w2  0         ; start-op:
19361 21170  j5:  al  w0  1<2+1     ;   io-function:=start chpg, exit;
19362 21172       am     (b19)      ;
19363 21174       rl  w3  +a235     ;   devno:=devno(proc);
19364 21176  c.p101 b.f1 w.         ;*****test47*****
19365 21176       rs. w3  f0.       ;
19366 21178       jl. w3  f4.       ;
19367 21180       47                ;
19368 21182  f0:  0                 ;
19369 21184       jl.     f1.       ;
19370 21186       al  w0  x1        ;   dump channelpg;
19371 21188       al. w1  c12.+6    ;
19372 21190       jl. w3  f5.       ;
19373 21192  f1:                    ;
19374 21192  e.z.                   ;*****test47*****
19375 21192       jd      1<11+p109 ;   start io;
19376 21194       ld  w3  -100      ; error:
19377 21196       ds  w3  g21       ;   mess.status, mess.bytes trf:=0,0;
19378 21198       al  w3  -1        ;
19379 21200       ds  w3  g23       ;   mess.chars trf, statuschar:=0,-1;
19380 21202       sn  w0  3         ;   if io-result=3 then
19381 21204       jl.     j6.       ;     goto result3
19382 21206       jl.     j7.       ;   else goto result1;
19383 21208  
19383 21208  m16: rl  w2  b18       ; after operation:
19384 21210       rl  w3  x1+a233   ;   status:=event status(std) or event status(proc);
19385 21212       lo  w3  x1+s0+6   ;   if io-result=3 then (monitor timeout)
19386 21214       sn  w0  3         ;     status:=execution timeout;
19387 21216       al  w3  1<9       ;
19388 21218       rs  w3  g20       ;   status(answer):=status;
19389 21220       se  w0  3         ;   if io-result=3 (monitor timeout)
19390 21222       sh  w3  -1        ;   or bit0(status)=1 then
19391 21224       al  w0  0         ;     io-result:=0;
19392 21226       rl  w3  x2+14     ;   chars:=mess.char count;
19393 21228       se  w0  0         ;   if io-result<>0 then
19394 21230       al  w3  0         ;     chars:=0;
19395 21232       rs  w3  g22       ;   chars trf(answer):=chars;
19396 21234       al  w2  0         ;
19397 21236       al  w3  x3+2      ;
19398 21238       wd  w3  g48       ;
19399 21240       ls  w3  1         ;
19400 21242       rs  w3  g21       ;   bytes trf(answer):=(chars+2)//3*2;
19401 21244       rl  w3  x1+s3     ;   if no statuschar received then
19402 21246       se  w3  -1        ;     statuschar(answer):=-1;
19403 21248       ls  w3  -16       ;   else statuschar(answer):=statuschar received;
19404 21250       rs  w3  g23       ;
19405 21252       sn  w0  0         ;   if io-result=0 then
19406 21254       jl.     j7.       ;     goto result1;
19407 21256       am      4-3       ; result4: result:=4;
19408 21258  j6:  am      3-1       ; result3: result:=3;
19409 21260  j7:  al  w0  1         ; result1:   or  :=1;
19410 21262  c.p101 b.f1 w.         ;*****test46*****
19411 21262       rs. w3  f0.       ;
19412 21264       jl. w3  f4.       ;
19413 21266       46                ;
19414 21268  f0:  0                 ;
19415 21270       jl.     f1.       ;
19416 21272       rs  w0  g24       ;
19417 21274       al  w0  g20       ;
19418 21276       al  w1  g24       ;   dump answer (g20,21,22,23) and result (g24);
19419 21278       jl. w3  f5.       ;
19420 21280  f1:                    ;
19421 21280  e.z.                   ;*****test46*****
19422 21280       rl  w1     b19    ;
19423 21282       rl  w3  x1+a56    ;
19424 21284       sn  w3  0         ;   if message not regretted then
19425 21286       jl  w3  g19       ; deliver: deliver result(result);
19426 21288       al  w0  0         ;
19427 21290       rs  w0  x1+a56    ;   clear (regretted flag);
19428 21292       rs  w0  x1+p2     ;   state:=idle;
19429 21294       jl  w3  g25       ;   next operation;
19430 21296       jl.     j0.       ;   goto execute;
19431 21298  e.
19432 21298  \f


19432 21298  
19432 21298  ; start operation.
19433 21298  
19433 21298  ; w1: transmitter.
19434 21298  e9:  rl  w2  x1+a50    ; entry1: main:=main(trm);
19435 21300       al  w0  0         ;
19436 21302       hs  w0  x1+s10    ;   errorcount:=0;
19437 21304       bz  w0  x2+p73    ;
19438 21306       al  w3  2.1110    ;
19439 21308       la  w3  0         ;   contents:=operation(4:6);
19440 21310       hs  w3  x2+p77    ;
19441 21312       sz  w0  4.01000   ;   if initiate then
19442 21314       jl. w3  n3.       ;     initiate proc desc;
19443 21316       sz  w0  4.00300   ;   if delay then
19444 21318       jl.     m1.       ;     goto start wait;
19445 21320  
19445 21320  m0:  al  w0  3         ; start trm-rec:
19446 21322       rs  w0  x1+p2     ;   state:=transmitting;
19447 21324       jl. w3  n1.       ;   setup startbyte;
19448 21326       jl. w3  n2.       ;   setup channelprogram;
19449 21328       al  w0  1<2       ;   function:=start channel pg;
19450 21330       rl  w2  x1+s5     ;   mess buff:=mess buff(op);
19451 21332       rl  w3  x1+a235   ;   dev desc:=dev desc(trm);
19452 21334       al. w1  c0.       ;   start(ch pg):=start1;
19453 21336  c.p101 b.f1 w.         ;*****test33*****
19454 21336       rs. w3  f0.       ;
19455 21338       jl. w3  f4.       ;
19456 21340       33                ;
19457 21342  f0:  0                 ;
19458 21344       jl.     f1.       ;
19459 21346       al. w0  c0.       ;
19460 21348       al. w1  c6.+4     ;
19461 21350       jl. w3  f5.       ;
19462 21352  f1:                    ;
19463 21352  e.z.                   ;*****test33*****
19464 21352  c.p102                 ;*****statistics begin*****
19465 21352  c.p101 b. f1 w.        ;*****test 0*****condition of statistics*****
19466 21352       rs. w3  f0.       ; <*statistics if test 0 is on*>
19467 21354       jl. w3  f4.       ;
19468 21356       0                 ;
19469 21358  f0:  0                 ;
19470 21360       jl.     f1.       ;
19471 21362       ds. w1  i1.       ;
19472 21364       jd      1<11+36   ;   get clock;
19473 21366       am      (b19)     ;
19474 21368       ds  w1  +s11+2    ;   save start time(operation);
19475 21370       dl. w1  i1.       ;
19476 21372  f1:  rl. w3  f0.       ;
19477 21374  e.z.                   ;*****test 0*****end condition******
19478 21374  z.                     ;*****statistics end*****
19479 21374       jd      1<11+p109 ;   start io;
19480 21376       sn  w0  0         ;   if result=0 then
19481 21378       jl     (b20)      ;     wait;
19482 21380       rl  w1  b19       ;
19483 21382       rl  w2  x1+a50    ;
19484 21384       hs  w0  x2+p74    ;   result:=io-result;
19485 21386       jl.     m12.      ;   goto return;
19486 21388  
19486 21388  m4:  am      4.02000   ; reset and wait: operation:=reset, short delay;
19487 21390  m5:  al  w0  4.00133   ; wait: operation:=short delay;
19488 21392  m1:  sz  w0  4.00033   ; start wait:
19489 21394       am      2-1       ;   if dummy header then
19490 21396       al  w2  1         ;     state(trm):=waiting before poll;
19491 21398       rs  w2  x1+p2     ;   else state(trm):=waiting;
19492 21400       rl  w3  x1+a235   ;   dev desc:=dev desc(trm);
19493 21402       so  w0  4.00200   ;   if short delay then
19494 21404       am      s7-s6     ;     time:=short delay;
19495 21406       rl  w1  x1+s6     ;   else time:=long delay;
19496 21408       sz  w0  4.02000   ;   if reset bit then
19497 21410       am      1<1       ;     function:=reset, start wait;
19498 21412       al  w0  2<2       ;   else function:=start std wait;
19499 21414       al  w2  0         ;   message buffer:=0;
19500 21416  c.p101 b.f1 w.         ;*****test34*****
19501 21416       rs. w3  f0.       ;
19502 21418       jl. w3  f4.       ;
19503 21420       34                ;
19504 21422  f0:  0                 ;
19505 21424       jl.     f1.       ;
19506 21426       al  w0  x1+2      ;
19507 21428       jl. w3  f5.       ;
19508 21430  f1:                    ;
19509 21430  e.z.                   ;*****test34*****
19510 21430       jd      1<11+p109 ;   start io;
19511 21432  
19511 21432  m9:  jl     (b20)      ; wait: wait;
19512 21434  
19512 21434  \f


19512 21434  
19512 21434  
19512 21434  ; after interrupt.
19513 21434  
19513 21434  ; w1: transmitter
19514 21434  c44: rl  w2  x1+a50    ; interrupt entry:
19515 21436  c.p101 b.f1 w.         ;*****test49*****
19516 21436       rs. w0  f0.       ;
19517 21438       jl. w3  f4.       ;
19518 21440       49                ;
19519 21442  f0:  0                 ;
19520 21444       jl.     f1.       ;
19521 21446       al  w2  x3        ;
19522 21448       dl  w0  x1+a231   ;
19523 21450       ds  w0  x2+2      ;
19524 21452       dl  w0  x1+a233   ;
19525 21454       ds  w0  x2+6      ;   dump std status area
19526 21456       rl  w0  x1+a244   ;   io-result;
19527 21458       rs  w0  x2+8      ;
19528 21460       al  w0  x2        ;
19529 21462       al  w1  x2+8      ;
19530 21464       jl. w3  f5.       ;
19531 21466  f1:                    ;
19532 21466  e.z.                   ;*****test49*****
19533 21466  c.p101 b.f1 w.         ;*****test36*****
19534 21466       rs. w3  f0.       ;
19535 21468       jl. w3  f4.       ;
19536 21470       36                ;
19537 21472  f0:  0                 ;
19538 21474       jl.     f1.       ;
19539 21476       al  w0  x1+p2     ;
19540 21478       al  w1  x1+s3     ;
19541 21480       jl. w3  f5.       ;
19542 21482  f1:                    ;
19543 21482  e.z.                   ;*****test36*****
19544 21482       rl  w3  x1+p2     ;
19545 21484       am      x3        ;
19546 21486       jl.    (x3+6)     ;   goto case state of
19547 21488       m15               ;   (-2: wait direct,
19548 21490       m16               ;    -1: operate direct,
19549 21492       m9                ;     0: idle,
19550 21494       m0                ;     1: waiting before poll,
19551 21496       m0                ;     2: waiting,
19552 21498       m10               ;     3: transmitting);
19553 21500  
19553 21500  m10:                   ; after transmission:
19554 21500  c.p102                 ;*****statistics begin*****
19555 21500  c.p101 b. f1 w.        ;*****test 0*****condition of statistics*****
19556 21500       rs. w3  f0.       ;
19557 21502       jl. w3  f4.       ;
19558 21504       0                 ;
19559 21506  f0:  0                 ;
19560 21508       jl.     f1.       ;
19561 21510       ds. w1  i1.       ;
19562 21512       ds. w3  i2.       ;
19563 21514       jd      1<11+36   ;   get clock;
19564 21516       rl  w2  b19       ;
19565 21518       ss  w1  x2+s11+2  ;
19566 21520       al  w2  x2+s12    ;
19567 21522       sl  w1  800       ;   time>80.0;
19568 21524       al  w2  x2+2      ;
19569 21526       sl  w1  400       ;   time>40.0;
19570 21528       al  w2  x2+2      ;
19571 21530       sl  w1  200       ;   time>20.0;
19572 21532       al  w2  x2+2      ;
19573 21534       sl  w1  100       ;   time>10.0;
19574 21536       al  w2  x2+2      ;
19575 21538       sl  w1  50        ;   time>5.0;
19576 21540       al  w2  x2+2      ;
19577 21542       al  w0  1         ;
19578 21544       wa  w0  x2        ;   number(time zone) increased 1;
19579 21546       rs  w0  x2        ;
19580 21548       dl. w1  i1.       ;
19581 21550       dl. w3  i2.       ;
19582 21552  f1:  rl. w3  f0.       ;
19583 21554  e.z.                   ;*****test 0*****end condition*****
19584 21554  z.                     ;*****statistics end*****
19585 21554       jl. w3  n0.       ;   check state(proc,result);
19586 21556       hs  w3  x2+p74    ;   result(main):=result;
19587 21558       bz  w0  x1+s3     ;
19588 21560       ls  w0  -4-2      ;
19589 21562       la. w0  i0.       ;
19590 21564       hs  w0  x2+p76    ;   blockcontrol:=statusbyte(5:6);
19591 21566  c.p101 b.f2 w.         ;*****test38*****
19592 21566       rs. w3  f0.       ;
19593 21568       jl. w3  f4.       ;
19594 21570       38                ;
19595 21572  f0:  0                 ;
19596 21574       jl.     f1.       ;
19597 21576       al  w0  x2+p75    ;
19598 21578       al  w1  x2+p75+14 ;
19599 21580       jl. w3  f5.       ;
19600 21582  f1:                    ;
19601 21582  e.z.                   ;*****test38*****
19602 21582  c.p101 b.f1 w.         ;*****test35*****
19603 21582       rs. w3  f0.       ;
19604 21584       jl. w3  f4.       ;
19605 21586       35                ;
19606 21588  f0:  0                 ;
19607 21590       jl.     f1.       ;
19608 21592       al  w0  x1+s13    ;
19609 21594       al  w1  x1+s14-2  ;
19610 21596       jl. w3  f5.       ;
19611 21598  f1:                    ;
19612 21598  e.z.                   ;*****test35*****
19613 21598       sn  w3  0         ;   if result=0 then
19614 21600       jl.     m11.      ;     goto ok;
19615 21602  c.p101 b.f1 w.         ;*****test37*****
19616 21602       rs. w3  f0.       ;
19617 21604       jl. w3  f4.       ;
19618 21606       37                ;
19619 21608  f0:  0                 ;
19620 21610       jl.     f1.       ;
19621 21612       al  w2  x3        ;
19622 21614       dl  w0  x1+a231   ;
19623 21616       ds  w0  x2+2      ;
19624 21618       dl  w0  x1+a233   ;
19625 21620       ds  w0  x2+6      ;
19626 21622       rl  w3  x1+a244   ;
19627 21624       rl. w0  f0.       ;
19628 21626       ds  w0  x2+10     ;
19629 21628       al  w0  x2        ;
19630 21630       al  w1  x2+10     ;
19631 21632       jl. w3  f5.       ;
19632 21634  f1:                    ;
19633 21634  e.z.                   ;*****test37*****
19634 21634       al  w0  x2       ; save w3
19635 21636       jl  w2  (b31)     ; call errorlog
19636 21638       rl  w2  0         ; restore w3
19637 21640       bz  w0  x2+p73    ;
19638 21642       sz  w0  4.00001   ;   if no error recovery then
19639 21644       jl.     m12.      ;     goto return;
19640 21646  c.p102                 ;*****statistics begin*****
19641 21646       al  w0  1         ;
19642 21648       am      x3-3      ;
19643 21650       ba  w0  x1+s10    ;   errorcount(result):=errorcount(result)+1;
19644 21652       am      x3-3      ;
19645 21654       hs  w0  x1+s10    ;
19646 21656  z.                     ;*****statistics end*****
19647 21656       al  w0  1         ;
19648 21658       ba  w0  x1+s10    ;   errorcount:=errorcount+1;
19649 21660       hs  w0  x1+s10    ;
19650 21662       sl  w0  p140      ;   if errorcount>=max errorcount then
19651 21664       jl.     m12.      ;     goto return;
19652 21666       am      x3-3      ;
19653 21668       jl.    (x3-3)     ;   goto case result of
19654 21670       m0                ;     4: blocklength error(read),
19655 21672       m0                ;     5: parity error(read),
19656 21674       m4                ;     6: timeout(write),
19657 21676       m4                ;     7: timeout(mon),
19658 21678       m4                ;     8: abnormal termination,
19659 21680       m0                ;     9: blocklength error(statusbyte),
19660 21682       m0                ;    10: parity error(statusbyte),
19661 21684       m4                ;    11: waitpg term);
19662 21686  
19662 21686  m11: al  w0  1         ; ok:
19663 21688       wa  w0  x1+s4     ;   current blockno:=currentblockno+1;
19664 21690       rs  w0  x1+s4     ;
19665 21692  m12: al  w0  0         ; return:
19666 21694       rs  w0  x1+p2     ;   state:=ready;
19667 21696  c.p101 b.f1 w.         ;*****test39*****
19668 21696       rs. w3  f0.       ;
19669 21698       jl. w3  f4.       ;
19670 21700       39                ;
19671 21702  f0:  0                 ;
19672 21704       jl.     f1.       ;
19673 21706       al  w0  x1+2      ;
19674 21708       jl. w3  f5.       ;
19675 21710  f1:                    ;
19676 21710  e.z.                   ;*****test39*****
19677 21710       jl.     e12.      ;   return to main;
19678 21712  
19678 21712  i0:  2.11              ; mask
19679 21714  
19679 21714  c.p102                 ;*****statistics begin*****
19680 21714       0                 ;
19681 21716  i1:  0                 ;
19682 21718       0                 ;
19683 21720  i2:  0                 ;
19684 21722  z.                     ;*****statistics end*****
19685 21722  
19685 21722  e.
19686 21722  
19686 21722  \f


19686 21722  
19686 21722  ; check state(proc,result).
19687 21722  ; the procedure checks the result of the i/o operation by inspecting the timeout,
19688 21722  ; the status area of the receive operation and the statusbyte received.
19689 21722  ;  result:   0  ok
19690 21722  ;            4  blocklength error
19691 21722  ;            5  parity error(read)
19692 21722  ;            6  time-out(write)
19693 21722  ;            7  time-out(monitor)
19694 21722  ;            8  abnormal termination, that is buserror, disconnected line,
19695 21722  ;                                     disconnected controller, power up, etc.
19696 21722  ;            9  parity error(statusbyte)
19697 21722  ;           10  blocklength error(statusbyte)
19698 21722  ;           11  waitpg termination
19699 21722  ;
19700 21722  ;        call:         return:
19701 21722  ; w0                   destroyed
19702 21722  ; w1     proc          unchanged
19703 21722  ; w2                   unchanged
19704 21722  ; w3     link          result
19705 21722  b.i0,j20 w.
19706 21722  n0:  rs. w3  i0.       ; check state:
19707 21724       rl  w0  x1+a244   ;
19708 21726       se  w0  0         ;   if timeout<>0 then
19709 21728       jl.     j1.       ;     goto timeout-error;
19710 21730       bz  w0  x1+s0+6   ;
19711 21732       sz  w0  1<9       ;   if bit2(write event status)<>0 then
19712 21734       jl.     j13.      ;     goto timeout(write);
19713 21736       rl  w0  x1+s1+6   ;   if event status(rec)<>0 then
19714 21738       se  w0  0         ;     goto event-error;
19715 21740       jl.     j0.       ;
19716 21742       rl  w0  x1+s1+2   ;   if rem.char count=0 then
19717 21744       sn  w0  0         ;     goto check statusbyte;
19718 21746       jl.     j2.       ;   else
19719 21748       jl.     j11.      ;     goto blocklength error;
19720 21750  j0:  bz  w3  0         ; event-error:
19721 21752       sz  w3  1<10      ;   if bit1 then
19722 21754       jl.     j12.      ;     goto parity error;
19723 21756       sz  w3  1<7       ;   if bit4 then
19724 21758       jl.     j11.      ;     goto blocklength error;
19725 21760       jl.     j15.      ;   goto abnormal termination;
19726 21762  j1:  sn  w0  3         ; timeout-error:
19727 21764       jl.     j14.      ;   if timeout=3 then goto timeout(mon);
19728 21766       sn  w0  5         ;   if timeout=5 then
19729 21768       jl.     j18.      ;     goto waitpg term;
19730 21770       jl.     j15.      ;   goto abnormal termination;
19731 21772  j2:  bz  w0  x1+s3     ; check statusbyte:
19732 21774       sz  w0  2.01<4    ;   if statusbyte(7:7)=1 then
19733 21776       jl.     j16.      ;     goto parity(statusbyte);
19734 21778       sz  w0  2.10<4    ;   if statusbyte(6:6)=1 then
19735 21780       jl.     j17.      ;     goto blocklength(statusbyte);
19736 21782       jl.     j10.      ;   goto ok;
19737 21784  
19737 21784  j18: am      11-10     ; waitpg term:          result:=11;
19738 21786  j17: am      10-9      ; blocklength(statusbyte): res:=10;
19739 21788  j16: am      9-8       ; parity(statusbyte):   result:=9;
19740 21790  j15: am      8-7       ; abnormal termination: result:=8;
19741 21792  j14: am      7-6       ; timeout(mon):         result:=7;
19742 21794  j13: am      6-5       ; timeout(write):       result:=6;
19743 21796  j12: am      5-4       ; parity error:         result:=5;
19744 21798  j11: am      4-0       ; blocklength error:    result:=4;
19745 21800  j10: al  w3  0         ; ok:                   result:=0;
19746 21802       jl.    (i0.)      ;   return;
19747 21804  i0:  0                 ;  saved link;
19748 21806  e.
19749 21806  
19749 21806  
19749 21806  ; setup startbyte.
19750 21806  ;         call:        return:
19751 21806  ; w0                   operation
19752 21806  ; w1      proc         unchanged
19753 21806  ; w2      main         unchanged
19754 21806  ; w3      link         destroyed
19755 21806  b.i0,j1 w.
19756 21806  n1:  rs. w3  i0.       ; setup startbyte:
19757 21808       bz  w0  x2+p73    ;
19758 21810       sz  w0  4.30000   ;   if operation=special header then
19759 21812       jl.     j0.       ;     goto special header;
19760 21814       al  w3  4.00032   ;   startbyte:=
19761 21816       la  w3  0         ;     databit<3+headerbit<2+dataflag<1
19762 21818       rl  w0  x1+s4     ;
19763 21820       sz  w0  2.1       ;     +blockcount mod 2<7;
19764 21822       al  w3  x3+1<7    ;   return;
19765 21824       jl.     j1.       ;
19766 21826  j0:  sz  w0  4.10000   ; special header:
19767 21828       am      2.00100000;   if master clear then
19768 21830       al  w3  2.11011111;     startbyte:=master clear;
19769 21832  j1:  ls  w3  4         ;   else
19770 21834       hs  w3  x1+s2     ;     startbyte:=accept master clear;
19771 21836       jl.    (i0.)      ;   return;
19772 21838  i0:  0                 ;  saved link
19773 21840  e.
19774 21840  
19774 21840  
19774 21840  ; setup channelprogram(trm).
19775 21840  ;        call:         return:
19776 21840  ; w0                   destroyed
19777 21840  ; w1     proc          unchanged
19778 21840  ; w2     main          unchanged
19779 21840  ; w3     link          destroyed
19780 21840  b.i0,j0 w.
19781 21840  n2:  rs. w3  i0.       ; setup ch pg:
19782 21842       ld  w0  -100      ;  clear status area;
19783 21844       ds  w0  x1+s0+2   ;
19784 21846       ds  w0  x1+s0+6   ;
19785 21848       ds  w0  x1+s1+2   ;
19786 21850       ds  w0  x1+s1+6   ;
19787 21852       al  w0  -1        ;  statusbyte(trm):= dummy
19788 21854       rs  w0  x1+s3     ;
19789 21856       bz  w0  x2+p73    ;
19790 21858       so  w0  4.00002   ;   if dataflag(operation)=off then
19791 21860       jl.     j0.       ;     goto transmit header;
19792 21862       rl  w0  x2+p71    ;
19793 21864       rs  w0  x1+s5     ;   message buffer:=mess buff(main);
19794 21866       al  w0  -1        ;   op(header):= dummy in chain
19795 21868       hs. w0  c1.+1     ;
19796 21870       bz  w0  x2+p72    ;
19797 21872       hs. w0  c2.       ;   addr code:=addr code(data);
19798 21874       al  w0  3<8       ;
19799 21876       hs. w0  c2.+1     ;   op(data):=write;
19800 21878       rl  w0  x2+p65    ;
19801 21880       rs. w0  c2.+2     ;   first addr:=first data trm;
19802 21882       rl  w0  x2+p66    ;
19803 21884       rs. w0  c2.+4     ;   size:=size data;
19804 21886       jl.    (i0.)      ; exit: return;
19805 21888  j0:  al  w0  0         ; transmit header:
19806 21890       rs  w0  x1+s5     ;   message buffer:=0;
19807 21892       al  w0  3<8       ;
19808 21894       hs. w0  c1.+1     ;   op(header):=write;
19809 21896       al  w0  5<8       ;
19810 21898       hs. w0  c2.+1     ;   op(data):=dummy;
19811 21900       jl.    (i0.)      ; exit: return;
19812 21902  i0:  0                 ; saved link
19813 21904  e.
19814 21904  
19814 21904  
19814 21904  ; initiate proc desc(trm).
19815 21904  ;        call:         return:
19816 21904  ; w0                   unchanged
19817 21904  ; w1     trm           unchanged
19818 21904  ; w2                   unchanged
19819 21904  ; w3     link          destroyed
19820 21904  b.i1,j0 w.
19821 21904  n3:  ds. w0  i1.       ; initiate proc desc:
19822 21906       al  w3  x1+s0     ;
19823 21908       al  w0  0         ;   clear privat part of
19824 21910  j0:  rs  w0  x3        ;   proc desc from
19825 21912       al  w3  x3+2      ;   status area to reset delay;
19826 21914       se  w3  x1+s6     ;
19827 21916       jl.     j0.       ;
19828 21918       al  w0  1         ;
19829 21920       rs  w0  x1+s4     ;   current blockno:=1;
19830 21922       rl. w0  i1.       ;
19831 21924       jl.    (i0.)      ;
19832 21926  i0:  0                 ;
19833 21928  i1:  0                 ;
19834 21930  e.
19835 21930  
19835 21930  e.  ; end of block including transmitter.
19836 21930  
19836 21930  ; stepping stones:
19837 21930       jl.     h82.       ;
19838 21932       h82=k-2            ;
19839 21932  
19839 21932  c.p101
19840 21932  
19840 21932       jl.     f4.       ;
19841 21934       f4=k-2            ;
19842 21934  
19842 21934       jl.     f5.       ;
19843 21936       f5=k-2            ;
19844 21936  
19844 21936       jl.     f6.       ;
19845 21938       f6=k-2            ;
19846 21938  
19846 21938  z.
19847 21938  
19847 21938  e.  ; end of block including main- and line-drivers.
19848 21938  \f


19848 21938  
19848 21938  m.
19848 21938                  monhost - host process drivers 17.0 beta

19849 21938  
19849 21938  ;--------------------------------------------------------------------------
19850 21938  ;                      REVISION HISTORY 
19851 21938  ;--------------------------------------------------------------------------
19852 21938  ; DATE      TIME OR            DESCRIPTION
19853 21938  ;           RELEASE
19854 21938  ;--------------------------------------------------------------------------
19855 21938  ;88.03.24 14.1A HSI  start of description
19856 21938  ;                    rc3600 terminal: send att-mess to user of remoter when 
19857 21938  ;                    terminal is disconnected
19858 21938  ;88.04.19 08.32 HSI  Error in procedure n24; if more than one mess in remoter 
19859 21938  ;                    queue the monitor will break.
19860 21938  ;
19861 21938  
19861 21938  b.i30 w.
19862 21938  i0=88 03 02, i1=12 00 00
19863 21938  
19863 21938  ; if newtime (i0,i1) > oldtime (a133,a134) then oldtime:=newtime;
19864 21938  c.i0-a133
19865 21938    c.i0-a133-1, a133=i0, a134=i1, z.
19866 21938    c.i1-a134-1,          a134=i1, z.
19867 21938  z.
19868 21938  
19868 21938  i10=i0, i20=i1
19869 21938  
19869 21938  i15=i10/100000 , i10=i10-i15*100000 , i25=i20/100000 , i20=i20-i25*100000 
19870 21938  i14=i10/10000  , i10=i10-i14*10000  , i24=i20/10000  , i20=i20-i24*10000 
19871 21938  i13=i10/1000   , i10=i10-i13*1000   , i23=i20/1000   , i20=i20-i23*1000
19872 21938  i12=i10/100    , i10=i10-i12*100    , i22=i20/100    , i20=i20-i22*100
19873 21938  i11=i10/10     , i10=i10-i11*10     , i21=i20/10     , i20=i20-i21*10
19874 21938  
19874 21938  i2:  <:                              date  :>
19875 21962       (:i15+48:)<16+(:i14+48:)<8+46
19876 21964       (:i13+48:)<16+(:i12+48:)<8+46
19877 21966       (:i11+48:)<16+(:i10+48:)<8+32
19878 21968  
19878 21968       (:i25+48:)<16+(:i24+48:)<8+46
19879 21970       (:i23+48:)<16+(:i22+48:)<8+46
19880 21972       (:i21+48:)<16+(:i20+48:)<8+ 0
19881 21974  
19881 21974  i3:  al. w0  i2.       ; write date:
19882 21976       rs  w0  x2+0      ;   first free:=start(text);
19883 21978       al  w2  0         ;
19884 21980       jl      x3        ;   return to slang(status ok);
19885 21982  
19885 21982       jl.     i3.       ;
19886 21984  e.
19887 21984  j.
19887 21938                                date  88.03.02 12.00.00

19888 21938  
19888 21938  
19888 21938  
19888 21938  ; block containing host - and subprocess drivers.
19889 21938  
19889 21938  b.u100 w.
19890 21938  
19890 21938  c.-p103
19891 21938  p301=p71
19892 21938  p302=p72
19893 21938  p303=p73
19894 21938  p321=p91
19895 21938  p322=p92
19896 21938  p323=p93
19897 21938  z.
19898 21938  
19898 21938  ; block containing host and subhost drivers.
19899 21938  
19899 21938  b.s120 w.
19900 21938  
19900 21938  ; host process.
19901 21938  
19901 21938  b.i10,j10 w.
19902 21938  
19902 21938  ; format of the process description:
19903 21938  
19903 21938  m.
19903 21938                  host

19904 21938  ; a250:                ; <driver process description address>
19905 21938  ; a402:                ; <user bit table - dummy>
19906 21938  
19906 21938  
19906 21938  ; a48:                 ; <interval>
19907 21938  ; a49:                 ; <interval>
19908 21938  ; a10:                 ; <kind>=90
19909 21938  ; a11:                 ; <name>=<:host:>
19910 21938  ; a50:                 ; <dummy>
19911 21938  ; a52:                 ; <dummy>
19912 21938  ; a57, a58:            ; <dummy>
19913 21938  ; a54:                 ; <next message>
19914 21938  ; a55:                 ; <last message>
19915 21938  ; a56:                 ; <dummy>
19916 21938  \f


19916 21938  
19916 21938  
19916 21938  ; format of message and answer:
19917 21938  
19917 21938  s0=8      , s1=s0+1    ; operation  , mode
19918 21938  s2=s0+2                ; first addr(buffer)
19919 21938  s3=s2+2                ; last addr(buffer)
19920 21938  s4=s3+2   , s5=s4+1    ; dh.linkno  , hostno
19921 21938  s6=s4+2                ; dh.host-id
19922 21938  s7=s6+2   , s8=s7+1    ; dh.home-reg, dh.net-id
19923 21938  s9=s7+2                ; jh.host-id
19924 21938  s10=s9+2  , s11=s10+1  ; jh.linkno  , jh.net-id
19925 21938  
19925 21938  s31=22                 ; size of datas used in connection with operation=1
19926 21938  
19926 21938  ; the host-driver accepts the following operations and modes:
19927 21938  
19927 21938  ;  operation  mode    header-func     name
19928 21938  ;      1      5             9         lookup process
19929 21938  ;      1      6,7          13         lookup
19930 21938  ;      1      8,9          17         lookup reserve
19931 21938  ;      1      10,21        11         cancel reservation
19932 21938  ;      1      12,13        25         linkup remote
19933 21938  ;      1      14,15        29         linkup local
19934 21938  ;      1      16,17        32         lookup link
19935 21938  ;      2      0,1           8         release link
19936 21938  ;      9      0,1,2,3      45         operator output
19937 21938  ;     11      0,1,2,3      41         operator output-input
19938 21938  ;                           2         create
19939 21938  ;                           6         remove
19940 21938  \f


19940 21938  
19940 21938  
19940 21938  a0=1<23
19941 21938  i0:  a0>0+a0>1+a0>2+a0>9+a0>11
19942 21940  i1:  a0>5+a0>6+a0>7+a0>8+a0>9+a0>10+a0>11+a0>12+a0>13+a0>14+a0>15+a0>16+a0>17
19943 21942  i2:  a0>0+a0>1
19944 21944  i3:  a0>0+a0>1+a0>2+a0>3
19945 21946  
19945 21946  h90: bz  w0  x2+s0     ; host process:
19946 21948       rl. w1  i1.       ;
19947 21950       sn  w0  2         ;   mode mask:=mode mask(operation);
19948 21952       rl. w1  i2.       ;
19949 21954       se  w0  16        ;
19950 21956       sl  w0  3         ;
19951 21958       rl. w1  i3.       ;
19952 21960       rl. w0  i0.       ;
19953 21962       jl  w3  g16       ;   check operation(operation mask, mode mask);
19954 21964  
19954 21964  ; check host-addr.
19955 21964       rl  w0  x2+s1     ;
19956 21966       so  w0  2.1       ;   if address mode=1 then
19957 21968       jl.     j1.       ;    begin
19958 21970       la  w0  g50       ;     address mode:=0;
19959 21972       rs  w0  x2+s1     ;
19960 21974       rl  w3  x2+s4     ;     sub:=proc desc addr(mess);
19961 21976       rl  w1  b4        ;
19962 21978       al  w1  x1-2      ;
19963 21980  j0:  al  w1  x1+2      ;   if sub is not included in device part of nametable then
19964 21982       sl  w1 (b5)       ;     goto result 3;
19965 21984       jl      g5        ;
19966 21986       se  w3 (x1)       ;
19967 21988       jl.     j0.       ;
19968 21990       rl  w0  x3+a10    ;
19969 21992       la  w0  g50       ;
19970 21994       se  w0  p112      ;   if kind(sub)<>local or remote process then
19971 21996       jl      g5        ;     goto result3;
19972 21998       rl  w0  x3+a50    ;   if main(sub)=0 then
19973 22000       sn  w0  0         ;     goto free sub;
19974 22002       jl.     j4.       ;
19975 22004       bz  w0  x3+p11    ;
19976 22006       hs  w0  x2+s4     ;     dh.linkno:=dh.linkno(sub);
19977 22008       rl  w0  x3+p5     ;
19978 22010       rs  w0  x2+s6     ;     dh.host-id:=dh.host-id(sub);
19979 22012       bz  w0  x3+p6     ;
19980 22014       hs  w0  x2+s7     ;     dh.home-reg:=dh.home-reg(sub);
19981 22016       bz  w0  x3+p7     ;
19982 22018       hs  w0  x2+s8     ;     dh.net-id:=dh.net-id(sub);
19983 22020       bz  w0  x3+p9     ;
19984 22022       hs  w0  x2+s10    ;     jh.linkno:=jh.linkno(sub);
19985 22024       rl  w1  x3+a50    ;
19986 22026       rl  w0  x1+p202+p5;
19987 22028       rs  w0  x2+s9     ;     jh.host-id:=jh.host-id(subhost);
19988 22030       bz  w0  x1+p202+p7;
19989 22032       hs  w0  x2+s11    ;     jh.net-id:=jh.net-id(sender host);
19990 22034       bz  w0  x1+p202+p9;
19991 22036       hs  w0  x2+s5     ;     hostno:=rcno(subhost(main(sub)));
19992 22038                         ;    end;
19993 22038  
19993 22038  ; this block transfers the operation and mode of the message
19994 22038  ; into a function mode of the format:
19995 22038  ;    fmode:=header function<2+header mode.
19996 22038  j1:  bz  w0  x2+s0     ;
19997 22040       se  w0  1         ;   if operation=1 then
19998 22042       jl.     j2.       ;    begin
19999 22044       bz  w3  x2+s1     ;     if mode(mess)<>32 then
20000 22046       ls  w3  1         ;
20001 22048       se  w3  32        ;       header function:=(mode(mess)+1)<1;
20002 22050       al  w3  x3+1      ;     else
20003 22052       ls  w3  2         ;       header function:=mode(mess)<1;
20004 22054       rl  w0  x2+s3     ;
20005 22056       ws  w0  x2+s2     ;   if size(data)<std data buffer size then
20006 22058       sh  w0  s31-2-1   ;     goto result 3;
20007 22060       jl      g5        ;    end;
20008 22062       jl.     j3.       ;
20009 22064  j2:  al  w3  8<2       ;   if operation=2 then
20010 22066       se  w0  2         ;   begin
20011 22068       jl.     j5.       ;     header function := 8;
20012 22070       zl  w0  x2+s10    ;     if message.jh-linkno outside 
20013 22072       ls  w0  1         ;        device part of nametable then
20014 22074       wa  w0  b4        ;
20015 22076       sl  w0  (b4)      ;
20016 22078       sl  w0  (b5)      ;        goto result 3;
20017 22080       jl      g5        ;
20018 22082       jl.     j3.       ;   end;
20019 22084  j5:                    ;
20020 22084       sn  w0  9         ;   if operation=9 then
20021 22086       al  w3  45<2      ;     header function:=45;
20022 22088       sn  w0  11        ;   if operation=11 then
20023 22090       al  w3  41<2      ;     header function:=41;
20024 22092       bz  w0  x2+s1     ;
20025 22094       se  w0  0         ;   if mode<>0 then
20026 22096       al  w3  x3+1      ;     header mode:=1;
20027 22098  j3:  hs  w3  x2+s1     ;
20028 22100  
20028 22100  ; call subhost.
20029 22100       bz  w3  x2+s5     ;   subhost:=
20030 22102       ls  w3  1         ;     word(hostno<1+start(name table));
20031 22104       wa  w3  b4        ;
20032 22106       sl  w3 (b5)       ;   if host process outside name table then
20033 22108       jl      g5        ;     goto result3;
20034 22110       rl  w3  x3        ;
20035 22112       rl  w0  x3+a10    ;
20036 22114       se  w0  p111      ;   if kind(subhost)<>subhost kind then
20037 22116       jl      g5        ;     goto result 3;
20038 22118       rs  w3  b19       ;   current process:=subhost;
20039 22120  c.-p103
20040 22120       jl.     h34.      ;   goto subhost-driver;
20041 22120  z.
20042 22120  c.p103-1
20043 22120       jl.     h82.      ;   goto subhost-driver;
20044 22122  z.
20045 22122  
20045 22122  j4:  rl  w0  x2+s0     ; free sub:
20046 22124       se. w0 (i10.)     ;   if operation<>lookup process then
20047 22126       jl      g5        ;     goto result3;
20048 22128       ld  w0  -100      ;
20049 22130       rs  w0  g20       ;
20050 22132       ds  w0  g22       ;   status, bytes trf:=0,0;
20051 22134       jl      g7        ;   goto result1;
20052 22136  
20052 22136  i10: 1<12+2<1          ;
20053 22138  
20053 22138  e.                     ; end host process.
20054 22138  \f


20054 22138  
20054 22138  ; subhost process.
20055 22138  
20055 22138  ; block including the host-process driver.
20056 22138  
20056 22138  b.n130,q10,r40,t10 w.
20057 22138  
20057 22138  m.
20057 22138                  subhost

20058 22138  ; a250:                ; <driver process description address>
20059 22138  ; a402:                ; <user bit tabel>
20060 22138  
20060 22138  ; a48:                 ; <interval>
20061 22138  ; a49:                 ; <interval>
20062 22138  ; a10:                 ; <kind>
20063 22138  ; a11:                 ; <name>
20064 22138  ; a50:                 ; <mainproc>
20065 22138  ; a52:                 ; <reserver>
20066 22138  ; a57, a58:            ; <work0>,<work1>
20067 22138  ; a54:                 ; <next message>
20068 22138  ; a55:                 ; <last message>
20069 22138  ; a56:                 ; <external state>
20070 22138  
20070 22138  ; p0: start of specific part:
20071 22138  ; p1: top of specific part;
20072 22138  
20072 22138  ; p11: , p9 :          ; <devno> , <rcno>
20073 22138  ; p10: , p8 :          ; <subkind=-2> , <various>
20074 22138  ; p12:                 ; <state>
20075 22138  ; p14:                 ; <next subproc>
20076 22138  ; p15:                 ; <last subproc>
20077 22138  ; p16: , p17:          ; <buffers free> , <current bufno>
20078 22138  ; p18:                 ; <max bufsize=24>
20079 22138  ; p7 : , p6 :          ; <net-id(subhost)> , <home reg(subhost)>
20080 22138  ; p5 :                 ; <host-id(subhost)>
20081 22138  ; p13:                 ; <current message>
20082 22138  ; p19:                 ; start(mess buf table):         
20083 22138  ;  p19+v3<1            ; top(mess buf table).
20084 22138  
20084 22138  s100=p19+v3<1          ; start of output buffer:
20085 22138  s101=20                ;   size of output buffer
20086 22138  s102=s100+s101         ; start of input buffer:
20087 22138  s103=s101              ;   size of input buffer
20088 22138  \f


20088 22138  
20088 22138  
20088 22138  
20088 22138  h99: q0                ; deliver message
20089 22140       q1                ; transfer operation
20090 22142       q2                ; end transfer
20091 22144       q3                ; receive operation
20092 22146       q4                ; end receive
20093 22148  ;    q5                ; initiate process
20094 22148  
20094 22148  
20094 22148  ; answers to create and remove operations are stored in a message buffer
20095 22148  ; (claims are borrowed from the subprocess). the message buffers are queued
20096 22148  ; up in the event queue until the answer can be transmitted.
20097 22148  ; format of the save-buffer:
20098 22148  s16=8     , s17=s16+1  ;  -1          , header function<2
20099 22148  s18=s16+2 , s19=s18+1  ;  dh.linkno   , jh.linkno
20100 22148  s20=s18+2 , s21=s20+1  ;  bufno       , result
20101 22148  s22=s20+2 , s23=s22+1  ;  unused      , quality mask
20102 22148  s24=s22+2 , s25=s24+1  ;  jh.net-id   , jh.home-reg
20103 22148  s26=s24+2              ;  jh.host-id
20104 22148  s28=s26+2 , s29=s28+1  ;  state       , unused
20105 22148  s30=s28+2              ;  mode
20106 22148  
20106 22148  
20106 22148  r0:                    ; internal output buffer.
20107 22148  h. r1:  0 ,  r2:  0    ;   mode      , kind
20108 22150     r3:  0 ,  r4:  0    ;   timeout   , buffers
20109 22152  w. r5:  0              ;   buffersize
20110 22154     r6:  0 , r.4        ;   devicename
20111 22162     r7:  0              ;   jh. linkno
20112 22164     r8:  0              ;   jh. host-id
20113 22166  h. r9:  0 , r10: 0     ;   jh. home-reg, jh. net-id
20114 22168  w. r11: 0              ;   proc desc
20115 22170  
20115 22170  r20:                   ; internal input buffer.
20116 22170     r22: 0              ;   kind
20117 22172     r24: 0              ;   max. buffers
20118 22174     r25: 0              ;   max. buffersize
20119 22176     r26: 0 , r.4        ;   devicename
20120 22184     r27: 0              ;   jh. linkno
20121 22186     r28: 0              ;   jh. host-id
20122 22188  h. r29: 0 , r30: 0     ;   jh. home-reg, jh. net-id
20123 22190  w. r31: 0              ;   process description
20124 22192  
20124 22192     r32: 0              ;   dh. linkno
20125 22194  \f


20125 22194  
20125 22194  ; entry0.
20126 22194  
20126 22194  b.i10,j10 w.
20127 22194  
20127 22194  q0:                    ; entry0:
20128 22194       rl  w2  b18       ;
20129 22196       rl  w1  x2+6      ;   proc:=sender(mess);
20130 22198        
20130 22198       jl  w3  g14       ;   check user;
20131 22200       rl  w1  b19       ;
20132 22202  c.p101 b.f1 w.         ;*****test72*****
20133 22202       rs. w3  f0.       ;
20134 22204       jl. w3  f4.       ;
20135 22206       72                ;
20136 22208  f0:  0                 ;
20137 22210       jl.     f1.       ;
20138 22212       al  w0  x2+8      ;   dump contents of mess buffer
20139 22214       al  w1  x2+22     ;
20140 22216       jl. w3  f5.       ;
20141 22218  f1:                    ;
20142 22218  e.z.                   ;*****test72*****
20143 22218       bz  w0  x2+s1     ;
20144 22220       sn  w0  9<2       ;   if fmode=9<2 then
20145 22222       jl.     j0.       ;     goto lookup-process;
20146 22224       jl. w3  n20.      ;   link operation;
20147 22226       jl. w3  n21.      ;   testready and link;
20148 22228       jl     (b101)     ; exit0: return to main;
20149 22230  
20149 22230  ; lookup process.
20150 22230  ; lookup process delivers an answer equal to the one described in xxx and
20151 22230  ; an input data buffer of the format-
20152 22230  ;
20153 22230  ;    +0  kind
20154 22230  ;    +2  buffers
20155 22230  ;    +4  max. buffersize
20156 22230  ;    +6  name of the external process
20157 22230  ;    +14 jh. linkno(=logical devicenumber)
20158 22230  ;    +16 jh. host-id (=sender host)
20159 22230  ;    +18 jh. home-reg, jh. net-id
20160 22230  ;    +20 process description(external process)
20161 22230  
20161 22230  j0:  bz  w3  x2+s10    ; lookup process:
20162 22232       rs. w3  r27.      ;   jh.linkno:=jh.linkno(mess);
20163 22234       ls  w3  1         ;
20164 22236       wa  w3  b4        ;
20165 22238       rl  w3  x3        ;   sub:=sub(rcno);
20166 22240       bl  w0  x3+p10    ;
20167 22242       rs. w0  r22.      ;   kind:=subkind(sub);
20168 22244       sn  w0  -2        ;
20169 22246       am      v3<1-v0<1 ;   if sub=subhost then
20170 22248       am      v0<1      ;     number of message entries:=v3
20171 22250       al  w0  x3+p19    ;   else
20172 22252       rs. w0  i0.       ;     number of message entries:=v1;
20173 22254       al  w1  x3+p19    ;   max. buffers:=buffers free(sub);
20174 22256       al  w0  0         ;   for entry=first message entry step 1 until last entry do
20175 22258       bl  w2  x3+p16    ;     if entry used(<>0) then
20176 22260  j1:  se  w0 (x1)       ;       number of buffers:=number of buffers+1;
20177 22262       al  w2  x2+1      ;
20178 22264       al  w1  x1+2      ;
20179 22266       se. w1 (i0.)      ;
20180 22268       jl.     j1.       ;
20181 22270       rs. w2  r24.      ;   max. buffers:=number of buffers;
20182 22272       rl  w0  x3+p18    ;
20183 22274       ls  w0  -1        ;
20184 22276       wa  w0  x3+p18    ;
20185 22278       rs. w0  r25.      ;   max. buffersize:=max. buffersize(sub)//2*3;
20186 22280       dl  w1  x3+a11+2  ;
20187 22282       ds. w1  r26.+2    ;   name of external process:=process name(sub);
20188 22284       dl  w1  x3+a11+6  ;
20189 22286       ds. w1  r26.+6    ;
20190 22288       rl  w1  b19       ;
20191 22290       rl  w0  x1+p5     ;
20192 22292       rs. w0  r28.      ;   jh. host-id:=host-id(subhost);
20193 22294       rl  w0  x1+p6     ;
20194 22296       hs. w0  r29.      ;   jh. home-reg:=home-reg(subhost);
20195 22298       rl  w0  x1+p7     ;
20196 22300       hs. w0  r30.      ;   jh. net-id:=net-id(subhost);
20197 22302       rs. w3  r31.      ;   process description:=sub;
20198 22304  c.p101 b.f1 w.         ;*****test73*****
20199 22304       rs. w3  f0.       ;
20200 22306       jl. w3  f4.       ;
20201 22308       73                ;
20202 22310  f0:  0                 ;
20203 22312       jl.     f1.       ;
20204 22314       al. w0  r20.      ;
20205 22316       al. w1  r32.      ;   dump contents of input area
20206 22318       jl. w3  f5.       ;
20207 22320  f1:                    ;
20208 22320  e.z.                   ;*****test73*****
20209 22320       rl  w2  b18       ;
20210 22322       jl. w3  n1.       ;   deliver data(mess);
20211 22324       am      0         ;    sender stopped: impossible;
20212 22326       rl. w0 (r31.)     ;   if kind(sub)=remote subkind then
20213 22328       sn  w0  p112      ;     link desc:=1
20214 22330       am      2-1       ;   else
20215 22332       al  w0  1         ;     link desc:=2;
20216 22334       ls  w0  12        ;
20217 22336       rs  w0  x2+s1     ;   return value:=ok;
20218 22338       al  w3  s31       ;
20219 22340       al  w0  s31>1*3   ;   bytes trf(mess), chars trf(mess):=std buffer size;
20220 22342  j4:  ds  w0  x2+s3     ;
20221 22344       jl. w3  n19.      ; deliver:  deliver answer(ok,mess);
20222 22346       jl     (b101)     ; exit: return to main;
20223 22348  
20223 22348  i0:  0                 ;
20224 22350  
20224 22350  e.                     ; end of entry0;
20225 22350  \f


20225 22350  
20225 22350  ; entry1.
20226 22350  
20226 22350  b.i10,j10,m20 w.
20227 22350  
20227 22350  q1:  jl. w3 (i2.)      ; entry1: find first unprocessed message;
20228 22352  c.p101 b.f1 w.         ;****test74*****
20229 22352       rs. w3  f0.       ;
20230 22354       jl. w3  f4.       ;
20231 22356       74                ;
20232 22358  f0:  0                 ;
20233 22360       jl.     f1.       ;
20234 22362       al  w0  x2        ;   dump contents of mess
20235 22364       sn  w2  0         ;   if no mess then
20236 22366       al  w0  x2+24     ;     no record
20237 22368       al  w1  x2+22     ;
20238 22370       jl. w3  f5.       ;
20239 22372  f1:                    ;
20240 22372  e.z.                   ;*****test74*****
20241 22372       sn  w2  0         ;   if message queue empty then
20242 22374       jl.    (i1.)      ;     goto no block;
20243 22376       bz  w3  x2+s1     ;
20244 22378       ls  w3  -2-1      ;   function:=fmode>2;
20245 22380       jl.    (x3+i0.)   ;   goto case function of
20246 22382  
20246 22382  i0:  m0                ;    ( 0-3   : create,
20247 22384       m0                ;      4-7   : remove,
20248 22386       m2                ;      8-11  : release link,
20249 22388       m3                ;      12-15 : lookup,
20250 22390       m3                ;      16-19 : lookup reserve,
20251 22392       m3                ;      20-23 : cancel reservation,
20252 22394       m6                ;      24-27 : linkup remote,
20253 22396       m7                ;      28-31 : linkup local,
20254 22398       m2                ;      32-35 : lookup link,
20255 22400       -1                ;      36-39 : unused,
20256 22402       m10               ;      40-43 : operator output/input,
20257 22404       m10               ;      44-47 : operator output);
20258 22406  
20258 22406  i1:  u3                ;
20259 22408  i2:  u12               ;
20260 22410  
20260 22410  ; create.
20261 22410  ; remove.
20262 22410  ;
20263 22410  m0:  rl  w3  x1+a50    ; create:
20264 22412       bz  w0  x2+s1     ;
20265 22414       ls  w0  -2        ;
20266 22416       hs  w0  x3+p61    ; function(trm):=function( m buff)
20267 22418       bz  w0  x2+10     ;
20268 22420       hs  w0  x3+p69    ; receiver linkno(trm):=devno( m buff)
20269 22422       bz  w0  x2+11     ;
20270 22424       hs  w0  x3+p78    ; sender linkno(trm):=rcno( m buff)
20271 22426       bz  w0  x2+13     ;
20272 22428       rs  w0  x3+p64    ; size(trm):= result( m buff)
20273 22430       bz  w0  x2+20     ;
20274 22432  c.p103-1
20275 22432       hs  w0  x3+p62    ;   state(rec):=state(mess);
20276 22434       rl  w0  x2+22     ;   status(rec):=mode(mess);
20277 22436       rs  w0  x3+p63    ;
20278 22438  z.
20279 22438  c.-p103
20280 22438       hs  w0  x3+p74    ; various(trm):= quality mask( m buff )
20281 22438  z.
20282 22438       rl  w0  x2+16     ; receiver net-id, home reg(trm):=
20283 22440       rs  w0  x3+p301   ;        answer add1( m buff)
20284 22442       rl  w0  x2+18     ; receiver host-id(trm):=
20285 22444       rs  w0  x3+p303   ;        answer add2( m buff)
20286 22446       jl. w3  n10.      ;  get next free message entry;
20287 22448       la  w2  g50       ;
20288 22450       am     (x1+a50)   ;
20289 22452       hs  w3  +p68      ;  bufno(rec) := cur buf;
20290 22454       jl      (b101)    ; return to main
20291 22456  
20291 22456  ; release.
20292 22456  ; lookup link.
20293 22456  ;
20294 22456  m2:  jl. w3  n4.       ; release: setup header1;
20295 22458       jl     (b101)     ; exit: return;
20296 22460  
20296 22460  ; lookup.
20297 22460  ; lookup reserve.
20298 22460  ; cancel reservation.
20299 22460  ;
20300 22460  m3:  jl. w3  n0.       ; lookup: get data buffer(mess);
20301 22462       jl.     m16.      ;   sender stopped: goto stopped sender;
20302 22464       ld  w0  -100      ;   ok:
20303 22466       ds. w0  r8.       ;   value(unused fields):=0;
20304 22468       rs. w0  r10.      ;
20305 22470       jl.     j0.       ;   goto deliver;
20306 22472  
20306 22472  ; linkup remote.
20307 22472  ;
20308 22472  m6:  jl. w3  n0.       ; linkup remote: get data buffer(mess);
20309 22474       jl.     m16.      ;    sender stopped: goto stopped sender;
20310 22476       al  w0  0         ;    ok:
20311 22478       rs. w0  r7.       ;   jh.linkno:=0;
20312 22480       se. w0 (r8.)      ;   if host-id=0 then
20313 22482       jl.     j0.       ;     host-addr:=host-addr(subhost);
20314 22484       rl  w0  x1+p5     ;
20315 22486       rs. w0  r8.       ;
20316 22488       bz  w0  x1+p6     ;
20317 22490       hs. w0  r9.       ;
20318 22492       bz  w0  x1+p7     ;
20319 22494       hs. w0  r10.      ;
20320 22496  j0:  jl. w3  n2.       ; deliver:   check and packin(data);
20321 22498       jl.     m17.      ;    error: goto parameter error;
20322 22500  j1:  jl. w3  n5.       ; setup: setup header2;
20323 22502  c.p101 b.f1 w.         ;*****test75*****
20324 22502       rs. w3  f0.       ;
20325 22504       jl. w3  f4.       ;
20326 22506       75                ;
20327 22508  f0:  0                 ;
20328 22510       jl.     f1.       ;
20329 22512       al  w0  x1+s100   ;   dump output buffer
20330 22514       al  w1  x1+s100+s101-2
20331 22516       jl. w3  f5.       ;
20332 22518  f1:                    ;
20333 22518  e.z.                   ;*****test75*****
20334 22518       jl     (b101)     ; exit: return;
20335 22520  
20335 22520  ; linkup local.
20336 22520  ;
20337 22520  m7:  jl. w3  n0.       ; linkup local: get data buffer(mess);
20338 22522       jl.     m16.      ;    sender stopped: goto stopped sender;
20339 22524       rl  w0  x1+p5     ;    ok:
20340 22526       rs. w0  r8.       ;   host-addr:=host-addr(subhost);
20341 22528       bz  w0  x1+p6     ;
20342 22530       hs. w0  r9.       ;
20343 22532       bz  w0  x1+p7     ;
20344 22534       hs. w0  r10.      ;
20345 22536       jl. w3  n2.       ;   check and packin(data);
20346 22538       jl.     m17.      ;    error: goto parameter error;
20347 22540       rl. w2  r7.       ;    ok:
20348 22542       am     (b18)      ;
20349 22544       hs  w2  +s10      ;   jh.linkno(mess):=jh.linkno(data);
20350 22546       ls  w2  1         ;
20351 22548       wa  w2  b4        ;
20352 22550       sl  w2  (b5)      ;   if jh.linkno > max linkno then
20353 22552       jl.     m17.      ;      goto parameter error;
20354 22554       rl  w2  x2        ;   sub:=proc(jh. linkno);
20355 22556       rs. w2  r11.      ;   process desc:=proc desc(sub);
20356 22558       rl  w0  x2+a10    ;
20357 22560       rl  w3  x2+a50    ;   if kind(sub)<>free subprocess
20358 22562       sn  w0  p113      ;   or main(sub)<>0 then
20359 22564       se  w3  0         ;     goto no resources;
20360 22566       jl.     m15.      ;
20361 22568       jl. w3  n25.      ;   create subprocess(sub,host);
20362 22570       rl  w2  b18       ;
20363 22572       rl. w3  r11.      ;
20364 22574       rl  w0  x2+s6     ;
20365 22576       rs  w0  x3+p5     ;   host-id(sub):=dh.host-id(mess);
20366 22578       bz  w0  x2+s7     ;
20367 22580       hs  w0  x3+p6     ;   home-reg(sub):=dh.home-reg(mess);
20368 22582       bz  w0  x2+s8     ;
20369 22584       hs  w0  x3+p7     ;   net-id(sub):=dh.net-id(mess);
20370 22586       al  w0 -1         ;   dh-linkno(sub) := jh-linkno(sub) := -1;
20371 22588       rs  w0  x3+p11    ;
20372 22590       jl.     j1.       ;   goto setup;
20373 22592  
20373 22592  ; operator output.
20374 22592  ; operator output-input.
20375 22592  ;
20376 22592  m10:                   ; operator output:
20377 22592       bz  w0  x2+s1     ;
20378 22594       so  w0  2.1       ;   if function mode(mess)=1 then
20379 22596       jl.     j2.       ;
20380 22598       al  w0  0         ;
20381 22600       hs  w0  x2+s4     ;     dh.linkno:=0;
20382 22602       hs  w0  x2+s10    ;     jh.linkno:=0;
20383 22604  j2:  jl  w3  g34       ;   examine sender(mess);
20384 22606       jl.     m16.      ;    sender stopped: goto stopped sender;
20385 22608       jl  w3  g31       ;   increase stopcount(sender);
20386 22610       jl. w3  n6.       ;   setup header3;
20387 22612       jl     (b101)     ; exit: return to main;
20388 22614  
20388 22614  
20388 22614  ; no resources in job host.
20389 22614  m15:                   ; no resources:
20390 22614       rl  w2  b18       ;
20391 22616       jl. w3  n14.      ;   return noresources answer;
20392 22618       jl.     q1.       ;   goto entry1;
20393 22620  
20393 22620  
20393 22620  ; stopped sender.
20394 22620  m16: rl  w2  b18       ; stopped sender:
20395 22622       jl. w3  n12.      ;   return stopped answer;
20396 22624       jl.     q1.       ;   goto entry1;
20397 22626  
20397 22626  ; parameter error in data.
20398 22626  m17: al  w0  3         ; parameter error: result:=3;
20399 22628       jl  w3  g19       ;   deliver result;
20400 22630       jl.     q1.       ;   goto entry1;
20401 22632  
20401 22632  e.                     ; end of entry1;
20402 22632  
20402 22632  \f


20402 22632  
20402 22632  
20402 22632  
20402 22632  ; entry2.
20403 22632  
20403 22632  b.i5,j5 w.
20404 22632  
20404 22632  q2:                    ; entry2:
20405 22632       al  w0  0         ;
20406 22634       rs  w0  x1+p13    ;   current message:=0;
20407 22636       jl. w3 (i0.)      ;   test after header and data transmitted;
20408 22638       jl.     j1.       ;    goto error;
20409 22640                         ;    ok:
20410 22640       jl. w3  n8.       ;  get mess buf(trm);
20411 22642       sn  w2  0         ;  if mess = 0 then
20412 22644       jl.     j0.       ;    goto testnext;
20413 22646       bz  w0  x2+s1     ;
20414 22648       so  w0  2.10<2    ;   if type(header)<>answer then
20415 22650       jl.     j0.       ;     goto test next;
20416 22652       rs  w2  b18       ; answer type:
20417 22654       am     (x1+a50)   ;
20418 22656       bz  w0  +p60      ;
20419 22658       sn  w0  p161      ;   if int status=wait then
20420 22660       rs  w2  x1+p13    ;    current mess:=mess;
20421 22662       se  w0  p161      ;   else
20422 22664       jl. w3  n27.      ;     release buffer;
20423 22666       jl. w3  (i1.)      ;  clear message entry(trm);
20424 22668       jl.     j0.       ;   goto test next;
20425 22670  
20425 22670  j1:                    ;error:
20426 22670                         ;  <* partly created subprocesses must be removed *>
20427 22670       am     (x1+a50)   ;  function := transmitter.function;
20428 22672       zl  w0    +p61    ;
20429 22674       se  w0     29     ;  if function = linkup local or
20430 22676       sn  w0     v32    ;     function = answer create 
20431 22678       sz                ;
20432 22680       jl.        j0.    ;  then begin
20433 22682       am     (x1+a50)   ;    jh.linkno := transmitte.jhlinkno;
20434 22684       bz  w2    +p78    ;
20435 22686       ls  w2       1    ;
20436 22688       wa  w2      b4    ;
20437 22690       rl  w2  x2        ;    proc := name table(jh.linkno);
20438 22692       jl. w3     n24.   ;    remove subprocess(proc);
20439 22694                         ;  end;
20440 22694                         ;   end;
20441 22694  j0:                    ; test next:
20442 22694  c.p101 b.f1 w.         ;*****test76*****
20443 22694       rs. w3  f0.       ; 
20444 22696       jl. w3  f4.       ;
20445 22698       76                ;
20446 22700  f0:  0                 ;
20447 22702       jl.     f1.       ;
20448 22704       al  w0  x1+p19    ;
20449 22706       al  w1  x1+p19+16 ;
20450 22708       jl. w3  f5.       ;
20451 22710  f1:                    ;
20452 22710  e.z.                   ;*****test76*****
20453 22710       jl. w3  (i2.)      ;   find first unprocessed message;
20454 22712       se  w2  0         ;   if mess<>0 then
20455 22714       jl. w3  n21.      ;     testready and link;
20456 22716       jl     (b101)     ; exit2: return;
20457 22718  
20457 22718  i0:  u40               ;
20458 22720  i1: u41
20459 22722  i2: u12
20460 22724  
20460 22724  
20460 22724  e.
20461 22724  \f


20461 22724  
20461 22724  
20461 22724  
20461 22724  ; entry3.
20462 22724  
20462 22724  b.j10,i10 w.
20463 22724  q3:  jl. w3  n9.       ; entry3: get mess(bufno);
20464 22726  c.p101 b.f1 w.         ;*****test80*****
20465 22726       rs. w3  f0.       ;
20466 22728       jl. w3  f4.       ;
20467 22730       80                ;
20468 22732  f0:  0                 ;
20469 22734       jl.     f1.       ;
20470 22736       al  w0  x2+0      ;   dump contents of mess
20471 22738       al  w1  x2+22     ;
20472 22740       jl. w3  f5.       ;
20473 22742  f1:                    ;
20474 22742  e.z.                   ;*****test80*****
20475 22742       rl  w3  x1+a50    ; 
20476 22744       bz  w0  x3+p99    ;
20477 22746       sn  w0  3         ;   if local function=reject then
20478 22748       jl.     j3.       ;     goto rejected;
20479 22750       bz  w0  x3+p81    ;
20480 22752       se  w0  v23+1     ;   if function<>operator output-input then
20481 22754       jl.     j1.       ;     goto lookup;
20482 22756       jl. w3 (i0.)      ; operator output-input: test and increase stopcount;
20483 22758       jl.     j0.       ;    error: goto setskip;
20484 22760       rl  w3  x1+a50    ;    ok:
20485 22762       rl  w0  x2+s2     ;   first:=first(mess);
20486 22764       rs  w0  x3+p85    ;
20487 22766  c.-p103
20488 22766       rl  w0  x2+s3     ;   last:=last(mess);
20489 22766       rs  w0  x3+p86    ;   count:=0;
20490 22766  z.
20491 22766  c.p103-1
20492 22766       al  w0  0         ;
20493 22768       hs  w0  x3+p92    ;   address code:=sender area;
20494 22770  c. p103-1
20495 22770       rs  w2  x3+p91      ; message buffer(main):= message
20496 22772  z.
20497 22772  z.
20498 22772       jl.     j2.       ;   goto setok;
20499 22774  
20499 22774  j3:                    ; rejected:
20500 22774       bz  w0  x3+p81    ;
20501 22776       se  w0  8         ;   if operation(rec)=release link
20502 22778       sn  w0  29        ;   or operation(rec)=linkup local then
20503 22780       jl. w3  n22.      ;     check and remove;
20504 22782       jl. w3  n9.       ;   get mess buffer;
20505 22784       al  w0  0         ;   bytes tranferred:=0;
20506 22786       jl. w3  n11.      ;   return answer(bytes trf);
20507 22788  
20507 22788  j0:  al  w0  p162      ; setskip:
20508 22790       am     (x1+a50)   ;   internal status:=skip;
20509 22792       hs  w0  +p80      ;
20510 22794       jl. w3  (i1.)     ;   find first message;
20511 22796       se  w2  0         ;   if mess<>0 then
20512 22798       jl. w3  n21.      ;     testready and link;
20513 22800       jl     (b101)     ; exit: return to main;
20514 22802  
20514 22802  j1:                    ; lookup:
20515 22802       al  w0  x1+s102   ;
20516 22804       rs  w0  x3+p85    ;   first:=first(std input buffer);
20517 22806  c.-p103
20518 22806       al  w0  x1+s102+s101-2
20519 22806       rs  w0  x3+p86    ;   last:=first+size;
20520 22806       al  w0  0         ;
20521 22806       hs  w0  x3+p87    ;   charcount:=0;
20522 22806  z.
20523 22806  c.p103-1
20524 22806       al  w0  s101>1*3  ;
20525 22808       rs  w0  x3+p86    ;   size(rec):=std data size;
20526 22810  c. p103-1
20527 22810       al  w0  0         ; messagebuf(main):= 0  (no buf.)
20528 22812       rs  w0  x3+p91    ;
20529 22814  z.
20530 22814       al  w0  8         ;
20531 22816       hs  w0  x3+p92    ;   address code:=dirty;
20532 22818  z.
20533 22818  
20533 22818  j2:  al  w0  p160      ; setok:
20534 22820       am     (x1+a50)   ;
20535 22822       hs  w0  +p80      ;   internal status:=ok;
20536 22824       jl     (b101)     ; exit: return;
20537 22826  
20537 22826  i0:  u21               ;
20538 22828  i1: u12
20539 22830  
20539 22830  e.                     ; end of entry3;
20540 22830  
20540 22830  \f


20540 22830  
20540 22830  ; entry 4.
20541 22830  
20541 22830  b.i10,j20,m20 w.
20542 22830  
20542 22830  q4:                    ; entry4:
20543 22830       am     (x1+a50)   ;
20544 22832       bz  w3  +p81      ;
20545 22834  c.p101 b.f1 w.         ;*****test84*****
20546 22834       rs. w3  f0.       ;
20547 22836       jl. w3  f4.       ;
20548 22838       84                ;
20549 22840  f0:  0                 ;
20550 22842       jl.     f1.       ;
20551 22844       rl  w3  x1+a50    ;
20552 22846       al  w0  x3+p80    ;   dump param area(rec)
20553 22848       al  w1  x3+p90    ;
20554 22850       jl. w3  f5.       ;
20555 22852  f1:                    ;
20556 22852  e.z.                   ;*****test84*****
20557 22852       ls  w3  -1        ;
20558 22854       jl.    (x3+i0.)   ;   goto case function of
20559 22856  
20559 22856  i0:  m0                ;     (  0-3   : create,
20560 22858       m1                ;        4-7   : remove,
20561 22860       m2                ;        8-11  : release,
20562 22862       m3                ;        12-15 : lookup,
20563 22864       m3                ;        16-19 : lookup reserve,
20564 22866       m3                ;        20-23 : cancel reservation,
20565 22868       m6                ;        24-27 : linkup remote,
20566 22870       m7                ;        28-31 : linkup local,
20567 22872       m3                ;        32-35 : lookup link,
20568 22874       -1                ;        36-39 : unused,
20569 22876       m10               ;        40-43 : operator output-input,
20570 22878       m11               ;        44-47 : operator output);
20571 22880  
20571 22880  
20571 22880  ; create.
20572 22880  ;
20573 22880  b.i10,j20 w.
20574 22880  m0:  jl. w3  n26.      ; create: get free buffer;
20575 22882     
20575 22882  ; initialize selected message buffer
20576 22882       al  w0  -1        ;
20577 22884       hs  w0  x2+8      ;
20578 22886       al  w0  v32<2     ;
20579 22888       hs  w0  x2+9      ;   mess(0):=-1,function;
20580 22890  c.-p103
20581 22890       bz  w0  x3+p94    ;
20582 22890       hs  w0  x2+15     ;   quality mask:=various
20583 22890  z.
20584 22890  c.p103-1
20585 22890       bz  w0  x3+p82    ;
20586 22892       hs  w0  x2+20     ;   state(mess):=state(rec);
20587 22894       rl  w0  x3+p83    ;
20588 22896       rs  w0  x2+22     ;   mode(mess):=mode(rec);
20589 22898  z.
20590 22898       bz  w0  x3+p98    ;
20591 22900       hs  w0  x2+10     ; devno(m buf):=sender lnkno(rec)
20592 22902       rs. w0  i3.       ; save dh.linkno
20593 22904       rl  w0  x3+p321   ; answer add1(m buf):=
20594 22906       rs  w0  x2+16     ;    sender net-id, sender home reg
20595 22908       rl  w0  x3+p323   ;  answer add2(m buf):=
20596 22910       rs  w0  x2+18     ;      sender host-id
20597 22912       rs. w0  i4.       ; save dh.id
20598 22914  ; find free subprocess description. start searching from high device numbers.
20599 22914  ; 1. search for a subprocess used in an earlier communication with this
20600 22914  ;    device.
20601 22914  ; 2. if not found then select a free one (free: name=0, users=0)
20602 22914       rl  w1  x1+a50    ; w1=main;
20603 22916       rl  w3     b5     ; sub := last sub;
20604 22918  j6:  al  w3  x3-2      ; while sub >= first sub do
20605 22920       sl  w3    (b4)    ; begin
20606 22922       jl.       +4      ;
20607 22924       jl.        j4.    ;
20608 22926                         ;
20609 22926       rl  w2  x3        ;   if sub.kind = free, remote or local then
20610 22928       rl  w0  x2+a10    ;   begin
20611 22930       se  w0     p112   ;
20612 22932       sn  w0     p113   ;
20613 22934       sz                ;
20614 22936       jl.        j6.    ;
20615 22938       rl  w0  x1+p323   ;     if sub.hostid = main.receiver.hostid and
20616 22940       se  w0 (x2+p5)    ;
20617 22942       jl.        j6.    ;
20618 22944  ;    rl  w0  x1+p321   ;        sub.netid,sub.homereg = main.receiver.
20619 22944  ;    se  w0 (x2+p7)    ;        netid,main.receiver.homereg and
20620 22944  ;    jl.        j6.    ;        <* excluded until defined in net *>
20621 22944       el  w0  x1+p98    ;        sub.linkno = main.receiver.dh-linkno then
20622 22946       bs  w0  x2+p11    ;
20623 22948       se  w0     0      ;     begin
20624 22950       jl.        j6.    ;
20625 22952       rl  w0  x2+a50    ;       <* device has used this subproc before -
20626 22954       sn  w0     0      ;          test if it is already connected *>
20627 22956       jl.        j5.    ;       if subproc.main = 0 then goto found;
20628 22958                         ;       <* device already connected - subproc will not
20629 22958                         ;          be reinitialized - return ok-answer *>;
20630 22958       ws  w3     b4     ;
20631 22960       as  w3     -1     ;
20632 22962       ds. w3     i1.    ;       save subproc, rc devno;
20633 22964       al  w0     p113   ;       sub.kind := temp;
20634 22966       rs  w0  x2+a10    ;
20635 22968       jl.        j8.    ;       goto return ok answer;
20636 22970                         ;     end;
20637 22970                         ;   end;
20638 22970                         ; end;
20639 22970  ; <* sub not found - select a free subprocess *>
20640 22970  j4:  rl  w3     b5     ; sub := last subprocess;
20641 22972  j3:  al  w3  x3-2      ; next:
20642 22974       sl  w3    (b4)    ;   if sub < first external then
20643 22976       jl.       +4      ;   goto return result (no resources);
20644 22978       jl.        j13.   ;
20645 22980                         ;
20646 22980       rl  w2  x3        ;
20647 22982       al  w0     p113   ;   if sub.kind <> free or remote then goto next;
20648 22984       se  w0 (x2+a10)   ;
20649 22986       jl.        j3.    ;
20650 22988       rl  w1  x2+a11    ;
20651 22990       se  w1     0      ;
20652 22992       jl.        j3.    ;   if sub.name(0) <> 0 then goto next;
20653 22994                         ; test users:
20654 22994  j2:  am      x1        ;   users := sub.user(w1);
20655 22996       rl  w0  x2+a402   ;   if users <> 0 then goto next;
20656 22998       se  w0     0      ;
20657 23000       jl.        j3.    ;
20658 23002       al  w1  x1+2      ;   w1 := w1 + 2;
20659 23004       sh  w1     a403-2 ;
20660 23006       jl.        j2.    ;   goto test users;
20661 23008                         ;
20662 23008  j5:                    ; found:
20663 23008    
20663 23008  ; free process description found: w2=free sub found, w3=add of subproc nametable entry
20664 23008       ws  w3  b4        ; rcno:=(entry(sub) - entry(first dev))/2
20665 23010       as  w3  -1        ;
20666 23012       ds. w3  i1.       ; save sub, rcno - jobhost linkno -
20667 23014       rl  w1  b19       ; w1:= host proc
20668 23016       jl. w3  n25.      ; create subprocess
20669 23018    
20669 23018  ; transfer receive parameters to subprocess
20670 23018       rl  w1  x1+a50    ; w1:=main
20671 23020       rl  w0  x1+p84    ;
20672 23022       al  w3  0         ;
20673 23024       wd  w0  g48       ;
20674 23026       ls  w0  1         ;   max buffersize(sub):=size(rec)/3*2;
20675 23028       rs  w0  x2+p18    ;
20676 23030       bz  w0  x1+p88    ;
20677 23032       hs  w0  x2+p16    ; buffers free(sub):=bufno(rec)
20678 23034       al  w0  8.377     ;
20679 23036       la  w0  x1+p83    ;
20680 23038       hs  w0  x2+p10    ; subkind(sub):=status(rec)(16:23);
20681 23040       bz  w0  x1+p98    ;
20682 23042       hs  w0  x2+p11    ; devno(sub):= sender linkno(rec)
20683 23044       rl. w0  i1.       ;
20684 23046       hs  w0  x2+p9     ; rcno(sub):= saved rcno
20685 23048  c.-p103
20686 23048       bz  w0  x1+p94    ;
20687 23048       ls  w0  -2        ;
20688 23048  z.
20689 23048  c.p103-1
20690 23048       bz  w0  x1+p82    ;
20691 23050       ls  w0  5         ;
20692 23052       rl  w3  x1+p83    ;
20693 23054       ls  w3  -8        ;
20694 23056       lo  w0  6         ;   data quality(sub):=state(mess)<5+mode(mess)(0:4);
20695 23058  z.
20696 23058       hs  w0  x2+p8     ; *data quality(sub):=quality mask(rec)
20697 23060       bz  w0  x1+p321   ;
20698 23062       hs  w0  x2+p7     ; receiver net-id(sub):=sender net-id(rec)
20699 23064       bz  w0  x1+p322   ;
20700 23066       hs  w0  x2+p6     ; receiver home reg(sub):=sender home reg(rec)
20701 23068       al  w0  0         ;***until net-id and home-reg are defined in the net:
20702 23070       rs  w0  x2+p6     ;   net-id, home-reg:=0,0;
20703 23072       rl  w0  x1+p323   ; receiver host-id(sub):=sender host-id(rec)
20704 23074       rs  w0  x2+p5     ;
20705 23076       zl  w1  x2+p11    ; 
20706 23078       jl. w3  n30.      ; name subproc(dh-hostid, dh-linkno, subproc);
20707 23080  c.p101 b.f1 w.         ;*****test85*****
20708 23080       rs. w3  f0.       ;
20709 23082       jl. w3  f4.       ;
20710 23084       85                ;
20711 23086  f0:  0                 ;
20712 23088       jl.     f1.       ;
20713 23090       al  w0  x2-4      ;
20714 23092       al  w1  x2+p19+14 ;
20715 23094       jl. w3  f5.       ;
20716 23096  f1:                    ;
20717 23096  e.z.                   ;*****test85*****
20718 23096  j8:  rl  w1  b19       ; w1:=host proc
20719 23098       rl  w2  b18       ; w2:=mess buff
20720 23100           
20720 23100  ; set rcno in message  buffer; receive param internal status:= ok;
20721 23100  ; link message to event queue of host and if host not already in
20722 23100  ; main queue then link it first in main queue. finnally return
20723 23100  ; to main initialize return point.
20724 23100       rl  w3  x1+a50    ; w3:=main
20725 23102       rl. w0  i1.       ;
20726 23104       hs  w0  x2+11     ; rcno(m buf):=saved rcno
20727 23106       al  w0  p160      ;
20728 23108       hs  w0  x3+p80    ; internal status(rec):=ok
20729 23110  c.p101 b.f1 w.         ;*****test86*****
20730 23110       rs. w3  f0.       ;
20731 23112       jl. w3  f4.       ;
20732 23114       86                ;
20733 23116  f0:  0                 ;
20734 23118       jl.     f1.       ;
20735 23120       rl. w3  f0.       ;
20736 23122       al  w0  x3+p80    ;
20737 23124       al  w1  x3+p90    ;
20738 23126       jl. w3  f5.       ;
20739 23128  f1:                    ;
20740 23128  e.z.                   ;*****test86*****
20741 23128       jl. w3  n23.      ;   testready and link answer;
20742 23130       rl. w2  i0.       ; return: w2:=sub created
20743 23132       am     (b101)     ;
20744 23134       jl      -2        ; return to main init
20745 23136  
20745 23136  ; error.
20746 23136  j10: am      0-1       ;
20747 23138  j12: am      1-3       ; error1:
20748 23140  j13: am      3-5       ; error3:
20749 23142  j9 : al  w0  5         ; error5:
20750 23144  c.p101 b.f1 w.         ;*****test87*****
20751 23144       rs. w3  f0.       ;
20752 23146       jl. w3  f4.       ;
20753 23148       87                ;
20754 23150  f0:  0                 ;
20755 23152       jl.     f1.       ;
20756 23154       rs  w0  x3        ;
20757 23156       al  w0  x3        ;
20758 23158       al  w1  x3        ;
20759 23160       jl. w3  f5.       ;
20760 23162  f1:                    ;
20761 23162  e.z.                   ;*****test87*****
20762 23162       rl  w2  b18       ;
20763 23164       hs  w0  x2+13     ; result(m buf):=case error _entry of ((0),1,3,5)
20764 23166  j14: rl  w1  b19       ; out:
20765 23168       rl  w3  x1+a50    ;
20766 23170       al  w0  p160      ; 
20767 23172       hs  w0  x3+p80    ;  internal state(main):=ok
20768 23174       jl. w3  n23.      ;   testready and link answer;
20769 23176       jl     (b101)     ;         
20770 23178  
20770 23178  
20770 23178  ; remove.
20771 23178  ;
20772 23178  m1:  jl. w3  n26.      ; remove: get free mess buffer;
20773 23180       al  w0  -1        ;
20774 23182       hs  w0  x2+8      ;
20775 23184       al  w0  v38<2     ;
20776 23186       hs  w0  x2+9      ;   mess(0):=-1,function;
20777 23188       bz  w0  x3+p88    ;
20778 23190       hs  w0  x2+12     ; bufno(m buf):= bufno(rec)
20779 23192       bz  w0  x3+p98    ;
20780 23194       hs  w0  x2+10     ;   dh.linkno(mess):=dh.linkno(rec);
20781 23196       bz  w0  x3+p89    ;
20782 23198       hs  w0  x2+11     ;   jh.linkno(mess):=jh.linkno(rec);
20783 23200       rl  w0  x3+p321   ; answer add1(m buf):=
20784 23202       rs  w0  x2+16     ;   sender net-id,home reg(rec)
20785 23204       rl  w0  x3+p323   ; answer add2(m buf):=
20786 23206       rs  w0  x2+18     ;   sender host-id
20787 23208       bz  w2  x3+p89    ;
20788 23210       ls  w2  1         ;
20789 23212       wa  w2  b4        ;
20790 23214       rl  w2  x2        ; sub:=proc(rcno)
20791 23216       rl  w0  x2+a10    ;
20792 23218       la  w0  g50       ; if kind(subproc kind)<>sub or
20793 23220       sn  w0  p112      ;    main(sub)<>main(host)
20794 23222       se  w3  (x2+a50)  ;
20795 23224       jl.     j12.      ;         then goto error1
20796 23226       bz  w0  x3+p98    ;
20797 23228       bs  w0  x2+p11    ;
20798 23230       bz  w3  x3+p89    ;
20799 23232       bs  w3  x2+p9     ;
20800 23234       sn  w0  0         ;   if dh.linkno(sub)<>dh.linkno(mess)
20801 23236       se  w3  0         ;   or jh.linkno(sub)<>jh.linkno(mess) then
20802 23238       jl.     j12.      ;     goto error1;
20803 23240       jl. w3  n24.      ;   remove subprocess(sub);
20804 23242  c.p101 b.f1 w.         ;*****test88*****
20805 23242       rs. w3  f0.       ;
20806 23244       jl. w3  f4.       ;
20807 23246       88                ;
20808 23248  f0:  0                 ;
20809 23250       jl.     f1.       ;
20810 23252       al  w0  x2-4      ;
20811 23254       al  w1  x2+p19+14 ;
20812 23256       jl. w3  f5.       ;
20813 23258  f1:                    ;
20814 23258  e.z.                   ;*****test88*****
20815 23258       rl  w2  b18       ;
20816 23260       jl.     j14.      ;   goto out;
20817 23262  
20817 23262  j20: al  w0  p163      ; error4:
20818 23264       hs  w0  x3+p80    ;   internal status:=reject;
20819 23266       jl     (b101)     ;   return(std);
20820 23268  
20820 23268  ; parameters.
20821 23268  
20821 23268  i0:  0                 ; subproc
20822 23270  i1:  0                 ; rcno
20823 23272  i2:  0                 ; devno
20824 23274  i3:  0                 ; save dev.host linkno
20825 23276  i4:  0                 ; save dev.host id
20826 23278  
20826 23278  e.
20827 23278  
20827 23278  ; release.
20828 23278  ;
20829 23278  m2:  jl. w3  n9.       ; release: 
20830 23280       am     (x1+a50)   ;
20831 23282       rl  w0  +p84      ;
20832 23284       sn  w0  0         ;   if result=ok then
20833 23286       jl.     j0.       ;     goto deliver;
20834 23288       rl  w3  x2+s9     ; notok:
20835 23290       bz  w0  x2+s11    ;   if jh.host-id(mess)<>jh.host-id(subhost)
20836 23292       bs  w0  x1+p7     ;   or jh.net-id(mess)<>jh.net-id(subhost) then
20837 23294       sn  w3 (x1+p5)    ;     goto deliver;
20838 23296       se  w0  0         ;
20839 23298       jl.     j0.       ;
20840 23300       bz  w3  x2+s10    ;
20841 23302       ls  w3  1         ;
20842 23304       wa  w3  b4        ;
20843 23306       rl  w3  x3        ;
20844 23308       rl  w0  x2+s6     ;   sub:=proc(jh.linkno);
20845 23310       bz  w1  x2+s8     ;   if dh.host-id(mess)=dh.host-id(sub)
20846 23312       bs  w1  x3+p7     ;   and dh.net-id(mess)=dh.net-id(sub)
20847 23314       sn  w0 (x3+p5)    ;   and dh.linkno(mess)=dh.linkno(sub)
20848 23316       se  w1  0         ;   and jh.linkno(mess)=jh.linkno(sub) then
20849 23318       jl.     j10.      ;     remove subprocess(sub);
20850 23320       bz  w0  x2+s4     ;
20851 23322       bs  w0  x3+p11    ;
20852 23324       bz  w1  x2+s10    ;
20853 23326       bs  w1  x3+p9     ;
20854 23328       sn  w0  0         ;
20855 23330       se  w1  0         ;
20856 23332       jl.     j10.      ;
20857 23334       al  w2  x3        ;
20858 23336       jl. w3  n24.      ;
20859 23338       al  w0  0         ;
20860 23340       rl  w1  b19       ;
20861 23342       am     (x1+a50)   ;   simulate ok-result;
20862 23344       rs  w0  +p84      ;
20863 23346  j10: rl  w1  b19       ;
20864 23348       rl  w2  b18       ;
20865 23350  j0:  al  w0  0         ; deliver:
20866 23352  j1:                    ;   return answer;
20867 23352  c.p101 b.f1 w.         ;*****test89*****
20868 23352       rs. w3  f0.       ;
20869 23354       jl. w3  f4.       ;
20870 23356       89                ;
20871 23358  f0:  0                 ;
20872 23360       jl.     f1.       ;
20873 23362       rl  w2  b18       ;
20874 23364       al  w0  x2+0      ;
20875 23366       al  w1  x2+22     ;   dump contents of mess
20876 23368       jl. w3  f5.       ;
20877 23370  f1:                    ;
20878 23370  e.z.                   ;*****test89*****
20879 23370       jl. w3  n11.      ;   return answer;
20880 23372       jl. w3  u12.      ;   find first message;
20881 23374       se  w2  0         ;   if mess<>0 then
20882 23376       jl. w3  n21.      ;     testready and link;
20883 23378       jl     (b101)     ; exit: return to main;
20884 23380  
20884 23380  ; lookup.
20885 23380  ; lookup reserve.
20886 23380  ; cancel reservation.
20887 23380  ; lookup link.
20888 23380  ;
20889 23380  m3:  jl. w3  n9.       ; lookup:
20890 23382       jl. w3  n18.      ;   return operation;
20891 23384       jl.     j1.       ;   goto release;
20892 23386  
20892 23386  
20892 23386  ; linkup remote.
20893 23386  ;
20894 23386  
20894 23386  m6:                    ;linkup remote:
20895 23386       jl. w3     n9.    ; get message buffer;
20896 23388       jl. w3     n18.   ; return operation;
20897 23390       rs. w0     i1.    ; save result (size);
20898 23392       al  w3     8.77   ;
20899 23394       am     (x1+a50)   ;
20900 23396       la  w3    +p84    ; result := rec.size;
20901 23398       sn  w0     0      ; if data.size = 0 or
20902 23400       jl.        j6.    ;
20903 23402       se  w3     0      ;    result<> 0,7 then
20904 23404       sn  w3     7      ;
20905 23406       jl.        j3.    ;
20906 23408                         ; begin
20907 23408  j6:  rl  w0  x2+s9     ;   <* remove the partly created subprocess 
20908 23410       se  w0 (x1+p5)    ;      if the job host is this job host *>
20909 23412       jl.        j4.    ;   if message.jh-id = subhost.jh-id and
20910 23414  ;    zl  w0  x2+s11    ;      message.jh-netid = subhost.jh-netid 
20911 23414  ;    bs  w0  x1+p7     ;
20912 23414  ;    se  w0     0      ;      <* netid test excluded until netid defined *>
20913 23414  ;    jl.        j4.    ;
20914 23414       zl  w2  x2+s10    ;    then begin
20915 23416       ls  w2     1      ;      subproc := message.jh-linkno * 2 +
20916 23418       wa  w2     b4     ;                 <first dev in nametable>;
20917 23420       rl  w2  x2        ;
20918 23422       jl. w3     n24.   ;      remove subprocess(subproc);
20919 23424       jl.        j4.    ;    end;
20920 23426                         ;  end else
20921 23426  j3:                    ;  begin
20922 23426       rl  w1  x2+6      ;    sender := 
20923 23428       sh  w1     0      ;    if message.sender < 0 then 
20924 23430       ac  w1  x1        ;      -message.sender     else
20925 23432       rl. w2     r31.   ;       message.sender;
20926 23434       sn  w2     0      ;    if message.jh-hostid= subhost.jh-hostid then
20927 23436       jl.        j4.    ;    begin
20928 23438       jl  w3     d126   ;       include user(sender, subproc);
20929 23440       rl  w1     (b6)   ;       exclude user(procfunc, subproc);
20930 23442       jl  w3     d123   ;       <*procfunc was included as user in the partly
20931 23444                         ;         created subprocess *>;
20932 23444                         ;    end;
20933 23444                         ;  end;
20934 23444                         ; end;
20935 23444  j4:  rl. w0     i1.    ; <* restore result (size) 
20936 23446       rl  w1     b19    ;            subhost
20937 23448       rl  w2     b18    ;            message *>
20938 23450       jl.        j1.    ; return operation;
20939 23452                         ;
20940 23452  i1:             0      ; saved result (size)
20941 23454  
20941 23454  
20941 23454  
20941 23454  ; linkup local.
20942 23454  ;
20943 23454  m7:  jl. w3  n9.       ; linkup local:
20944 23456       rl  w3  x1+a50    ;
20945 23458       rl  w0  x3+p84    ;   result:=size(18:23);
20946 23460       bz  w3  x3+p99    ;
20947 23462       se  w3  3         ;   if local function=reject
20948 23464       sz  w0  8.77      ;   or result<>0 then
20949 23466       jl.     j2.       ;     goto clear subprocess;
20950 23468       jl. w3  n3.       ;   packout(buffer);
20951 23470       rl  w1  b4        ;
20952 23472       jl.     +4        ;
20953 23474  j15: al  w1  x1+2      ;   for dev:= first dev. in name table step 2
20954 23476       sh  w1  (b5)      ;             until last dev. in name table do
20955 23478       jl.     +4        ;   begin
20956 23480       jl.     j16.      ;
20957 23482       rl  w2  x1        ;     if kind(dev) = remote subkind or
20958 23484       rl  w0  x2+a10    ;        kind(dev) = local subkind then
20959 23486       sn  w0  p112      ;     begin
20960 23488       jl.     j17.      ;
20961 23490       se  w0  p113      ;
20962 23492       jl.     j15.      ;
20963 23494  j17: am      (b18)     ;        if dh.id(dev) = dh.id and
20964 23496       rl  w0  +s6       ;           dh.linkno(dev) = dh.linkno(mess)
20965 23498       se  w0  (x2+p5)   ;           then remove subprocess(dev);
20966 23500       jl.     j15.      ;
20967 23502       bz  w0  x2+p11    ;
20968 23504       se. w0  (r32.)    ;
20969 23506       jl.     j15.      ;
20970 23508       jl. w3  n24.      ;
20971 23510       jl.     j15.      ;     end;
20972 23512                         ;   end;
20973 23512  ; initiate process description.
20974 23512  j16: rl  w1  b19       ;
20975 23514       rl. w2  r31.      ;
20976 23516       al  w0  p112      ;
20977 23518       rs  w0  x2+a10    ;   kind(sub):=local kind;
20978 23520       am     (b18)      ;
20979 23522       rl  w1  +6        ;   proc:=sender(mess);
20980 23524       sh  w1  0         ;
20981 23526       ac  w1  x1        ;
20982 23528  j7: jl  w3  d126       ; include proc + all ancestors as user
20983 23530      rl  w1  x1+a34     ;
20984 23532      se  w1  0          ;
20985 23534      jl.     j7.        ;
20986 23536       rl  w1 (b6)       ;   internal := procfunc;
20987 23538       jl  w3  d123      ;   remove user(internal, subproc);
20988 23540                         ; <* procfunc was included as user to prevent removel of
20989 23540                         ;    the (partly) created subproc *>
20990 23540       rl. w0  r32.      ;
20991 23542       hs  w0  x2+p11    ;   dh.linkno(sub):=dh.linkno;
20992 23544       rl. w0  r27.      ;
20993 23546       hs  w0  x2+p9     ;   jh. linkno(sub):=jh.linkno;
20994 23548       rl. w0  r22.      ;
20995 23550       hs  w0  x2+p10    ;   subkind(sub):=subkind;
20996 23552       rl. w0  r24.      ;
20997 23554       hs  w0  x2+p16    ;   buffers free(sub):=max buffers;
20998 23556       rl. w0  r25.      ;
20999 23558       al  w3  0         ;
21000 23560       wd  w0  g48       ;
21001 23562       ls  w0  1         ;
21002 23564       rs  w0  x2+p18    ;   max bufsize(sub):=max.bufsize/3*2;
21003 23566       zl  w1  x2+p11    ; 
21004 23568       rl  w0  x2+p5     ;
21005 23570       jl. w3  n30.      ; name subproc(dh-hostid, dh-linkno, subproc);
21006 23572       rl  w1  b19       ;
21007 23574       rl  w2  b18       ;
21008 23576       jl. w3  n1.       ;   deliver data;
21009 23578       am      0-s31     ;    error: size:=0;
21010 23580       al  w0  s31       ;   ok: size:=std buffer size;
21011 23582       rl. w3  r32.      ;
21012 23584       hs  w3  x2+s4     ;   dh.linkno(mess):=dh.linkno;
21013 23586  c.p101 b.f1 w.         ;*****test90*****
21014 23586       rs. w3  f0.       ;
21015 23588       jl. w3  f4.       ;
21016 23590       90                ;
21017 23592  f0:  0                 ;
21018 23594       jl.     f1.       ;
21019 23596       rl  w2  b18       ;
21020 23598       al  w0  x2+0      ;   dump contents of mess
21021 23600       al  w1  x2+22     ;
21022 23602       jl. w3  f5.       ;
21023 23604  f1:                    ;
21024 23604  e.z.                   ;*****test90*****
21025 23604       jl. w3  n11.      ;   return answer;
21026 23606       jl. w3  u12.      ;   find first message;
21027 23608       se  w2  0         ;   if mess<>0 then
21028 23610       jl. w3  n21.      ;     testready and link;
21029 23612       rl. w2  r31.      ; init-exit:
21030 23614       am     (b101)     ;
21031 23616       jl      -2        ;   return to main(init);
21032 23618  
21032 23618  ; clear subprocess description.
21033 23618  j2:  am     (b18)      ; clear process:
21034 23620       bz  w2  +s10      ;
21035 23622       ls  w2  1         ;
21036 23624       wa  w2  b4        ;   sub:=word(jh.linkno(mess)<1+base(name table));
21037 23626       rl  w2  x2        ;
21038 23628       jl. w3  n24.      ;   remove subprocess(sub);
21039 23630       rl  w2  b18       ;
21040 23632       jl. w3  n18.      ;   return operation;
21041 23634       jl.     j1.       ;   goto deliver;
21042 23636  
21042 23636  
21042 23636  ; operator output-input.
21043 23636  ;
21044 23636  m10: jl. w3  n9.       ; operator output-input:
21045 23638       am     (x1+a50)   ;
21046 23640       bz  w0  +p81      ;
21047 23642       so  w0  2.1       ;   if no datas received then
21048 23644       jl.     j0.       ;     goto deliver size0;
21049 23646       am     (x1+a50)   ;
21050 23648       bz  w2  +p88      ;   bufno:=bufno(rec);
21051 23650       jl. w3  u18.      ;   test and decrease stopcount;
21052 23652  c.-p103
21053 23652       rl  w2  b18       ;
21054 23652       al  w0  2         ;
21055 23652       wa  w0  x2+s3     ;   bytes trf:=last(mess)-first(mess)+2;
21056 23652       ws  w0  x2+s2     ;
21057 23652  z.
21058 23652  c.p103-1
21059 23652       am     (x1+a50)   ;
21060 23654       rl  w0  +p86      ;   bytes trf:=size(data);
21061 23656       jl. w3  u15.      ;   convert bytes8 to bytes12;
21062 23658  z.
21063 23658       jl.     j1.       ;   goto deliver size;
21064 23660  
21064 23660  
21064 23660  ; operator output.
21065 23660  ;
21066 23660  m11: jl. w3  n9.       ; operator output:
21067 23662       jl.     j0.       ;   goto deliver;
21068 23664  
21068 23664  e.                     ; end of entry4.
21069 23664  
21069 23664  
21069 23664  c.p101
21070 23664  ; stepping stones.
21071 23664       jl.     f4.       ;
21072 23666  f4=k-2
21073 23666       jl.     f5.       ;
21074 23668  f5=k-2
21075 23668       jl.     f6.       ;
21076 23670  f6=k-2
21077 23670  z.
21078 23670  \f


21078 23670  
21078 23670  
21078 23670  ; subprocedures used in subhost.
21079 23670  
21079 23670  ; get data.
21080 23670  ; copies a data area defined by current message buffer from sender to std driver
21081 23670  ; buffer.
21082 23670  ; deliver data.
21083 23670  ; transfers a datablock from std driver buffer to an internal process. the
21084 23670  ; buffer is defined in a message buffer.
21085 23670  ;        call:         return:
21086 23670  ; w0                   destroyed
21087 23670  ; w1     subhost       unchanged
21088 23670  ; w2     mess          unchanged
21089 23670  ; w3     link          destroyed
21090 23670  c.p103-1
21091 23670  b.i2 w.
21092 23670  n0:  am      i2        ; get data:
21093 23672  n1:  al. w1  i1.       ; deliver data:
21094 23674       jd      1<11+84   ;   general copy;
21095 23676       rl  w1  b19       ;
21096 23678       se  w0  0         ;   if result<>0 then
21097 23680       jl      x3+0      ;     return to link;
21098 23682       jl      x3+2      ; exit: return to link+2;
21099 23684  
21099 23684  
21099 23684  i0:  2<1+0             ; function (addr pair<1+mode)
21100 23686       r0                ; first
21101 23688       r0+s31-2          ; last
21102 23690       0                 ; relative
21103 23692  
21103 23692  i1:  2<1+1             ; function (addr pair<1+mode)
21104 23694       r20               ; first
21105 23696       r20+s31-2         ; last
21106 23698       0                 ; relative
21107 23700  
21107 23700  i2=i0-i1
21108 23700  e.
21109 23700  z.
21110 23700  
21110 23700  c.-p103
21111 23700  b.i5,j5 w.
21112 23700  n0:
21113 23700       ds. w3  i1.       ; get data buffer:
21114 23700       al  w0  s31       ;   bytecount:=std size(data);
21115 23700       al. w1  r0.       ;   first addr:=start(int driver buffer);
21116 23700       wa  w0  x2+10     ;
21117 23700       rl  w2  x2+10     ;
21118 23700  j0:  rl  w3  x2        ;
21119 23700       rs  w3  x1        ;
21120 23700       al  w2  x2+2      ;
21121 23700       al  w1  x1+2      ;
21122 23700       se  w2 (0)        ;
21123 23700       jl.     j0.       ;
21124 23700       rl  w1  b19       ;
21125 23700       dl. w3  i1.       ;
21126 23700       jl      x3+2      ;
21127 23700  n1:
21128 23700       ds. w3  i1.       ; get data buffer:
21129 23700       al  w0  s31       ;   bytecount:=std size(data);
21130 23700       al. w1  r20.      ;   first addr:=start(int driver buffer);
21131 23700       wa  w0  x2+10     ;
21132 23700       rl  w2  x2+10     ;
21133 23700  j0:  rl  w3  x1        ;
21134 23700       rs  w3  x2        ;
21135 23700       al  w2  x2+2      ;
21136 23700       al  w1  x1+2      ;
21137 23700       se  w2 (0)        ;
21138 23700       jl.     j0.       ;
21139 23700       rl  w1  b19       ;
21140 23700       dl. w3  i1.       ;
21141 23700       jl      x3+2      ;
21142 23700  i0:  0                 ;
21143 23700  i1:  0                 ;
21144 23700  e.
21145 23700  z.
21146 23700  
21146 23700  ; check and packin(buffer).
21147 23700  ; checks the values of the different fields and packs the data buffer into the
21148 23700  ; std output buffer in the process description of hostprocess. return to link
21149 23700  ; in case of errors else to link+2.
21150 23700  ;        call:         return:
21151 23700  ; w0                   destroyed
21152 23700  ; w1     subhost       unchanged
21153 23700  ; w2                   unchanged
21154 23700  ; w3     link          destroyed
21155 23700  b.i10 w.
21156 23700  n2:  rs. w3  i0.       ; check and packin:
21157 23702       bl. w3  r1.       ;
21158 23704       sl  w3  -1        ;   if mode<-1
21159 23706       sl  w3  1<8       ;   or mode>255 then
21160 23708       jl.    (i0.)      ;     return to link;
21161 23710       bl. w0  r2.       ;
21162 23712       sl  w0  -1        ;   if subkind<-1
21163 23714       sl  w0  1<8       ;   or subkind>255 then
21164 23716       jl.    (i0.)      ;     return to link;
21165 23718       ls  w0  16        ;
21166 23720       ld  w0  8         ;
21167 23722       rl. w0  r3.       ;
21168 23724       sz. w0 (i4.)      ;   if size(timeout) or size(buffers)>=8 bits then
21169 23726       jl.    (i0.)      ;     return to link;
21170 23728       ls  w0  4         ;
21171 23730       ld  w0  8         ;   word0(outarea):=
21172 23732       rs  w3  x1+s100+0 ;     mode<16+subkind<8+timeout;
21173 23734       ls  w0  4         ;
21174 23736       rl. w3  r5.       ;
21175 23738       sz. w3 (i7.)      ;   if size(buffer size)>=16 bits then
21176 23740       jl.    (i0.)      ;     return to link;
21177 23742       lo  w0  6         ;
21178 23744       rs  w0  x1+s100+2 ;   word1(outarea):=buffers<16+buffer size;
21179 23746       rl. w3  r7.       ;
21180 23748       sz. w3 (i6.)      ;   if size(jh.linkno)>=10 bits then
21181 23750       jl.    (i0.)      ;     return to link;
21182 23752       ls  w3  8         ;
21183 23754       rl. w0  r10.      ;
21184 23756       sz. w0 (i5.)      ;   if size(jh.net-id)>=8 bits then
21185 23758       jl.    (i0.)      ;     return to link;
21186 23760       lo  w0  6         ;
21187 23762       rs  w0  x1+s100+8 ;   word4(outarea):=jh.linkno<8+jh.net-id;
21188 23764       bz. w0  r9.       ;
21189 23766       sz. w0 (i5.)      ;   if size(jh.home-reg)>=8 bits then
21190 23768       jl.    (i0.)      ;     return to link;
21191 23770       ls  w0  16        ;
21192 23772       rl. w3  r8.       ;
21193 23774       sz. w3 (i7.)      ;   if size(jh.host-id)>=16 bits then
21194 23776       jl.    (i0.)      ;     return to link;
21195 23778       lo  w0  6         ;   word5(outarea):=
21196 23780       rs  w0  x1+s100+10;     jh.home-reg<16+jh.host-id;
21197 23782       dl. w0  r6.+2     ;
21198 23784       ds  w0  x1+s100+14;
21199 23786       dl. w0  r6.+6     ;   word6-9(outarea):=
21200 23788       ds  w0  x1+s100+18;     devicename;
21201 23790       am.    (i0.)      ;
21202 23792       jl      +2        ; exit: return to link+2;
21203 23794  
21203 23794  i0:  0                 ; saved link
21204 23796  i4:  8.7400 7400       ;
21205 23798  i5:  8.7777 7400       ;
21206 23800  i6:  8.7777 6000       ;
21207 23802  i7:  8.7760 0000       ;
21208 23804  
21208 23804  e.
21209 23804  
21209 23804  ; packout.
21210 23804  ; packs out a buffer from the std. input buffer in the process description of
21211 23804  ; the subhost process. the parameters are delivered in the std. driver input
21212 23804  ; buffer.
21213 23804  ;        call:         return:
21214 23804  ; w0                   destroyed
21215 23804  ; w1     subhost       unchanged
21216 23804  ; w2                   destroyed
21217 23804  ; w3     link          destroyed
21218 23804  b.i5 w.
21219 23804  n3:  rs. w3  i0.       ; packout:
21220 23806       rl  w0  x1+s102+0 ;
21221 23808       ls  w0  -8        ;
21222 23810       la. w0  i4.       ;
21223 23812       rs. w0  r22.      ;   subkind:=word0(8:15);
21224 23814       rl  w0  x1+s102+2 ;
21225 23816       al  w3  0         ;
21226 23818       ld  w0  8         ;
21227 23820       rs. w3  r24.      ;   max. buffers:=word1(0:7);
21228 23822       ls  w0  -8        ;
21229 23824       rs. w0  r25.      ;   max. buffersize:=word1(8:23);
21230 23826       rl  w0  x1+s102+4 ;
21231 23828       ls  w0  -8        ;
21232 23830       la. w0  i5.       ;
21233 23832       rs. w0  r32.      ;   dh.linkno:=word2(6:15);
21234 23834       rl  w3  x1+s102+8 ;
21235 23836       ld  w0  -8        ;
21236 23838       la. w3  i5.       ;
21237 23840       rs. w3  r27.      ;   jh.linkno:=word4(6:15);
21238 23842       ld  w0  -16       ;
21239 23844       hs. w0  r30.      ;   jh.net-id:=word4(16:23);
21240 23846       rl  w0  x1+s102+10;
21241 23848       ld  w0  8         ;
21242 23850       hs. w3  r29.      ;   jh.home-reg:=word5(0:7);
21243 23852       ls  w0  -8        ;
21244 23854       rs. w0  r28.      ;   jh.host-id:=word5(8:23);
21245 23856       al  w0  0         ;***jh.home-reg,jh.net-id:=0
21246 23858       rs. w0  r29.      ;*** used until they are defined from the dev contr
21247 23860       dl  w0  x1+s102+14;
21248 23862       ds. w0  r26.+2    ;
21249 23864       dl  w0  x1+s102+18;
21250 23866       ds. w0  r26.+6    ;   devicename:=word6-9(inarea);
21251 23868       rl. w3  r27.      ;
21252 23870       ls  w3  1         ;
21253 23872       wa  w3  b4        ;
21254 23874       rl  w3  x3        ;
21255 23876       bz  w0  x1+p7     ;
21256 23878       bs. w0  r30.      ;
21257 23880       rl  w2  x1+p5     ;
21258 23882       sn  w0  0         ;   if jobhost(data)=jobhost(subhost) then
21259 23884       se. w2 (r28.)     ;    proc desc:=word(jh.linkno<1+base(nametable));
21260 23886       al  w3  0         ;   else
21261 23888       rs. w3  r31.      ;     proc desc:=0;
21262 23890       jl.    (i0.)      ; exit: return;
21263 23892  
21263 23892  i0:  0                 ; saved link
21264 23894  i4:  8.0000 0377       ;
21265 23896  i5:  8.0000 1777       ;
21266 23898  
21266 23898  e.
21267 23898  
21267 23898  ; setup header1.
21268 23898  ; this procedure sets up the header transmission parameters according to
21269 23898  ; the format used of release link and lookup link.
21270 23898  ;
21271 23898  ; setup header2.
21272 23898  ; this procedure sets up the header transmission parameters according to 
21273 23898  ; the format used of lookup, lookup reserve, cancel reservation, linkup
21274 23898  ; remote and linkup local.
21275 23898  ;
21276 23898  ; setup header3.
21277 23898  ; this procedure sets up the header transmission parameters according to
21278 23898  ; the format used of operaor output and operator output-input.
21279 23898  ;
21280 23898  ;        call:         return:
21281 23898  ; w0                   destroyed
21282 23898  ; w1     subhost       unchanged
21283 23898  ; w2     mess          unchanged
21284 23898  ; w3     link          destroyed
21285 23898  b.i5,j5 w.
21286 23898  n4:  ds. w3  i1.       ; setup header1:
21287 23900       rl  w3  x1+a50    ;
21288 23902       rl  w0  x2+s9     ;
21289 23904       rs  w0  x3+p64    ;   size:=jh.host-id;
21290 23906       bz  w0  x2+s11    ;
21291 23908       rs  w0  x3+p63    ;   mode:=jh.net-id;
21292 23910       jl.     j0.       ;   goto common part;
21293 23912  
21293 23912  n5:  ds. w3  i1.       ; setup header2:
21294 23914       rl  w3  x1+a50    ;
21295 23916       al  w0  x1+s100   ;
21296 23918       rs  w0  x3+p65    ;   first:=first(outarea);
21297 23920  c.-p103
21298 23920       al  w0  x1+s100+s101-2;
21299 23920       rs  w0  x3+p66    ;   last:=last(outarea);
21300 23920       al  w0  s101>1*3  ;****midlertidigt
21301 23920       rs  w0  x3+p64    ;*****
21302 23920  z.
21303 23920  c.p103-1
21304 23920       al  w0  s101>1*3  ;
21305 23922       rs  w0  x3+p66    ;   size:=std buffer size;
21306 23924       al  w0  8         ;
21307 23926       hs  w0  x3+p72    ;   address code:=dirty;
21308 23928  z.
21309 23928       jl.     j0.       ;   goto common2;
21310 23930  
21310 23930  n6:  rs. w3  i1.       ; setup header3:
21311 23932       al  w0  x2+1      ;
21312 23934       rs. w0  i0.       ;   saved mess:=uneven mess;
21313 23936       rl  w0  x2+s2     ;
21314 23938       am     (x1+a50)   ;
21315 23940       rs  w0  +p65      ;   first(trm):=first(mess);
21316 23942       al  w0  2         ;
21317 23944       wa  w0  x2+s3     ;
21318 23946       ws  w0  x2+s2     ;   size12:=last(mess)+2-first(mess);
21319 23948       jl. w3  u14.      ;   convert size12 to size8;
21320 23950       rl  w3  x1+a50    ;
21321 23952       rs  w0  x3+p64    ;   size(trm):=size8;
21322 23954  c.-p103
21323 23954       rl  w0  x2+s3     ;
21324 23954  z.
21325 23954       rs  w0  x3+p66    ;   last(trm):=last(mess);
21326 23956                         ;   charcount(trm):=0;
21327 23956  c.p103-1
21328 23956  c. p103-1
21329 23956       al  w0  0         ;
21330 23958       hs  w0  x3+p72    ; address code(main):= sender area
21331 23960       al  w0  x2        ;
21332 23962       rs  w0  x3+p71    ; message buffer(main):= message
21333 23964  z.
21334 23964  z.
21335 23964  j0:  bz  w0  x2+s4     ; common1:
21336 23966       hs  w0  x3+p69    ;   rec.linkno:=dh.linkno(mess);
21337 23968       bz  w0  x2+s10    ;
21338 23970       hs  w0  x3+p78    ;   sender linkno(trm):=jh.linkno(mess);
21339 23972  
21339 23972  j1:  bz  w0  x2+s1     ; common2:
21340 23974       ls  w0  -2        ;   internal status:=ok, function(trm):=header function(mess);
21341 23976       hs  w0  x3+p61    ;   state(trm):=0;
21342 23978       al  w0  2.11      ;
21343 23980       la  w0  x2+s1     ;
21344 23982       rs  w0  x3+p63    ;   mode(trm):=function mode(mess);
21345 23984       bz  w0  x2+s8     ;
21346 23986       hs  w0  x3+p301   ;   receiver net-id(trm):=dh.net-id(mess);
21347 23988       bz  w0  x2+s7     ;
21348 23990       hs  w0  x3+p302   ;   receiver home-reg(trm):=dh.home-reg(mess);
21349 23992       rl  w0  x2+s6     ;
21350 23994       rs  w0  x3+p303   ;   receiver host-id(trm):=dh.host-id(mess);
21351 23996       rl. w2  i0.       ;   mess:=saved mess;
21352 23998       jl. w3  n10.      ;   get next free message entry(host);
21353 24000       la  w2  g50       ;   mess:=even mess;
21354 24002       am     (x1+a50)   ;
21355 24004       hs  w3  +p68      ;   bufno(trm):=current bufno;
21356 24006       jl.    (i1.)      ; exit: return;
21357 24008  
21357 24008  i0:  0                 ; saved mess
21358 24010  i1:  0                 ; saved link
21359 24012  
21359 24012  e.
21360 24012  
21360 24012  ; get mess buffer.
21361 24012  ;
21362 24012  ;        call:         return:
21363 24012  ; w0                   unchanged
21364 24012  ; w1     subhost       unchanged
21365 24012  ; w2                   mess buffer(bufno)
21366 24012  ; w3     link          unchanged
21367 24012  b. w.
21368 24012  n8:  am      p68-p88   ; get mess buf(trm):
21369 24014  n9:  al  w2  p88       ; get mess buf(rec);
21370 24016       am     (x1+a50)   ;
21371 24018       zl  w2  x2        ;
21372 24020       am      x2        ;
21373 24022       am      x2        ;
21374 24024       rl  w2  x1+p19    ;   mess:=even message addr(bufno);
21375 24026       la  w2  g50       ;
21376 24028       rs  w2  b18       ;   current buffer:=mess;
21377 24030       jl      x3        ;   return;
21378 24032  e.
21379 24032  
21379 24032  ; get next free message entry.
21380 24032  ; finds the next free mess entry in the message table, and inserts the value in
21381 24032  ; current bufno. mess - even or uneven - is inserted in the mess entry.
21382 24032  ;        call:         return:
21383 24032  ; w0                   destroyed
21384 24032  ; w1     subhost       unchanged
21385 24032  ; w2     mess          unchanged
21386 24032  ; w3     link          bufferno
21387 24032  b.i0,j1 w.
21388 24032  n10: rs. w3  i0.       ; get next free mess entry:
21389 24034       al  w0  -1        ;
21390 24036       ba  w0  x1+p16    ;   buffers free:=buffers free-1;
21391 24038       hs  w0  x1+p16    ;
21392 24040       al  w0  0         ;
21393 24042       bz  w3  x1+p17    ;
21394 24044       al  w3  x3-1      ;
21395 24046  j0:  al  w3  x3+1      ;
21396 24048       sl  w3  v3        ;
21397 24050       al  w3  0         ;
21398 24052       am      x3        ;
21399 24054       am      x3        ;
21400 24056       se  w0 (x1+p19)   ;
21401 24058       jl.     j0.       ;
21402 24060  j1:  hs  w3  x1+p17    ;
21403 24062       am      x3        ;
21404 24064       am      x3        ;
21405 24066       rs  w2  x1+p19    ;   insert message in mess entry;
21406 24068       ac  w0 (x2+4)     ; 
21407 24070       sl  w0  0         ;   if receiver(mess) > 0 then
21408 24072       jl.     (i0.)     ;   begin
21409 24074       rs  w0  x2+4      ;     receiver(mess):= -receiver(mess);
21410 24076       al  w0  -1        ;
21411 24078       am      (b21)     ;     bufclaim( driverproc):=
21412 24080       ba  w0  +a19      ;        bufclaim( driverproc) - 1;
21413 24082       am      (b21)     ;
21414 24084       hs  w0  +a19      ;   end;
21415 24086       jl.    (i0.)      ; exit: return;
21416 24088  i0:  0                 ; saved link
21417 24090  
21417 24090  e.
21418 24090  
21418 24090  ; return answer.
21419 24090  ;
21420 24090  ;        call:         return:
21421 24090  ; w0     bytes trf     destroyed
21422 24090  ; w1     subhost       unchanged
21423 24090  ; w2     mess          destroyed
21424 24090  ; w3     link          destroyed
21425 24090  b.i0 w.
21426 24090  n11: rs. w3  i0.       ; return answer:
21427 24092       rl  w3  0         ;
21428 24094       ls  w0  -1        ;
21429 24096       wa  w0  6         ;   bytes trf(mess):=bytes trf;
21430 24098       ds  w0  x2+s3     ;   chars trf(mess):=bytes trf*3/2;
21431 24100       am     (x1+a50)   ;
21432 24102       rl  w3  +p84      ;
21433 24104       ld  w0  -8        ;
21434 24106       ls  w3  2         ;
21435 24108       ld  w0  2         ;
21436 24110       ls  w3  6         ;
21437 24112       ld  w0  6         ;
21438 24114       am     (x1+a50)   ;
21439 24116       zl  w0  +p99      ;
21440 24118       sn  w0  3         ;   if local function=reject then
21441 24120       al  w3  8         ;     function result:=8;
21442 24122       rs  w3  x2+s0     ;   return value:=device status<16+linkno descriptor<12+function result;
21443 24124       rl. w0  r32.      ;
21444 24126       hs  w0  x2+s4     ;   dh.linkno(mess):=dh.linkno;
21445 24128       jl. w3  u11.      ;   clear message entry;
21446 24130       jl. w3  n19.      ;   deliver answer(ok,buf);
21447 24132  am (x1+a50)
21448 24134  bz w0 +p81
21449 24136  sn w0 42
21450 24138  am    p162-p160
21451 24140       al  w0  p160      ;
21452 24142       am     (x1+a50)   ;
21453 24144       hs  w0  +p80      ;   internal status(rec):=ok;
21454 24146       jl.    (i0.)      ; exit: return;
21455 24148  i0:  0                 ; saved link;
21456 24150  e.
21457 24150  
21457 24150  ; return stopped answer.
21458 24150  ;
21459 24150  ;        call:         return:
21460 24150  ; w0                   destroyed
21461 24150  ; w1     subhost       unchanged
21462 24150  ; w2     mess          destroyed
21463 24150  ; w3     link          destroyed
21464 24150  b.i0 w.
21465 24150  n12: am      -1+2      ; return stopped answer:
21466 24152  n13: am      -2-3      ; return relected answer:
21467 24154  n14: al  w0  3         ; return noresources answer:
21468 24156       rs. w3  i0.       ;
21469 24158       rs  w0  x2+s1     ;   function result:=-1;
21470 24160       ld  w0  -100      ;
21471 24162       ds  w0  x2+s3     ;   bytes, chars trf:=0,0;
21472 24164       jl. w3  n19.      ;   deliver answer(ok,mess);
21473 24166       jl.    (i0.)      ; exit: return;
21474 24168  i0:  0                 ; saved link
21475 24170  e.
21476 24170  
21476 24170  
21476 24170  ; return operation.
21477 24170  ;        call:         return:
21478 24170  ; w0                   size
21479 24170  ; w1     subhost       unchanged
21480 24170  ; w2                   message
21481 24170  ; w3     link          destroyed
21482 24170  b.i4,j4 w.
21483 24170  n18: rs. w3  i0.       ; return operation:
21484 24172       rl  w3  x1+a50    ;
21485 24174       bz  w0  x3+p81    ;
21486 24176       bz  w3  x3+p99    ;
21487 24178       sz  w0  2.1       ;   if no datas
21488 24180       sn  w3  3         ;   or local function=reject then
21489 24182       jl.     j0.       ;     size:=0;
21490 24184       jl. w3  n3.       ;   else
21491 24186       rl  w2  b18       ;     packout;
21492 24188       jl. w3  n1.       ;     deliver data;
21493 24190  j0:  am      0-s31     ;    sender stopped: size:=0;
21494 24192       al  w0  s31       ;    ok: size:=std size;
21495 24194       jl.    (i0.)      ; exit: return;
21496 24196  i0:  0                 ; save link
21497 24198  e.
21498 24198  
21498 24198  
21498 24198  ; deliver answer(ok,mess).
21499 24198  ;
21500 24198  ;        call:         return:
21501 24198  ; w0                   destroyed
21502 24198  ; w1     subhost       unchanged
21503 24198  ; w2     mess          destroyed
21504 24198  ; w3     link          destroyed
21505 24198  b.i0 w.
21506 24198  n19:                   ; deliver answer:
21507 24198  c.-p103
21508 24198       al  w0  1         ;
21509 24198       rs  w0  x2+4      ;   result(mess):=0k;
21510 24198       jl      d15       ;   deliver answer(mess);
21511 24198  z.
21512 24198  c.p103-1
21513 24198       rs. w3  i0.       ;
21514 24200       dl  w0  x2+10     ;
21515 24202       ds  w0  g21       ;
21516 24204       dl  w0  x2+14     ;   transfer 5 words from buffer to
21517 24206       ds  w0  g23       ;     answer area to possibilitate
21518 24208       rl  w0  x2+16     ;     the use of g18
21519 24210       rs  w0  g24       ;
21520 24212       jl  w3  g18       ;   deliver result(ok);
21521 24214       jl.    (i0.)      ; exit: return;
21522 24216  i0:  0                 ;  saved link
21523 24218  z.
21524 24218  e.
21525 24218  
21525 24218  
21525 24218  ; link operation.
21526 24218  ;
21527 24218  ;        call:         return:
21528 24218  ; w0                   destroyed
21529 24218  ; w1     proc          unchanged
21530 24218  ; w2     mess          destroyed
21531 24218  ; w3     link          destroyed
21532 24218  b.i0 w.
21533 24218  n20: rs. w3  i0.       ; link operation:
21534 24220       al  w1  x1+a54    ;
21535 24222       jl  w3  d6        ;
21536 24224       al  w1  x1-a54    ;
21537 24226       jl.    (i0.)      ; exit: return;
21538 24228  i0:  0                 ; saved link
21539 24230  e.
21540 24230  
21540 24230  
21540 24230  ; testready and link.
21541 24230  ; if free buffers is less than two and sender.cur mess not the subhost itself
21542 24230  ; then return.
21543 24230  ; (save the last message entry for answers to avoid deadlock )
21544 24230  ;
21545 24230  ; if the subhost is in mainproc queue, the state of the subhost is ready
21546 24230  ; and there is free buffers the subhost is linked in the main process queue.
21547 24230  ;        call:         return:
21548 24230  ; w0                   destroyed
21549 24230  ; w1     proc          destroyed
21550 24230  ; w2                   destroyed
21551 24230  ; w3     link          destroyed
21552 24230  b.i1 w.
21553 24230  n21: zl  w0  x1+p16    ; if free buffers <= 1
21554 24232       sl  w0     2      ; and sender(cur mess) < > cur receiver then
21555 24234       jl.        n23.   ;
21556 24236       rl  w2     b18    ; return else
21557 24238       se  w1  (x2+6)    ; begin
21558 24240       jl       x3       ; 
21559 24242  n23:                   ; subentry: test and link answer
21560 24242       rl  w0  x1+p14    ; testmore:
21561 24244       se  w0  x1+p14    ;   if proc already in mainproc queue then
21562 24246       jl      x3        ;     return to link;
21563 24248       rl  w0  x1+p12    ;
21564 24250       se  w0  0         ;   if state(proc)<>0 then
21565 24252       jl      x3        ;     return to link;
21566 24254       bl  w0  x1+p16    ;
21567 24256       sh  w0  0         ;   if buffers free=<0 then
21568 24258       jl      x3        ;     return to link;
21569 24260       al  w2  x1+p14    ; 
21570 24262       rl  w1  x1+a50    ;   main:=main(host);
21571 24264       rl  w1  x1+p14    ;   queue head:=last(mainproc queue);
21572 24266       jl      d6        ;   link(head,elem);
21573 24268                         ; exit: return to link;
21574 24268  e.
21575 24268  
21575 24268  
21575 24268  ; procedure check and remove.
21576 24268  ;        call:         return:
21577 24268  ; w0                   destroyed
21578 24268  ; w1     subhost       unchanged
21579 24268  ; w2                   destroyed
21580 24268  ; w3     link          destroyed
21581 24268  b.i4 w.
21582 24268  n22: rs. w3  i0.       ; check and remove:
21583 24270       rl  w3  x1+a50    ;
21584 24272       bz  w2  x3+p89    ;
21585 24274       ls  w2  1         ;
21586 24276       wa  w2  b4        ;   sub:=proc(jh.linkno(rec));
21587 24278       rl  w2  x2        ;
21588 24280       rl  w0  x3+p323   ;
21589 24282       sn  w0 (x2+p5)    ;   if main(sub)=main
21590 24284       se  w3 (x2+a50)   ;   and dh.host-id(sub)=dh.host-id(rec)
21591 24286       jl.    (i0.)      ;   and dh.net-id(sub)=dh.net-id(rec) then
21592 24288       bz  w0  x3+p321   ;     remove subprocess(sub);
21593 24290       bs  w0  x2+p7     ;
21594 24292       sn  w0  0         ;
21595 24294       jl. w3  n24.      ;
21596 24296       jl.    (i0.)      ; exit: return;
21597 24298  i0:  0                 ;
21598 24300  e.
21599 24300  
21599 24300  
21599 24300  ; remove  subprocess(sub).
21600 24300  ; removes a subprocess by returning all messages in the event queue 
21601 24300  ; with dummy answer and clearing the mainproc addr.
21602 24300  ;        call:         return:
21603 24300  ; w0                   destroyed
21604 24300  ; w1                   unchanged
21605 24300  ; w2     subproc       unchanged
21606 24300  ; w3     link          destroyed
21607 24300  b.i6,j5 w.
21608 24300  v102:                  ; remove subprocess:
21609 24300  n24:                   ;
21610 24300       rs. w3  i0.       ; remove subprocess: save link;
21611 24302       rs. w1  i1.       ;   save w1;
21612 24304  c.p101 b.f1 w.         ;*****test94*****
21613 24304       rs. w3  f0.       ; 
21614 24306       jl. w3  f4.       ;
21615 24308       94                ;
21616 24310  f0:  0                 ;
21617 24312       jl.     f1.       ;
21618 24314       rs  w2  x3        ;
21619 24316       al  w0  x3        ;
21620 24318       al  w1  x3        ;
21621 24320       jl. w3  f5.       ;
21622 24322  f1:                    ;
21623 24322  e.z.                   ;*****test94*****
21624 24322       jl. w3 (i2.)      ;   clean subproc(sub);
21625 24324       zl  w0  x2+p10    ; if terminal then
21626 24326       se  w0     8      ;      
21627 24328       jl.        j2.    ;
21628 24330                         ; begin
21629 24330       rs. w2     i5.    ;   save terminal
21630 24332       rl  w3    (b3)    ;   
21631 24334       al  w0  x3+a54    ;    message:= remoter.eventq.first;
21632 24336       rl  w3  x3+a54    ;    while message <> none do
21633 24338       rs. w0     i4.    ;    begin
21634 24340  j3:  rs. w3     i3.    ;
21635 24342       sn. w3    (i4.)   ;
21636 24344       jl.        j2.    ;
21637 24346       zl  w0  x3+a150   ;      if message.operation = wait for connect then
21638 24348       se  w0     2      ;      begin
21639 24350       jl.        j5.    ;
21640 24352       zl  w0  x3+a150+1 ;        if (message.mode = all connections) or
21641 24354       so  w0     2.1    ;           (message.mode = specific main and
21642 24356       jl.        j4.    ;            message.mainaddress = this main) then
21643 24358       rl  w0  x3+a151   ;        begin
21644 24360       se  w0 (x2+a50)   ;
21645 24362       jl.        j5.    ;
21646 24364  j4:  rl  w3  x3+a142   ;          sender:= message.sender;
21647 24366       rl  w0  x3+a10    ;          if sender.kind<>internal then
21648 24368       se  w0     0      ;            sender:=sender.main; <*pseudo proc*>
21649 24370       rl  w3  x3+a50    ;
21650 24372       rs. w3     i6.    ;           save reciver
21651 24374       rl. w2     i5.    ; 
21652 24376       al  w3     0      ;
21653 24378       al  w0     1<1    ; 
21654 24380       al  w1     g20    ;           att-mess +0 : 0    
21655 24382       ds  w0     g21    ;                    +2 : 1<1  ; terminal disconnected
21656 24384       rs  w2     g22    ;                    +4 : pd of terminal
21657 24386       dl  w0  x2+a11+2  ;                  +6-12: name of terminal   
21658 24388       ds  w0     g23+2  ;
21659 24390       dl  w0  x2+a11+6  ;
21660 24392       ds  w0     g23+6  ;
21661 24394       rl. w3     i6.    ;            send att-mess(w0=mess, w2=sender, w3=receiver)
21662 24396       rl  w2  x2+a50    ;
21663 24398       jd      1<11+17   ;
21664 24400       rl. w2     i5.    ;            restore terminal
21665 24402       jl.        j2.    ;           end;
21666 24404  
21666 24404  j5:  rl. w3     i3.    ;
21667 24406       rl  w3  x3+a140   ;           message:=message.next;
21668 24408       jl.        j3.    ;         end;
21669 24410  j2:  
21670 24410       al  w0  p113      ;
21671 24412       rs  w0  x2+a10    ;   kind(sub):=remote subproc kind;
21672 24414       ld  w0  -100      ;
21673 24416       ds  w0  x2+a11+2  ;   name(subproc):=0;
21674 24418       ds  w0  x2+a11+6  ;
21675 24420       rs  w0  x2+a50    ;   mainproc(subproc):=0;
21676 24422       rs  w0  x2+a52      ;   reserver:=0
21677 24424  j0:  am      x3          ;  
21678 24426       rs  w0  x2+a402     ;   users:=0
21679 24428       al  w3  x3+2        ;  
21680 24430       sh  w3   a403-2     ;
21681 24432       jl.      j0.        ; end;
21682 24434  j1:  rl. w1  i1.       ;   restore w1;
21683 24436       jl.    (i0.)      ; exit: return;
21684 24438  i0:  0                 ; saved link
21685 24440  i1:  0                 ; saved w1
21686 24442  i2:  v101              ;   address of clean subprocess
21687 24444  i3:  0                 ; message
21688 24446  i4:  0                 ; mess queue head
21689 24448  i5:  0                 ; terminal  
21690 24450  i6:  0                 ; receiver
21691 24452  e.
21692 24452  
21692 24452  
21692 24452  ; create subprocess.
21693 24452  ;        call:         return:
21694 24452  ; w0                   destroyed
21695 24452  ; w1     hostproc      unchanged
21696 24452  ; w2     subproc       unchanged
21697 24452  ; w3     link          destroyed
21698 24452  b.i10,j10 w.
21699 24452  n25: rs. w3  i0.       ; create subprocess: save link;
21700 24454       ds. w2  i2.       ;   save host, sub;
21701 24456       al  w0  0         ;   insert zeroes in
21702 24458       al  w3  x2+2      ;     process description;
21703 24460  j0:  rs  w0  x3        ;
21704 24462       al  w3  x3+2      ;
21705 24464       sh  w3  x2+a79-2  ;
21706 24466       jl.     j0.       ;
21707 24468       dl  w0  x1+a49    ;
21708 24470       ds  w0  x2+a49    ;   interval(sub):=interval(subhost);
21709 24472       rl  w0  x1+a50    ;
21710 24474       rs  w0  x2+a50    ;   main(sub):=main(host);
21711 24476       al  w0  x2+a54    ;   initiate next,last event;
21712 24478       rs  w0  x2+a54    ;
21713 24480       rs  w0  x2+a55    ;
21714 24482       al  w1  x2+p14    ;
21715 24484       rs  w1  x2+p14    ;   next, last subproc(sub):=sub;
21716 24486       rs  w1  x2+p15    ;
21717 24488  ; procfunc is inserted as user to prevent the monitor to remove the
21718 24488  ; subprocess while the subprocess is under creation.
21719 24488  
21719 24488       rl  w1 (b6)       ;   internal := procfunc;
21720 24490       jl  w3  d126      ;   include user(internal, subproc);
21721 24492       rl. w1  i1.       ;   restore host;
21722 24494       jl.    (i0.)      ; exit: return;
21723 24496  i0:  0                 ; saved link
21724 24498  i1:  0                 ; saved host
21725 24500  i2:  0                 ; saved sub
21726 24502  e.
21727 24502  
21727 24502  
21727 24502  ; get free buffer.
21728 24502  ; takes the first free buffer from the message buffer pool and inserts
21729 24502  ; it in the event queue.
21730 24502  ;        call:         return:
21731 24502  ; w0                   destroyed
21732 24502  ; w1     host          unchanged
21733 24502  ; w2                   buffer
21734 24502  ; w3     link          main
21735 24502  b.i0 w.
21736 24502  n26: rs. w3  i0.       ; get free buffer:
21737 24504       rl  w2  b8        ;   buffer:=first free in pool;
21738 24506       rs  w2  b18       ;
21739 24508       jl  w3  d5        ;   remove buffer;
21740 24510       rs  w1  x2+4      ;   receiver(buf):=subhost;
21741 24512       rs  w1  x2+6      ;   sender(buf):=subhost;
21742 24514       ld  w0  -100      ;
21743 24516       ds  w0  x2+10     ;
21744 24518       ds  w0  x2+14     ;   insert zeroes in mess buffer;
21745 24520       ds  w0  x2+18     ;
21746 24522       ds  w0  x2+22     ;
21747 24524       rl  w1  x1+a54    ; link message in front of queue                  
21748 24526       jl  w3  d6        ; (to avoid deadlock)
21749 24528       rl  w1  x2+4      ; restore subhost
21750 24530       rl  w3  x1+a50    ;
21751 24532       jl.    (i0.)      ; exit: return;
21752 24534  i0:  0                 ; link
21753 24536  e.
21754 24536  
21754 24536  
21754 24536  ; release buffer.
21755 24536  ; removes a buffer from the event queue and inserts it in the
21756 24536  ; pool of free buffers.
21757 24536  ;        call:         return:
21758 24536  ; w0                   unchanged
21759 24536  ; w1                   unchanged
21760 24536  ; w2     buffer        destroyed
21761 24536  ; w3     link          destroyed
21762 24536  b.i5 w.
21763 24536  n27: rs. w3  i0.       ; release buffer:
21764 24538       rs. w1  i1.       ;   save link, w1;
21765 24540       rl  w3  x2+4     ;  if rec(buf) < 0 then
21766 24542       sl  w3  0        ;   begin
21767 24544       jl.     i3.      ;
21768 24546       al  w1  1        ;
21769 24548       am     (b21)     ;    claim(driverproc) :=
21770 24550       ba  w1  +a19     ;       claim(driverproc) + 1;
21771 24552       am     (b21)     ;
21772 24554       hs  w1  +a19     ;   end;
21773 24556  i3:  jl  w3  d5        ;   remove buffer;
21774 24558       al  w1  b8        ;   pool:=empty pool;
21775 24560       jl  w3  d13       ;   insert buffer in pool;
21776 24562       rl. w1  i1.       ;   restore w1;
21777 24564       jl.    (i0.)      ; exit: return;
21778 24566  i0:  0                 ; saved link
21779 24568  i1:  0                 ; saved w1
21780 24570  
21780 24570  ; procedure name subproc(dh-hostid, dh-linkno, subproc);
21781 24570  ; gives the subprocess a unic name. the name will be illegal,
21782 24570  ; this is done to prevent any collision with existing names.
21783 24570  ;           call            return
21784 24570  ;  w0     dh-hostid       destroyed
21785 24570  ;  w1     dh-linkno       destroyed
21786 24570  ;  w2     subproc         subproc
21787 24570  ;  w3     link            destroyed
21788 24570  ;
21789 24570  
21789 24570  b. i10, j10 w.
21790 24570  
21790 24570  n30:                   ; name subproc
21791 24570       ds. w1     i1.    ; begin
21792 24572       ds. w3     i3.    ;
21793 24574       ld  w0    -100    ;   subproc.name := 0;
21794 24576       ds  w0  x2+a11+2  ;
21795 24578       ds  w0  x2+a11+6  ;
21796 24580       al  w2  x2+a11    ;   convert integer to text(dh-linkno, subproc.name,
21797 24582       jl. w3     n31.   ;                           no of char);
21798 24584       rl. w2     i2.    ;
21799 24586       rl  w1  x2+a11    ;
21800 24588       sl  w3     3      ;   if no of char<3 then
21801 24590       jl.        j1.    ;   subproc.name(1,3) :=
21802 24592       am      x3        ;   if no of char=2 then
21803 24594       jl.     x3        ;   "0" + subproc.name(1,2)
21804 24596       ls  w1    -8      ;   else "00" + subproc.name(1,1);
21805 24598       ls  w1    -8      ;
21806 24600       lo. w1  x3+i5.    ;
21807 24602       rs  w1  x2+a11    ;
21808 24604                         ;
21809 24604  j1:  rl. w1     i6.    ;   subproc.name(3,3) := <:sub:>;
21810 24606       rs  w1  x2+a11+2  ;
21811 24608       al  w2  x2+a11+4  ;   convert integer to text(dh-hostid,
21812 24610       rl. w1     i0.    ;     subproc.name(7,6), no of char);
21813 24612       jl. w3     n31.   ;
21814 24614                         ;
21815 24614       dl. w3     i3.    ;
21816 24616       jl      x3        ; 
21817 24618                         ;
21818 24618  i0:  0                 ; save registers
21819 24620  i1:  0                 ;
21820 24622  i2:  0                 ;
21821 24624  i3:  0                 ;
21822 24626  i5:  48<16 + 48<8      ; '0' + '0'
21823 24628       48<16             ; '0'
21824 24630  i6:  <:sub:>           ;
21825 24632                         ; 
21826 24632  e.                     ; end;
21827 24632  
21827 24632  ; procedure convert integer(integer, text, no of char);
21828 24632  ; converts the (positive) integer to a textstring stored in 
21829 24632  ; the specified address.
21830 24632  ;        call               return
21831 24632  ;  w0    -                 destroyed
21832 24632  ;  w1    integer           destroyed
21833 24632  ;  w2    text address      destroyed
21834 24632  ;  w3    link              no of char
21835 24632  ;
21836 24632  
21836 24632  b. i10, j10 w.
21837 24632  
21837 24632  i0:         1          ; divisor table
21838 24634             10          ;
21839 24636            100          ;
21840 24638           1000          ;
21841 24640          10000          ;
21842 24642         100000          ;
21843 24644        1000000          ;
21844 24646  i1:   0                ; char shift
21845 24648  i2:   0                ; no of char
21846 24650  i3:   0                ; position
21847 24652  i4:   0                ; integer
21848 24654  i5:   0                ; text
21849 24656  i6:   0                ; link
21850 24658                         ;
21851 24658  n31:                   ; convert integer
21852 24658       al  w0     0      ; begin
21853 24660       ds. w1     i4.    ;   save params; 
21854 24662       ds. w3     i6.    ;
21855 24664       al  w3     16     ;   position := 0;
21856 24666       rs. w3     i1.    ;   char shift := 16;
21857 24668                         ;
21858 24668       al  w3     0      ;   repeat begin
21859 24670  j1:  wd. w1     i0.+2  ;     integer := integer / 10;
21860 24672       al  w3  x3+1      ;     no of char := no of char + 1;
21861 24674       al  w0     0      ;
21862 24676       se  w1     0      ;   end until integer = 0;
21863 24678       jl.        j1.    ;
21864 24680                         ;
21865 24680       rs. w3     i2.    ;   rem character := no of char;
21866 24682  j2:  rl. w2     i4.    ;   repeat begin
21867 24684       al  w1     0      ;     char := (integer//divisor table(rem character)+
21868 24686       am      x3        ;              48) shift char shift;
21869 24688       wd. w2  x3+i0.-2  ;
21870 24690       al  w2  x2+48     ;
21871 24692       ls. w2    (i1.)   ;
21872 24694       rs. w1     i4.    ;     integer:=integer mod divisortabel(rem character);
21873 24696                         ;
21874 24696       rl. w1     i3.    ;
21875 24698       wa. w1     i5.    ;
21876 24700       lo  w2  x1        ;     text.position := char;
21877 24702       rs  w2  x1        ;
21878 24704                         ;
21879 24704       al  w0    -8      ;
21880 24706       wa. w0     i1.    ;     charshift := charshift - 8;
21881 24708       sl  w0     0      ;
21882 24710       jl.        j3.    ;     if charshift<0 then
21883 24712       al  w0     2      ;     begin
21884 24714       wa. w0     i3.    ;       position := position + 2;
21885 24716       rs. w0     i3.    ;       char shift := 16;
21886 24718       al  w0     16     ;     end;
21887 24720  j3:  rs. w0     i1.    ;
21888 24722       al  w3  x3-1      ;     rem character := rem character - 1;
21889 24724       se  w3     0      ;   end until rem character = 0;
21890 24726       jl.        j2.    ;
21891 24728                         ;
21892 24728       rl. w3     i2.    ;
21893 24730       jl.       (i6.)   ; end;
21894 24732                         ;
21895 24732  e.                     ;
21896 24732  
21896 24732  e.
21897 24732  
21897 24732  e.                     ; end of subhost driver.
21898 24732  
21898 24732  e.                     ; end of host- and subhost drivers.
21899 24732            
21899 24732  c. p101
21900 24732       jl.     f4.       ; stepping stone testoutput
21901 24734  f4=k-2
21902 24734       jl.     f5.       ; stepping stone testoutput
21903 24736  f5=k-2
21904 24736       jl.     f6.       ; stepping stone testoutput
21905 24738  f6=k-2
21906 24738  z.                     ; end test
21907 24738  \f


21907 24738  
21907 24738  m.
21907 24738                  monfpasub - fpa subprocesses drivers 17.0 beta

21908 24738  
21908 24738  b.i30 w.
21909 24738  i0=88 03 02, i1=12 00 00
21910 24738  
21910 24738  ; if newtime (i0,i1) > oldtime (a133,a134) then oldtime:=newtime;
21911 24738  c.i0-a133
21912 24738    c.i0-a133-1, a133=i0, a134=i1, z.
21913 24738    c.i1-a134-1,          a134=i1, z.
21914 24738  z.
21915 24738  
21915 24738  i10=i0, i20=i1
21916 24738  
21916 24738  i15=i10/100000 , i10=i10-i15*100000 , i25=i20/100000 , i20=i20-i25*100000 
21917 24738  i14=i10/10000  , i10=i10-i14*10000  , i24=i20/10000  , i20=i20-i24*10000 
21918 24738  i13=i10/1000   , i10=i10-i13*1000   , i23=i20/1000   , i20=i20-i23*1000
21919 24738  i12=i10/100    , i10=i10-i12*100    , i22=i20/100    , i20=i20-i22*100
21920 24738  i11=i10/10     , i10=i10-i11*10     , i21=i20/10     , i20=i20-i21*10
21921 24738  
21921 24738  i2:  <:                              date  :>
21922 24762       (:i15+48:)<16+(:i14+48:)<8+46
21923 24764       (:i13+48:)<16+(:i12+48:)<8+46
21924 24766       (:i11+48:)<16+(:i10+48:)<8+32
21925 24768  
21925 24768       (:i25+48:)<16+(:i24+48:)<8+46
21926 24770       (:i23+48:)<16+(:i22+48:)<8+46
21927 24772       (:i21+48:)<16+(:i20+48:)<8+ 0
21928 24774  
21928 24774  i3:  al. w0  i2.       ; write date:
21929 24776       rs  w0  x2+0      ;   first free:=start(text);
21930 24778       al  w2  0         ;
21931 24780       jl      x3        ;   return to slang(status ok);
21932 24782  
21932 24782       jl.     i3.       ;
21933 24784  e.
21934 24784  j.
21934 24738                                date  88.03.02 12.00.00

21935 24738  
21935 24738  ;
21936 24738  ; fpa-subproc
21937 24738  ;
21938 24738  \f


21938 24738  
21938 24738  ; fpa-subproc          common procedures
21939 24738  ; eli, 7.8.1975
21940 24738  
21940 24738  ; start of subprocess-code
21941 24738  ;*************************
21942 24738  w.
21943 24738  
21943 24738  ; table of reservations
21944 24738  ;
21945 24738  ; the following table is used to determine, whether the sender of a
21946 24738  ; message has to have reserved the device or just has to be a user
21947 24738  ; of the device. 
21948 24738  ;
21949 24738  ; the table holds one word for each kind of subprocesses. bit(i)=1
21950 24738  ; means, that reservation is needed for operation=i, otherwise just user is needed.
21951 24738  
21951 24738  a0= 1<23
21952 24738  
21952 24738  u0= 0                  ;  first subkind used
21953 24738  
21953 24738  u1=k-u0
21954 24738  
21954 24738  ; subkind 0: general sequential device
21955 24738       0                 ;
21956 24740  
21956 24740  ; subkind 2: not used
21957 24740       0                 ;
21958 24742  
21958 24742  ; subkind 4: area processes
21959 24742  ; note, that areaprocesses are checked at normal entry
21960 24742       0                 ;
21961 24744  
21961 24744  ; subkind 6: disc
21962 24744       a0>5              ; output needs reservation
21963 24746  
21963 24746  ; subkind 8: typewriter
21964 24746       0                 ; reservation never needed
21965 24748  
21965 24748  ; subkind 10: paper tape reader
21966 24748       -1                ; reservation always needed
21967 24750  
21967 24750  ; subkind 12: paper tape punch
21968 24750       -1                ; reservation always needed
21969 24752  
21969 24752  ; subkind 14: line printer
21970 24752       -1                ; reservation always needed
21971 24754  
21971 24754  ; subkind 16: card reader
21972 24754       -1                ; reservation always needed
21973 24756  
21973 24756  ; subkind 18: magnetic tape
21974 24756       -1                ; reservation always needed
21975 24758  
21975 24758  ; subkind 20: plotter
21976 24758       -1                ; reservation always needed
21977 24760  
21977 24760  ; subkind 22: discette
21978 24760       -1                ; reservation always needed
21979 24762  ; subkind 24: character level i/o
21980 24762       -1                ; reservation always needed
21981 24764  \f


21981 24764  ; fpa-subproc          common procedures
21982 24764  ; eli, 16.2.1976
21983 24764  
21983 24764  ;u2:                   ; see after u21.
21984 24764  
21984 24764  ;u3:                   ;  -    -    -
21985 24764  \f


21985 24764  ; fpa-subproc          common procedures
21986 24764  ; eli, 4.11.1975
21987 24764  
21987 24764  ; procedure check and link operation
21988 24764  ;
21989 24764  ; checks, that the sender of the message is a user or reserver of the
21990 24764  ; device as defined by the reservation table of the corresponding
21991 24764  ; subkind.
21992 24764  ;
21993 24764  ; if the subprocess represent a temporary link the calling
21994 24764  ; process is inserted as user.
21995 24764  ; (i.e. the user bits represents the internal processes who is 
21996 24764  ; communicating with the link)
21997 24764  ; for messages with operation code 3 or 5 (input or output) the field
21998 24764  ; <updated first> in the message is initialized according to <first address> in
21999 24764  ; the message and the addresses in the message are checked.
22000 24764  ;
22001 24764  ; if user or reservation is ok, the message is linked to the queue of
22002 24764  ; the subproc.
22003 24764  ;
22004 24764  ; note: contrary to the standard procedure 'link operation' return is
22005 24764  ;       always made, even if other messages exist in the queue.
22006 24764  ;
22007 24764  ;        call          return
22008 24764  ; w0                   undefined
22009 24764  ; w1     subproc       unchanged
22010 24764  ; w2                   undefined
22011 24764  ; w3     link          undefined
22012 24764  
22012 24764  b. i10, j10
22013 24764  w.
22014 24764  
22014 24764  u4:  rs. w3  j0.       ; save return
22015 24766       rs. w1  j1.       ; save sub
22016 24768       am      (b18)     ;
22017 24770       rl  w1  +6        ; check sender :
22018 24772       rl  w0  x1+a10    ; if kind(sender)= pseudo process then
22019 24774       sn  w0  64        ; sender:= main (sender)
22020 24776       rl  w1  x1+a50    ;
22021 24778       rl. w2   j1.      ;
22022 24780       rl  w0  x2+a10    ; if subproc.kind = templink then
22023 24782       se  w0  p113      ; begin
22024 24784       jl.     i2.      ;
22025 24786       jl  w3  d126      ; includeuser(internal, subproc);
22026 24788       rs. w1  j2.      ;   save internal;
22027 24790       rl  w1  (b6)     ;
22028 24792       jl  w3  d123     ;   remove user(procfunc, subproc);
22029 24794       rl. w1  j2.      ;
22030 24796  i2:                   ; end;
22031 24796                         ;
22032 24796       rl  w2  b18       ; check operation
22033 24798       rl. w3  j1.       ;
22034 24800       zl  w3  x3+p10    ; 
22035 24802       rl. w0  x3+u1.    ; w0:= reservation mask(subkind)
22036 24804       zl  w3  x2+8      ; w3:= operation(mess)
22037 24806       ls  w0  x3        ; if reservation mask(bit(operation))= 1 then
22038 24808       sh  w0  -1        ; check reserver
22039 24810       am  g15-g14       ;
22040 24812       jl  w3  g14       ; else check user;
22041 24814  
22041 24814  
22041 24814  ; access rights ok
22042 24814  ;   w1 still holds address of internal process
22043 24814  
22043 24814       bz  w0  x2+8      ;  if operation(mes)= input or output then
22044 24816       se  w0  3         ;
22045 24818       sn  w0  5         ;  begin
22046 24820       jl.     i0.       ;
22047 24822       jl.     i1.       ;
22048 24824  i0:  dl  w0  x2+12     ;   make first and last address in message even
22049 24826       la  w0  g50       ;
22050 24828       la  w3  g50       ;
22051 24830       sl  w3  (x1+a17)  ;   if first(mes)<first(internal) or
22052 24832       sl  w0  (x1+a18)  ;      last(mes)>=top(internal) or
22053 24834       jl      g5        ;
22054 24836       sh  w0  x3-2      ;      first(mes)>last(mes) then
22055 24838       jl      g5        ;   goto result 3
22056 24840       ds  w0  x2+12     ;
22057 24842       rs  w3  x2+22     ;   updated first(mes):= first(mes)
22058 24844                         ;  end
22059 24844  
22059 24844  ; link message to message queue of subproc
22060 24844  
22060 24844  i1:  am      (b19)     ;  w1:= addr. of message queue of subproc
22061 24846       al  w1  +a54      ;
22062 24848       jl  w3  d6        ;  link(w1=head,w2=elem)
22063 24850  
22063 24850  c.p101 b.f1 w.         ;*****test48*****
22064 24850       rs. w3  f0.       ;*
22065 24852       jl. w3  f4.       ;*
22066 24854       48                ;*
22067 24856  f0:  0                 ;*
22068 24858       jl.     f1.       ;*
22069 24860       al  w0  x2        ;*
22070 24862       al  w1  x2+22     ;*
22071 24864       jl. w3  f5.       ;*
22072 24866  f1:                    ;*
22073 24866  e.z.                   ;*****test48*****
22074 24866  
22074 24866  ; return
22075 24866  
22075 24866       rl  w1  b19       ;  restore subproc address
22076 24868       jl.     (j0.)     ;
22077 24870  
22077 24870  j0:  0                 ; saved return
22078 24872  j1: 0
22079 24874  j2:  0
22080 24876  
22080 24876  e.                     ; end of check and link operation
22081 24876  \f


22081 24876  ; fpa-subproc          common procedures
22082 24876  ; eli, 11.2.1976
22083 24876  
22083 24876  ; procedure get and deliver result
22084 24876  ;
22085 24876  ; returns an answer with a result as defined in the result-field of mainproc
22086 24876  ; in the following way:
22087 24876  ;
22088 24876  ;     result4000:= result(mainproc)+1
22089 24876  ;     deliver result(result4000)
22090 24876  ;
22091 24876  ;        call          return
22092 24876  ; w0                   undefined
22093 24876  ; w1     subproc       unchanged
22094 24876  ; w2                   undefined
22095 24876  ; w3     link          undefined
22096 24876  
22096 24876  b. i10, j10
22097 24876  w.
22098 24876  
22098 24876  u5:                    ; get and deliver result:
22099 24876       am      (x1+a50)  ;  if function(mainproc(subproc))=
22100 24878       bz  w0  +p81      ;     answer message with data then
22101 24880       se  w0  v55+(:1<0:); begin
22102 24882       jl.     i0.       ;   copy answer content to words g20, g21, ...
22103 24884       rl  w2  b18       ;   w2:= message
22104 24886       rl  w0  x2+8      ;   copy status
22105 24888       rs  w0  g20       ;
22106 24890       dl  w1  x2+12     ;   copy rest of answer
22107 24892       ds  w1  g22       ;
22108 24894       dl  w1  x2+16     ;
22109 24896       ds  w1  g24       ;
22110 24898       rl  w1  b19       ;  end
22111 24900  i0:  al  w0  1         ;  result4000:= result(mainproc(subproc))+1
22112 24902       am      (x1+a50)  ;
22113 24904       ba  w0  +p82      ;
22114 24906  c.p101 b.f1 w.         ;*****test49*****
22115 24906       rs. w3  f0.       ;
22116 24908       jl. w3  f4.       ;
22117 24910       49                ;
22118 24912  f0:  0                 ;
22119 24914       jl.     f1.       ;
22120 24916       rl  w1  g20       ;
22121 24918       ds  w1  x3+2      ;
22122 24920       dl  w1  g22       ;
22123 24922       ds  w1  x3+6      ;
22124 24924       dl  w1  g24       ;
22125 24926       ds  w1  x3+10     ;
22126 24928       al  w0  x3        ;
22127 24930       al  w1  x3+10     ;
22128 24932       jl. w3  f5.       ;
22129 24934  f1:                    ;
22130 24934  e.z.                   ;*****test49*****
22131 24934       jl      g19       ;  goto deliver result(result4000)
22132 24936                         ;  note: link unchanged.
22133 24936  
22133 24936  e.                     ; end of get and deliver result
22134 24936  \f


22134 24936  ; fpa-subproc          common procedures
22135 24936  ; eli, 7.8.1975
22136 24936  
22136 24936  ; procedure prepare answer
22137 24936  ;
22138 24936  ; prepares the variables
22139 24936  ;   g20  <status>
22140 24936  ;   g21  <bytes>
22141 24936  ;   g22  <chars>
22142 24936  ; for sending of an answer
22143 24936  ;
22144 24936  ; <status> is taken from the status-field of the mainproc
22145 24936  ; <bytes> and <chars> are calculated by the fields <first address> and
22146 24936  ; <updated first> in the message buffer and by the field <size> in
22147 24936  ; mainproc.
22148 24936  ;
22149 24936  ; the separate entry, prepare after stop, initially clears the <size> and <status> fields
22150 24936  ; of mainproc. it may be used, when the sender is stopped thus returning
22151 24936  ; an answer corresponding to the message only.
22152 24936  ;
22153 24936  ;        call          return
22154 24936  ; w0                   undefined
22155 24936  ; w1     subproc       unchanged
22156 24936  ; w2     message       undefined
22157 24936  ; w3     link          undefined
22158 24936  
22158 24936  b. i10, j10
22159 24936  w.
22160 24936  
22160 24936  u6:  rl  w1  x1+a50    ; prepare after stop:
22161 24938       al  w0  0         ;  result(mainproc):= status(mainproc):=
22162 24940       rs  w0  x1+p83    ;  size(mainproc):= 0
22163 24942       rs  w0  x1+p84    ;
22164 24944       rl  w1  b19       ;  restore current subproc
22165 24946  u7:  rs. w3  j0.       ; prepare answer:
22166 24948       rl  w3  x1+a50    ;  main:= mainproc(subproc)
22167 24950       rl  w0  x3+p83    ;
22168 24952       ls  w0  12        ;
22169 24954       rs  w0  g20       ;
22170 24956       rl  w0  x2+22     ;  chars:= 
22171 24958       ws  w0  x2+10     ;   (updated first(mess)-first(mess))/2*3
22172 24960       rl  w2  0         ;
22173 24962       ls  w2  -1        ;
22174 24964       wa  w2  0         ;
22175 24966       wa  w2  x3+p84    ;  chars:= chars+size(main)
22176 24968       rs  w2  g22       ;  save chars
22177 24970       al  w1  0         ;
22178 24972       wd. w2  j1.       ;  bytes:= 
22179 24974       se  w1  0         ;   if chars mod 3=0 then chars/3*2 else
22180 24976       al  w2  x2+1      ;                         chars/3*2 +2
22181 24978       ls  w2  1         ;
22182 24980       rs  w2  g21       ;  save bytes
22183 24982  
22183 24982  ; restore w1 to subproc and return
22184 24982  
22184 24982       rl  w1  b19       ;  w1:= current subproc
22185 24984       jl.     (j0.)     ;
22186 24986  
22186 24986  j0:  0                 ;  saved return
22187 24988  j1:  3                 ;  division constant
22188 24990  
22188 24990  e.                     ; end of prepare answer
22189 24990  \f


22189 24990  
22189 24990  ; fpa-subproc          common procedures
22190 24990  ; eli, 8.8.1975
22191 24990  
22191 24990  ; procedure current message address
22192 24990  ;
22193 24990  ; returns the content of the message address entry corresponding
22194 24990  ; to current bufno.
22195 24990  ;
22196 24990  ;        call          return
22197 24990  ; w0     
22198 24990  ; w1     subproc       unchanged
22199 24990  ; w2                   even entry content 
22200 24990  ; w3     link          unchanged
22201 24990  
22201 24990  b. i10, j10
22202 24990  w.
22203 24990  
22203 24990  u8:  bl  w2  x1+p17    ; current message entry:
22204 24992       am      x2        ;
22205 24994       am      x2        ;  w2:= even mes.adr(current fubno*2)
22206 24996       rl  w2  x1+p19    ;
22207 24998       la  w2  g50       ;
22208 25000       jl      x3        ; return
22209 25002  
22209 25002  e.                     ; end of current message address
22210 25002  \f


22210 25002  ; fpa-subproc          common procedures
22211 25002  ; eli, 8.8.1975
22212 25002  
22212 25002  ; procedure current message entry
22213 25002  ;
22214 25002  ; returns the absolute address of the message address entry
22215 25002  ; corresponding to current bufno.
22216 25002  ;
22217 25002  ;        call          return
22218 25002  ; w0
22219 25002  ; w1     subproc       unchanged
22220 25002  ; w2                   absolute address of entry
22221 25002  ; w3     link          unchanged
22222 25002  
22222 25002  b.i10, j10
22223 25002  w.
22224 25002  
22224 25002  u9:  bl  w2  x1+p17    ; current message entry:
22225 25004       am      x2        ;
22226 25006       am      x2        ;  w2:= entry address(current bufno*2)
22227 25008       al  w2  x1+p19    ;
22228 25010       jl      x3        ;  return
22229 25012  
22229 25012  e.                     ; end of current message entry
22230 25012  \f


22230 25012  ; fpa-subproc          common procedures
22231 25012  ; eli, 8.8.1975
22232 25012  
22232 25012  ; procedure increase message entry
22233 25012  ;
22234 25012  ; increases the field current bufno to point to the next entry,
22235 25012  ; modulo the system constant max number of buffers.
22236 25012  ;
22237 25012  ;        call          return
22238 25012  ; w0                   new bufferno
22239 25012  ; w1     subproc       unchanged
22240 25012  ; w2                   unchanged
22241 25012  ; w3     link          unchanged
22242 25012  
22242 25012  b. i10, j10
22243 25012  w.
22244 25012  
22244 25012  u10:                    ; increase message entry:
22245 25012       bl  w0  x1+p17    ;  current bufno(subproc):=
22246 25014       ba. w0  1         ;   current bufno(subproc) + 1
22247 25016       sl  w0  v0        ;   modulo max bufferno
22248 25018       al  w0  0         ;
22249 25020       hs  w0  x1+p17    ;
22250 25022       jl      x3        ;  return
22251 25024  
22251 25024  e.
22252 25024  \f


22252 25024  ; fpa-subproc          common procedures
22253 25024  ; eli, 8.8.1975
22254 25024  
22254 25024  ; procedure clear message entry
22255 25024  ;
22256 25024  ; the entry in the message address table corresponding to bufno in
22257 25024  ; the receiver-field of mainproc is cleared. the field free bufs in
22258 25024  ; the subproc is increased by one.
22259 25024  ;
22260 25024  ;         call          return
22261 25024  ; w0                    undefined
22262 25024  ; w1      subproc       unchanged
22263 25024  ; w2 
22264 25024  ; w3      link          undefined
22265 25024  
22265 25024  b. i10, j10
22266 25024  w.
22267 25024  u41:  am      p68-p88   ;  clear entry(bufno(trm)):
22268 25026  u11 : al  w0  p88       ;  clear entry(bufno(rec)):
22269 25028        rs. w3  j0.       ;  save return ;
22270 25030        wa  w0  x1+a50    ;
22271 25032        zl  w3 (0)        ;  get cur buffer;
22272 25034        al  w0  0         ;
22273 25036        am      x3        ;
22274 25038        am      x3        ;  message addr.(bufno(mainproc)*2):= 0
22275 25040        rs  w0  x1+p19    ;
22276 25042        al  w3  1         ;  free bufs(subproc):=
22277 25044        ba  w3  x1+p16    ;   free bufs(subproc)+1
22278 25046        hs  w3  x1+p16    ;
22279 25048                          ;
22280 25048        jl.     (j0.)     ;  return
22281 25050  
22281 25050  j0:   0                 ; saved link
22282 25052  
22282 25052  e.                      ; end of clear message entry
22283 25052  \f


22283 25052  ; fpa-subproc          common procedures
22284 25052  ; eli, 20.1.1976
22285 25052  
22285 25052  ; procedure find first message
22286 25052  ;
22287 25052  ; if <current message> is nonzero, this value is returned.
22288 25052  ; otherwise the procedure continues through
22289 25052  ; <find first unprocessed message>
22290 25052  ;
22291 25052  ;         call          return
22292 25052  ; w0                    undefined
22293 25052  ; w1      subproc       unchanged
22294 25052  ; w2                    message or 0
22295 25052  ; w3      link          unchanged
22296 25052  
22296 25052  b. i10, j10
22297 25052  w.
22298 25052  
22298 25052  u12:                   ; find first message:
22299 25052       rl  w2  x1+p13    ;  if current message(subproc)<>0 then
22300 25054       se  w2  0         ;  goto check regret
22301 25056       jl.     i3.       ;
22302 25058  
22302 25058  ; continue through u22
22303 25058  \f


22303 25058  
22303 25058  ; fpa-subproc          common procedures
22304 25058  ; eli, 12.8.1976
22305 25058  
22305 25058  ; procedure find first unprocessed message
22306 25058  ;
22307 25058  ; scans the messagequeue of the calling subproc and returns
22308 25058  ; the address of the first unprocessed messagebuffer.
22309 25058  ; 0 is returned, if no buffer is found.
22310 25058  ;
22311 25058  ; if a message selected has been regretted (or the sender removed)
22312 25058  ; the message is returned and the queue scanned again.
22313 25058  ;
22314 25058  ; note: a processed messagebuffer has receiver(mes)<0.
22315 25058  ;       the procedure does not change the receiver-field
22316 25058  ;       of the message.
22317 25058  ;       the monitor-word <current message> is set to the buffer found.
22318 25058  ;
22319 25058  ;        call          return
22320 25058  ; w0                   undefined
22321 25058  ; w1     subproc       unchanged
22322 25058  ; w2                   message or 0
22323 25058  ; w3     link          undefined
22324 25058  
22324 25058  
22324 25058  u22: rs. w3  j0.       ;  save link
22325 25060  
22325 25060  ; scan message queue
22326 25060  
22326 25060  i0:  rl  w2  x1+a54    ; scan:
22327 25062       jl.     i2.       ;  mes:= first message(subproc)
22328 25064  i1:  rl  w0  x2+4      ;  while receiver(mes)<0
22329 25066       sl  w0  0         ;    and mes<>last message(subproc) do
22330 25068       jl.     i4.       ;
22331 25070       rl  w2  x2+0      ;  mes:= next(mes)
22332 25072  i2:  se  w2  x1+a54    ;
22333 25074       jl.     i1.       ;
22334 25076  
22334 25076  ; no message pending in queue
22335 25076  
22335 25076       al  w2  0         ;
22336 25078       jl.     (j0.)     ;  return
22337 25080  
22337 25080  ; w2 points to message. check regretted
22338 25080  
22338 25080  i3:  rs. w3  j0.       ; check regret:  save link
22339 25082  i4:  rs  w2  b18       ;  current message(monitor):= mes
22340 25084       rl  w0  x2+6      ;
22341 25086       sl  w0  0         ;  if sender(mes)>0 then
22342 25088       jl.     (j0.)     ;  return
22343 25090       al  w0  0         ;
22344 25092       sn  w2 (x1+p13)   ;
22345 25094       rs  w0  x1+p13    ;
22346 25096       al. w3  i0.       ;  no operation(mes)
22347 25098       jl      g26       ;  goto scan
22348 25100  
22348 25100  j0:  0                 ;
22349 25102  
22349 25102  e.                     ; end of find first message
22350 25102  \f


22350 25102  ; fpa-subproc          common procedures
22351 25102  ; eli, 8.8.1975
22352 25102  
22352 25102  ; procedure save and reserve message
22353 25102  ;
22354 25102  ; stores a message buffer address in the message entry described by
22355 25102  ; current entry and in the current message field of the subproc.
22356 25102  ; the message is reserved by setting the receiver-field negative,
22357 25102  ; if it is not already so.
22358 25102  ;
22359 25102  ;         call          return
22360 25102  ; w0     
22361 25102  ; w1      subproc       unchanged
22362 25102  ; w2      message       unchanged
22363 25102  ; w3      link          undefined
22364 25102  
22364 25102  b. i10, j10
22365 25102  w.
22366 25102  
22366 25102  u13: ds. w3  j1.       ; save and reserve message: save message and link
22367 25104       jl. w3  u9.       ;  w2:= current entry address
22368 25106       rx. w2  j0.       ;  save entry:= w2
22369 25108       rs. w2  (j0.)     ;  mess addr(entry):= message
22370 25110       rs  w2  x1+p13    ;  current message(subproc):= message
22371 25112       al  w3  -1        ;  free buffers(subproc):=
22372 25114       ba  w3  x1+p16    ;    free buffers(subproc)-1
22373 25116       hs  w3  x1+p16    ;
22374 25118       ac  w3  (x2+4)    ;  if receiver(mes)>0 then
22375 25120       sl  w3  0         ;  begin
22376 25122       jl.     (j1.)     ;
22377 25124       rs  w3  x2+4      ;   receiver(mes):= -receiver(mes)
22378 25126       am      (b21)     ;   decrease(buffer claim(driver proc))
22379 25128       bz  w3  +a19      ;
22380 25130       al  w3  x3-1      ;
22381 25132       am      (b21)     ;
22382 25134       hs  w3  +a19      ;  end
22383 25136                         ;
22384 25136       jl.     (j1.)     ;  return
22385 25138  
22385 25138  j0:  0                 ;  saved message
22386 25140  j1:  0                 ;  saved link
22387 25142  
22387 25142  e.                     ; end of save and reserve message
22388 25142  \f


22388 25142  ; fpa-subproc          common procedures
22389 25142  ; eli, 8.8.1975
22390 25142  
22390 25142  ; procedure convert to 8-bit
22391 25142  ;
22392 25142  ; converts the number in w0, representing a number of 12-bit characters,
22393 25142  ; to the corresponding number of 8-bit characters
22394 25142  ;
22395 25142  ;         call          return
22396 25142  ; w0      number in 12-bits
22397 25142  ;                       number in 8-bits
22398 25142  ; w1   
22399 25142  ; w2
22400 25142  ; w3      link          undefined
22401 25142  
22401 25142  b. i10, j10
22402 25142  w.
22403 25142  
22403 25142  u14: rs. w3  j0.       ; convert to 8-bit: save link
22404 25144       rl  w3  0         ;  size8:=
22405 25146       ls  w3  -1        ;    size12*3/2
22406 25148       wa  w0  6         ;
22407 25150       jl.     (j0.)     ;  return
22408 25152  
22408 25152  j0:  0                 ; saved link
22409 25154  
22409 25154  e.                     ; end of convert to 8-bit
22410 25154  \f


22410 25154  ; fpa-subproc          common procedures
22411 25154  ; eli, 15.1.1976
22412 25154  
22412 25154  ; procedure convert to 12-bit
22413 25154  ;
22414 25154  ; converts the number in w0, representing a number of 8-bit characters,
22415 25154  ; to the corresponding number of 12-bit characters.
22416 25154  ;
22417 25154  ;          call          return
22418 25154  ; w0       number in 8-bit
22419 25154  ;                        number in 12-bit
22420 25154  ; w1    
22421 25154  ; w2
22422 25154  ; w3     link          undefined
22423 25154  
22423 25154  b. i10, j10
22424 25154  w.
22425 25154  
22425 25154  u15: rs. w3  j0.       ; convert to 12-bit: save link
22426 25156       al  w3  0         ;  prepare division
22427 25158       wd. w0  j1.       ;  size12:= size8/3*2
22428 25160       se  w3  0         ;  if size8 mod 3<>0 then
22429 25162       ba. w0  1         ;  size12:= size12+2
22430 25164       ls  w0  1         ;
22431 25166       jl.     (j0.)     ;  return
22432 25168  
22432 25168  j0:  0                 ;  saved link
22433 25170  j1:  3                 ;  8-bit characters per word
22434 25172  
22434 25172  e.                     ; end of convert to 12-bit
22435 25172  \f


22435 25172  
22435 25172  ; fpa-subproc          common procedures
22436 25172  ; eli, 19.8.1975
22437 25172  
22437 25172  ; procedure prepare addresses
22438 25172  ;
22439 25172  ; initializes the fields <first addr>, <data size> and <size>
22440 25172  ; in the mainproc sender table corresponding to the next part
22441 25172  ; of a message to be transmitted.
22442 25172  ; if a block of size 0 is encountered, the data-bit in the func-
22443 25172  ; tion-field is cleared.
22444 25172  ;
22445 25172  ;        call          return
22446 25172  ; w0                   undefined
22447 25172  ; w1     subproc       unchanged
22448 25172  ; w2     message       unchanged
22449 25172  ; w3     link          undefined
22450 25172  
22450 25172  b. i10, j10
22451 25172  w.
22452 25172  
22452 25172  u16: rs. w3  j0.       ; prepare addresses: save link
22453 25174       al  w3  2         ;  saved size:=
22454 25176       wa  w3  x2+12     ;   last addr(mes)-updated first(mes)
22455 25178       ws  w3  x2+22     ;   +2
22456 25180       rl  w0  6         ;  size:= saved size
22457 25182  
22457 25182  ; test for maximum size exceeded
22458 25182  
22458 25182       sl  w0  (x1+p18)  ;  if size>maxsize(subproc) then
22459 25184       rl  w0  x1+p18    ;     size:= maxsize(subproc)
22460 25186       sl. w0  (j1.)     ;  if size>maxsize(datanet) then
22461 25188       rl. w0  j1.       ;     size:= maxsize(datanet)
22462 25190       se  w0  (6)       ;  if size= saved size then
22463 25192       jl.     i0.       ;     comment: last block of message
22464 25194       al  w3  0         ;     current message(subproc):= 0
22465 25196       rs  w3  x1+p13    ;
22466 25198  
22466 25198  ; set first, last and size in mainproc
22467 25198  
22467 25198  i0:  rl  w1  x1+a50    ;  main:= mainproc(subproc)
22468 25200       rl  w3  x2+22     ;  first:= first(main):= updated first(mes)
22469 25202       rs  w3  x1+p65    ;
22470 25204       se  w0  0         ;  if size=0 then
22471 25206       jl.     i1.       ;
22472 25208       bl  w3  x1+p61    ;    databit(function(main)):= 0
22473 25210       la  w3  g50       ;
22474 25212       hs  w3  x1+p61    ;
22475 25214  i1:  jl. w3  u14.      ;  header size(main):= data size(main):=
22476 25216       rs  w0  x1+p64    ;    convert to 8-bit(size)
22477 25218       rs  w0  x1+p66    ;
22478 25220       rs  w0  x2+20     ;  expected size(mes):= size(main)
22479 25222  
22479 25222  ; return
22480 25222  
22480 25222       rl  w1  b19       ;  restore subproc addr
22481 25224       jl.     (j0.)     ; 
22482 25226  
22482 25226  j0:  0                 ; saved link
22483 25228  j1:  v2                ; datanet max buffer size
22484 25230  
22484 25230  e.                     ; end of prepare addresses
22485 25230  \f


22485 25230  
22485 25230  ; fpa-subproc          common procedures
22486 25230  ; eli, 17.9.1975
22487 25230  
22487 25230  ; procedure test and decrease stop count
22488 25230  ;
22489 25230  ; upon entry w2 holds a number of an entry in the message table.
22490 25230  ; if the entry points to a message and the stop count of
22491 25230  ; the sender of the corresponding message has been increased (i.e.
22492 25230  ; message entry is odd) then the stop count of the sender is decreased
22493 25230  ; and the flag in the message table cleared.
22494 25230  ;
22495 25230  ;        call          return
22496 25230  ; w0                   undefined
22497 25230  ; w1     subproc       unchanged
22498 25230  ; w2     messageno     undefined
22499 25230  ; w3     link          undefined
22500 25230  
22500 25230  b. i10, j10
22501 25230  w.
22502 25230  v104:
22503 25230  u18:                   ; test and decrease stop count:
22504 25230       am      x2        ;  mes:= message table(messageno*2)
22505 25232       am      x2        ;
22506 25234       al  w2  x1+p19    ;
22507 25236       rl  w0  x2        ;
22508 25238       sl  w0  (b8+4)    ;  if not possible messageaddress or
22509 25240       so  w0  2.1       ;     not stop count increased(mes) then 
22510 25242       jl      x3        ;  return
22511 25244       rs. w3  j0.       ;  save return
22512 25246       la  w0  g50       ;  stop count increased(mes):= false
22513 25248       rs  w0  x2        ;
22514 25250       rx  w0  b18       ;  current message(monitor):= mes
22515 25252       rs. w0  j1.       ;  save old current message(monitor)
22516 25254       jl  w3  g32       ;  decrease stop count
22517 25256       rl  w1  b19       ;  restore subproc
22518 25258       rl. w2  j1.       ;  restore current message(monitor)
22519 25260       rs  w2  b18       ;
22520 25262  
22520 25262       jl.     (j0.)     ;  return
22521 25264  
22521 25264  j0:  0                 ;  saved link
22522 25266  j1:  0                 ;  saved current message(monitor)
22523 25268  
22523 25268  e.                     ; end of test and decrease stop count
22524 25268  \f


22524 25268  ; fpa-subproc          common procedures
22525 25268  ; eli, 17.9.1975
22526 25268  
22526 25268  ; procedure clear subproc message queue
22527 25268  ;
22528 25268  ; called from hostproc, when a transmission line error is detected or a
22529 25268  ; master clear received.
22530 25268  ;
22531 25268  ; all messages in the queue of the subproc (processed as well as unprocessed)
22532 25268  ; are returned with result=4 (receiver malfunction)
22533 25268  ;
22534 25268  ;        call          return
22535 25268  ; w0                   undefined
22536 25268  ; w1     subproc       unchanged
22537 25268  ; w2                   undefined
22538 25268  ; w3     link          undefined
22539 25268  
22539 25268  b. i10, j10
22540 25268  w.
22541 25268  u19:                   ; clear subproc message queue:
22542 25268  v100= u19              ;
22543 25268       rs. w3  j0.       ;  save link
22544 25270       rl  w2  b18       ;
22545 25272       rs. w2  j2.       ;   save curr mess;
22546 25274       al  w2  0         ;  for w2:= all entries in message table do
22547 25276  c.p101 b.f1 w.         ;******test50*****
22548 25276       rs. w3  f0.       ;
22549 25278       jl. w3  f4.       ;
22550 25280       50                ;
22551 25282  f0:  0                 ;
22552 25284       jl.     f1.       ;
22553 25286       al  w0  x1        ;   testrecord:=
22554 25288       al  w1  x1+p19+16 ;     process description;
22555 25290       jl. w3  f5.       ;
22556 25292  f1:                    ;
22557 25292  e.z.                   ;*****test50*****
22558 25292  i2:  rs. w2  j1.       ;  
22559 25294       jl. w3  u18.      ;   test and decrease stopcount(w2)
22560 25296       rl. w2  j1.       ;
22561 25298       al  w0  0         ;
22562 25300       am      x2        ;  if message table(w2)<>0 then
22563 25302       am      x2        ;  begin
22564 25304       rx  w0  x1+p19    ;
22565 25306       sn  w0  0         ;
22566 25308       jl.     i3.       ;
22567 25310       al  w3  1         ;   free bufs(subproc):= free bufs(subproc)+1
22568 25312       ba  w3  x1+p16    ;
22569 25314       hs  w3  x1+p16    ;
22570 25316  i3:  al  w2  x2+1      ;
22571 25318       rl  w0  x1+a10    ;   if kind(sub)=hostproc kind then
22572 25320       sn  w0  p111      ;     max entries:=v3
22573 25322       am      v3-v0     ;   max entries:=v0;
22574 25324       se  w2  v0        ;
22575 25326       jl.     i2.       ;  end
22576 25328       jl.     i1.       ;
22577 25330  
22577 25330  ; scan message queue and return answers
22578 25330  
22578 25330  i0:  rs  w2  b18       ;  for mes:= first message(subproc)
22579 25332       al  w0  4         ;      while mes<>last message(subproc) do
22580 25334       jl  w3  g19       ;
22581 25336       rl  w1  b19       ;   deliver result(4)
22582 25338  i1:  rl  w2  x1+a54    ;
22583 25340       se  w2  x1+a54    ;
22584 25342       jl.     i0.       ;
22585 25344       zl  w0  x1+p10    ;  if subproc.subkind = terminal then
22586 25346       se  w0     8      ;  begin
22587 25348       jl.        i4.    ;     if attention message pending then
22588 25350       rl  w2  x1+a71    ;     regret message
22589 25352       se  w2     0      ;  end;
22590 25354       jl  w3     d75    ;
22591 25356  i4:  al  w0  0         ;  internal state(subproc):= 0
22592 25358       rs  w0  x1+p12    ;
22593 25360       rs  w0  x1+p13    ;  current message(subproc):= 0
22594 25362       hs  w0  x1+p17    ;  current bufno(subproc):= 0
22595 25364       rl. w2  j2.       ;
22596 25366       rs  w2  b18       ;   restore curr mess;
22597 25368  
22597 25368       jl.     (j0.)     ;  return
22598 25370  
22598 25370  j0:  0                 ;  saved link
22599 25372  j1:  0                 ;  saved messageno
22600 25374  j2:  0                 ;   saved curr mess
22601 25376  
22601 25376  e.                     ; end of clear subproc message queue
22602 25376  \f


22602 25376  ; fpa-subproc          common procedures
22603 25376  ; eli, 15.1.1976
22604 25376  
22604 25376  ; procedure test answer attention
22605 25376  ;
22606 25376  ; called when the subproc is ready for sending a header.
22607 25376  ;
22608 25376  ; if the <answer attention> flag is set in the statefield of the subproc,
22609 25376  ; mainproc will be initiated to transmit the answer. <bufno> from the
22610 25376  ; attention message received has previously been saved in the rightmost 8
22611 25376  ; bits of <state>.
22612 25376  ; if an attention answer is pending the procedure will return to mainproc.
22613 25376  ;
22614 25376  ;        call          return
22615 25376  ;  w0                  undefined
22616 25376  ;  w1    subproc       unchanged
22617 25376  ;  w2                  unchanged
22618 25376  ;  w3    link          undefined
22619 25376  
22619 25376  b. i10, j10
22620 25376  w.
22621 25376  
22621 25376  u20:                   ; test answer attention:
22622 25376       rl  w0  x1+p12    ;  if answer attention(state(subproc))=0 then
22623 25378       so  w0  v71       ;  return
22624 25380       jl      x3        ;
22625 25382                         ;
22626 25382       rl  w3  x1+a50    ;  main:= mainproc(subproc)
22627 25384  c. p103-1
22628 25384       al  w0  8         ; addresscode(main):= ' no check '
22629 25386       hs  w0  x3+p72    ;
22630 25388  z.
22631 25388       jl. w3  u25.      ;  set linkparams
22632 25390       al  w0  v59       ;  function(main):= answer attention
22633 25392       hs  w0  x3+p61    ;
22634 25394       rl  w0  x1+p12    ;  bufno(main):= rightmost 8 bits
22635 25396       la  w0  g53       ;   (state(subproc))
22636 25398       hs  w0  x3+p68    ;
22637 25400                         ;
22638 25400       jl      (b101)    ;  goto mainproc return
22639 25402  
22639 25402  e.                     ; end of test answer attention
22640 25402  \f


22640 25402  ; fpa-subproc          common procedures
22641 25402  ; eli, 11.2.1976
22642 25402  
22642 25402  ; procedure test and increase stop count
22643 25402  ;
22644 25402  ; increases the stop count of the sender of a message, if it has
22645 25402  ; not already been increased. the message must be present in the
22646 25402  ; message table and the address in the table must bee odd if stop
22647 25402  ; count has been increased.
22648 25402  ;
22649 25402  ;        call          return
22650 25402  ;  w0                  undefined
22651 25402  ;  w1    subproc       unchanged
22652 25402  ;  w2    message       see below
22653 25402  ;  w3    link          undefined
22654 25402  ;
22655 25402  ; if stop count could not bee increased, because the sender has been
22656 25402  ; stopped then return will be made to <link> and the message has
22657 25402  ; been returned (w2 is undefined).
22658 25402  ;
22659 25402  ; otherwise return to <link+2> (w2 is unchanged).
22660 25402  
22660 25402  b. i10, j10
22661 25402  w.
22662 25402  
22662 25402  u21:                   ; test and increase stop count:
22663 25402       rs. w3  j0.       ;  save link
22664 25404       al  w3  x1+p19    ;  search message table for message
22665 25406       jl.     i1.       ;
22666 25408  
22666 25408  
22666 25408  i0:  al  w3  x3+2      ;
22667 25410  i1:  rl  w0  x3        ;  w0:= even message(message table) 
22668 25412       la  w0  g50       ;
22669 25414       se  w0  x2        ;
22670 25416       jl.     i0.       ;
22671 25418  
22671 25418  ; w3 points to entry. w0 holds even message address
22672 25418  
22672 25418       lo  w0  g63       ;  set odd value in message table
22673 25420       rx  w0  x3        ;
22674 25422       sz  w0  2.1       ;  if stop count already increased then
22675 25424       jl.     i2.       ;  goto ok-return
22676 25426  
22676 25426  ; examine state of sender before increase
22677 25426  
22677 25426       rs. w3  j1.       ;  save entry
22678 25428       jl  w3  g34       ;  exam sender
22679 25430       jl.     i3.       ; stopped: goto stop-return
22680 25432       jl  w3  g31       ; ok: increase stop count
22681 25434  
22681 25434  ; return to <link+2>
22682 25434  
22682 25434  i2:  rl. w3  j0.       ; ok-return:
22683 25436       jl      x3+2      ;
22684 25438  
22684 25438  ; stop count could not be increased. deliver answer
22685 25438  
22685 25438  i3:  al  w0  0         ;  message entry:= 0
22686 25440        rs  w0  x1+p12    ;  state(subproc):= ready;
22687 25442       rs. w0  (j1.)     ;  if mes=current message(subproc) then
22688 25444       sn  w2  (x1+p13)  ;  current message(subproc):= 0
22689 25446       rs  w0  x1+p13    ;
22690 25448       al  w3  1         ;
22691 25450       ba  w3  x1+p16    ;
22692 25452       hs  w3  x1+p16    ;  free buffers:= free buffers+1
22693 25454  c.p101 b.f1 w.         ;*****test51*****
22694 25454       rs. w3  f0.       ;*
22695 25456       jl. w3  f4.       ;*
22696 25458       51                ;*
22697 25460  f0:  0                 ;*
22698 25462       jl.     f1.       ;*
22699 25464       al  w0  x1+p11    ;*
22700 25466       al  w1  x1+p19+14 ;*
22701 25468       jl. w3  f5.       ;*
22702 25470  f1:                    ;*
22703 25470  e.z.                   ;*****test51*****
22704 25470       jl. w3  u6.       ;  prepare answer after stop
22705 25472       jl  w3  g18       ;  deliver  result(1)
22706 25474       jl.     (j0.)     ;  goto <link>
22707 25476  
22707 25476  j0:  0                 ;  saved link
22708 25478  j1:  0                 ;  saved entry
22709 25480  
22709 25480  e.                     ; end of test and increase stop count
22710 25480  \f


22710 25480  ; fpa-subproc          common procedures
22711 25480  ; eli, 8.6.1977
22712 25480  
22712 25480  ; procedure set linkparams
22713 25480  ;
22714 25480  ; copies the fields devhost linkno, jobhost linkno,
22715 25480  ; devhost host-id, devhost net-id and devhost
22716 25480  ; home-reg to the mainproc parameters.
22717 25480  ;
22718 25480  ; also copies the bufferno of the link and sets the
22719 25480  ; monitor address code to 'no check'.
22720 25480  ;
22721 25480  ;        call          return
22722 25480  ;  w0                  undefined
22723 25480  ;  w1    subproc       unchanged
22724 25480  ;  w2                  unchanged
22725 25480  ;  w3    link          mainproc
22726 25480  
22726 25480  b. i10, j10
22727 25480  w.
22728 25480  
22728 25480  u25:                   ; set linkparams:
22729 25480       rs. w3  j0.       ;  save link
22730 25482       rl  w3  x1+a50    ;  main:= mainproc(subproc)
22731 25484       bz  w0  x1+p11    ;  receiver linkno(main):=
22732 25486       hs  w0  x3+p69    ;   devhost linkno(subproc)
22733 25488       bz  w0  x1+p9     ;  sender linkno(main):=
22734 25490       hs  w0  x3+p78    ;   jobhost linkno(subproc)
22735 25492       bz  w0  x1+p7     ;  receiver net-id(main):=
22736 25494       hs  w0  x3+p301   ;   devhost net-id(subproc)
22737 25496       bz  w0  x1+p6     ;  receiver home-reg(main):=
22738 25498       hs  w0  x3+p302   ;   devhost home-reg(subproc)
22739 25500       rl  w0  x1+p5     ;  receiver host-id(main):=
22740 25502       rs  w0  x3+p303   ;   devhost host-id(subproc)
22741 25504       bz  w0  x1+p17    ;  bufno(main):= bufno(subproc)
22742 25506       hs  w0  x3+p68    ;
22743 25508                         ;
22744 25508       jl.     (j0.)     ;  goto return
22745 25510  
22745 25510  j0:  0                 ; saved link
22746 25512  
22746 25512  e.                     ; end of set linkparams
22747 25512  \f


22747 25512  ; fpa-subproc          common procedures
22748 25512  ; eli, 8.6.1977
22749 25512  
22749 25512  ; procedure testlink
22750 25512  ;
22751 25512  ; tests, that the mainproc parameters sender linkno, sender host-id
22752 25512  ; and sender net-id are equal to the parameters devhost linkno,
22753 25512  ; devhost host-id and devhost net-id in the subproc.
22754 25512  ;
22755 25512  ; if not equal, return will be made to link+0, otherwise
22756 25512  ; to link+2.
22757 25512  ;
22758 25512  ;        call          return
22759 25512  ;  w0                  undefined
22760 25512  ;  w1    subproc       unchanged
22761 25512  ;  w2                  mainproc
22762 25512  ;  w3    link          unchanged
22763 25512  
22763 25512  b. i10, j10
22764 25512  w.
22765 25512  
22765 25512  u23:                   ; testlink:
22766 25512       rl  w2  x1+a50    ;  main:= mainproc(subproc)
22767 25514       bl  w0  x2+p98    ;  if sender linkno(main)<>
22768 25516       bs  w0  x1+p11    ;     devhost linkno(subproc) then
22769 25518       se  w0  0         ;  goto link+0
22770 25520       jl      x3+0      ;
22771 25522       rl  w0  x2+p323   ;  if sender host-id(main)<>
22772 25524       se  w0  (x1+p5)   ;     devhost host-id(subproc) then
22773 25526       jl      x3+0      ;  goto link+0
22774 25528       bl  w0  x2+p321   ;  if sender net-id(main)<>
22775 25530       bs  w0  x1+p7     ;     devhost net-id(subproc) then
22776 25532  ;    se  w0  0         ;  goto link+0
22777 25532  ;    jl      x3+0      ;
22778 25532       jl      x3+2      ;  goto link+2
22779 25534  
22779 25534  e.                     ; end of testlink
22780 25534  \f


22780 25534  ; fpa-subproc          common procedures
22781 25534  ; eli, 8.6.1977
22782 25534  
22782 25534  ; procedure reject
22783 25534  ;
22784 25534  ; sets the internal status of mainproc to 'reject'
22785 25534  ; and jumps to testmore
22786 25534  ;
22787 25534  ;        call          no return
22788 25534  ;  w0
22789 25534  ;  w1    subproc
22790 25534  ;  w2
22791 25534  ;  w3
22792 25534  
22792 25534  b. i10, j10
22793 25534  w.
22794 25534  
22794 25534  u24:                   ; reject:
22795 25534       al  w0  p163      ;  internal status(mainproc(subproc):=
22796 25536       am      (x1+a50)  ;  reject
22797 25538       hs  w0  +p80      ;
22798 25540       jl.     u2.       ;  goto testmore
22799 25542  
22799 25542  e.                     ; end of reject
22800 25542  \f


22800 25542  ; fpa-subproc          common procedures
22801 25542  ; eli, 7.8.1975
22802 25542  
22802 25542  ; testmore
22803 25542  ;
22804 25542  ; entered, when the subproc-state should be tested for more messages to
22805 25542  ; process.
22806 25542  ;
22807 25542  ; if the state of the subproc is free, and more messages to process exist
22808 25542  ; the subproc is linked to the mainproc.
22809 25542  ;
22810 25542  ; return is made through the common return.
22811 25542  ;
22812 25542  ; upon entry:
22813 25542  ;
22814 25542  ;  w0    
22815 25542  ;  w1
22816 25542  ;  w2   
22817 25542  ;  w3
22818 25542  ;  b19    subproc
22819 25542  
22819 25542  b.i10, j10
22820 25542  w.
22821 25542  
22821 25542  u2:                    ; testmore:
22822 25542       rl  w1  b19       ;  get current subproc
22823 25544  c.p101 b.f1 w.         ;*****test52*****
22824 25544       rs. w3  f0.       ;
22825 25546       jl. w3  f4.       ;
22826 25548       52                ;
22827 25550  f0:  0                 ;
22828 25552       jl.     f1.       ;
22829 25554       al  w0  x1        ;   testrecord:=  
22830 25556       al  w1  x1+p19+16 ;     process description;
22831 25558       jl. w3  f5.       ;
22832 25560  f1:                    ;
22833 25560  e.z.                   ;*****test52*****
22834 25560       rl  w0  x1+p14    ;  if in mainproc queue then
22835 25562       se  w0  x1+p14    ;  
22836 25564       jl      (b101)    ;  return
22837 25566  
22837 25566  ; test answers to transmit
22838 25566  
22838 25566       rl  w0  x1+p12    ;
22839 25568  c.p101 b.f1 w.         ;*****test53*****
22840 25568       rs. w3  f0.       ;*
22841 25570       jl. w3  f4.       ;*
22842 25572       53                ;*
22843 25574  f0:  0                 ;*
22844 25576       jl.     f1.       ;*
22845 25578       al  w0  x3        ;*
22846 25580       al  w1  x3-2      ;*
22847 25582       jl. w3  f5.       ;*
22848 25584  f1:                    ;*
22849 25584  e.z.                   ;*****test53*****
22850 25584       sz  w0  v71       ;  if answer att<>0 then
22851 25586       jl.     i0.       ;  goto link subproc
22852 25588  
22852 25588  ; test message entry free and number of buffers free
22853 25588  
22853 25588       jl. w3  u8.       ;  if mess.addr.(cur.entry)<>0
22854 25590       bl  w0  x1+p16    ;
22855 25592  c.p101 b.f1 w.         ;*****test54*****
22856 25592       rs. w3  f0.       ;*
22857 25594       jl. w3  f4.       ;*
22858 25596       54                ;*
22859 25598  f0:  0                 ;*
22860 25600       jl.     f1.       ;*
22861 25602       al  w0  x3        ;*
22862 25604       al  w1  x3-2      ;*
22863 25606       jl. w3  f5.       ;*
22864 25608  f1:                    ;*
22865 25608  e.z.                   ;*****test54*****
22866 25608       sn  w2  0         ;  or bufs free=0 then
22867 25610       sn  w0  0         ;
22868 25612       jl      (b101)    ;  goto return
22869 25614  
22869 25614  ; test for a current message or more messages to process
22870 25614  
22870 25614       rl  w0  x1+p12    ;
22871 25616       sz  w0  v70       ;  if blocked(subproc) then
22872 25618       jl      (b101)    ;  goto mainproc return
22873 25620       sz  w0  v72       ;  if pending messages(subproc)<>0 then
22874 25622       jl.     i0.       ;  goto link subproc
22875 25624       jl. w3  u12.      ;  if next pending=0 then
22876 25626  c.p101 b.f1 w.         ;*****test55*****
22877 25626       rs. w3  f0.       ;*
22878 25628       jl. w3  f4.       ;*
22879 25630       55                ;*
22880 25632  f0:  0                 ;*
22881 25634       jl.     f1.       ;*
22882 25636       al  w0  x3        ;*
22883 25638       al  w1  x3-2      ;*
22884 25640       jl. w3  f5.       ;*
22885 25642  f1:                    ;*
22886 25642  e.z.                   ;*****test55*****
22887 25642       sn  w2  0         ;
22888 25644       jl      (b101)    ;  goto return
22889 25646  
22889 25646  ; a message or answer is pending
22890 25646  ; link subproc to the corresponding mainproc
22891 25646  ;
22892 25646  ; note: the buffer is not reserved for the subproc and the bufferaddress
22893 25646  ;       not saved until processing actually starts.
22894 25646  
22894 25646  i0:                    ; link subproc:
22895 25646       al  w2  x1+p14    ;  elem:= queue elem(subproc)
22896 25648       am      (x1+a50)  ;  head:= queue head(mainproc(subproc))
22897 25650       al  w1  +p14      ;
22898 25652       jl  w3  d6        ;  link(head,elem)
22899 25654  
22899 25654  ; mainproc will later activate the subproc
22900 25654  
22900 25654       jl    (b101)      ;  goto return
22901 25656  
22901 25656  e.                     ; end of testmore
22902 25656  \f


22902 25656  ; fpa-subproc          common procedures
22903 25656  ; eli, 7.8.1975
22904 25656  
22904 25656  ; procedure no block
22905 25656  ;
22906 25656  ; signals a 'nothing to do' status to mainproc,
22907 25656  ; clears busy and returns to mainproc
22908 25656  ;
22909 25656  ;        call          no return
22910 25656  ; w0
22911 25656  ; w1     subproc
22912 25656  ; w2
22913 25656  ; w3
22914 25656  
22914 25656  b. i10, j10
22915 25656  w.
22916 25656  
22916 25656  u3:  al  w0  p164      ; no block:
22917 25658       am      (x1+a50)  ;  internal state(mainproc):=
22918 25660       hs  w0  +p60      ;    'nothing to do' (i.e. regretted)
22919 25662       jl.     u2.       ;  goto testmore
22920 25664  
22920 25664  e.                     ; end of no block
22921 25664  \f


22921 25664  
22921 25664  ; fpa-subproc          stepping stones
22922 25664  ; eli, 77.06.14
22923 25664  
22923 25664  c. p101
22924 25664  
22924 25664       jl.     f4.       ;
22925 25666  f4=k-2
22926 25666  
22926 25666       jl.     f5.       ;
22927 25668  f5=k-2
22928 25668  
22928 25668       jl.     f6.       ;
22929 25670  f6=k-2
22930 25670  
22930 25670  z.
22931 25670  
22931 25670       jl.     u4.       ;
22932 25672  u4=k-2
22933 25672  
22933 25672       jl.     u8.       ;
22934 25674  u8=k-2
22935 25674  
22935 25674       jl.     u12.      ;
22936 25676  u12=k-2
22937 25676  
22937 25676       jl.     u15.      ;
22938 25678  u15=k-2
22939 25678  \f


22939 25678  ; fpa-subproc          common procedures
22940 25678  ; eli, 11.2.1976
22941 25678  
22941 25678  ; procedure prepare transfer
22942 25678  ;
22943 25678  ; saves the message address for the subproc and then
22944 25678  ; prepares transmission of a header (and maybe a datablock)
22945 25678  ; depending on the operation-field in the message.
22946 25678  ; finally the standard parameters in mainproc corresponding to
22947 25678  ; the subproc are set.
22948 25678  ;
22949 25678  ; note, that only the operations <input>, <output> or <message>
22950 25678  ;       may be handled.
22951 25678  ;
22952 25678  ;        call          return
22953 25678  ; w0                   undefined
22954 25678  ; w1     subproc       unchanged
22955 25678  ; w2     message       unchanged
22956 25678  ; w3     link          undefined
22957 25678  
22957 25678  b. i10, j10
22958 25678  w.
22959 25678  
22959 25678  u30:                   ; prepare transfer:
22960 25678       rs. w3  j0.       ;  save link
22961 25680       jl. w3  u13.      ;  save and reserve message
22962 25682       al. w3  i0.       ;  link:= after prepare
22963 25684  
22963 25684  ; switch to procedure, corresponding to operation
22964 25684  
22964 25684       bl  w0  x2+8      ;  op:= operation(mes)
22965 25686       sn  w0  3         ;  if op=input then
22966 25688       jl.     u31.      ;     goto prepare input
22967 25690       sn  w0  5         ;  if op=output then
22968 25692       jl.     u32.      ;     goto prepare output
22969 25694       jl.     u33.      ;  goto prepare message
22970 25696  
22970 25696  ; return is made to here from all subroutine calls.
22971 25696  ; set rest of parameters
22972 25696  
22972 25696  i0:  rl  w3  x1+a50    ;  main:= mainproc(subproc)
22973 25698       bz  w0  x1+a56+1  ;  s:= initialize state(subproc)
22974 25700       se  w0  1         ;  state(main):= if s=1 then s else 0
22975 25702       al  w0  0         ;
22976 25704       hs  w0  x3+p62    ;
22977 25706       al  w0  0         ;  initialize state(subproc):=0
22978 25708       hs  w0  x1+a56+1  ;
22979 25710       bz  w0  x2+9      ;  mode(main):= mode(mes)
22980 25712       rs  w0  x3+p63    ;
22981 25714       jl. w3  u25.      ;  set linkparams
22982 25716       rl  w0  x1+p13    ;   if current message(subproc)<>0 then
22983 25718       sn  w0  0         ;     blocked(subproc):=true;
22984 25720       jl.     i1.       ;
22985 25722       al  w0  v70       ;
22986 25724       lo  w0  x1+p12    ;
22987 25726       rs  w0  x1+p12    ;
22988 25728  i1:                    ;
22989 25728  c.p101 b.f1 w.         ;*****test56*****
22990 25728       rs. w3  f0.       ;*
22991 25730       jl. w3  f4.       ;*
22992 25732       56                ;*
22993 25734  f0:  0                 ;*
22994 25736       jl.     f1.       ;*
22995 25738       al  w0  x2        ;*
22996 25740       al  w1  x2+22     ;*
22997 25742       jl. w3  f5.       ;*
22998 25744  f1:                    ;*
22999 25744  e.z.                   ;*****test56*****
23000 25744  
23000 25744  ; return
23001 25744  
23001 25744       jl.     (j0.)     ;
23002 25746  
23002 25746  j0:  0                 ;  saved link
23003 25748  
23003 25748  e.                     ; end of prepare transfer
23004 25748  \f


23004 25748  ; fpa-subproc          common procedures
23005 25748  ; eli, 19.8.1975
23006 25748  
23006 25748  ; procedure prepare input
23007 25748  ;
23008 25748  ; prepares transmission of a header corresponding to an input-
23009 25748  ; message. the <size>-field of the header shows how many characters
23010 25748  ; should be input.
23011 25748  ;
23012 25748  ;        call          return
23013 25748  ; w0                   undefined
23014 25748  ; w1     subproc       unchanged
23015 25748  ; w2     message       unchanged
23016 25748  ; w3     link          undefined
23017 25748  
23017 25748  b. i10, j10
23018 25748  w.
23019 25748  u31:                   ; prepare input:
23020 25748       rs. w3  j0.       ;  save link
23021 25750       jl. w3  u16.      ;  prepare addresses
23022 25752       rl  w3  x1+a50    ;  main:= mainproc(subproc)
23023 25754       al  w0  v50       ;  function(main):= input
23024 25756       hs  w0  x3+p61    ;
23025 25758       al  w0  0         ;  data size(main):= 0
23026 25760       rs  w0  x3+p66    ;
23027 25762       jl.     (j0.)     ;  goto link
23028 25764  
23028 25764  j0:  0                 ; saved link
23029 25766  
23029 25766  e.                     ; end of prepare input
23030 25766  \f


23030 25766  ; fpa-subproc          common procedures
23031 25766  ; eli, 11.2.1976
23032 25766  
23032 25766  ; procedure prepare output
23033 25766  ;
23034 25766  ; prepares the transmission of a header corresponding to an
23035 25766  ; output-message. the addresses in the sender table of mainproc
23036 25766  ; are initialized corresponding to a datablock, which is to
23037 25766  ; be transmitted following the header.
23038 25766  ; if the sender of the message is stopped, an answer is 
23039 25766  ; generated showing the number of bytes and characters output
23040 25766  ; until now.
23041 25766  ;
23042 25766  ;        call          return
23043 25766  ; w0                   undefined
23044 25766  ; w1     subproc       unchanged
23045 25766  ; w2     message       unchanged
23046 25766  ; w3     link          undefined
23047 25766  
23047 25766  b. i10, j10
23048 25766  w.
23049 25766  
23049 25766  u32: rs. w3  j0.       ; prepare output: save link
23050 25768  
23050 25768  ; examine state of sender
23051 25768  
23051 25768       jl. w3  u21.      ;  test and increase stop count
23052 25770       jl.     u3.       ; stopped: goto no block
23053 25772  
23053 25772  ; sender still running
23054 25772       rl  w3  x1+a50    ; main:= main(subproc)
23055 25774       al  w0  v52+(:1<0:); function(main):=
23056 25776       hs  w0  x3+p61    ; output+databit
23057 25778  c. p103-1
23058 25778       al  w0  0         ; addresscode(main):=
23059 25780       hs  w0  x3+p72    ; sender area
23060 25782       rs  w2  x3+p71    ; messagebuf(main):= message;
23061 25784  z.
23062 25784       jl. w3  u16.      ;  prepare addresses
23063 25786       jl.     (j0.)     ;  goto link
23064 25788  
23064 25788  j0:  0                 ;  saved link
23065 25790  
23065 25790  e.                     ; end of prepare output
23066 25790  \f


23066 25790  ; fpa-subproc          common procedures
23067 25790  ; eli, 19.8.1975
23068 25790  
23068 25790  ; procedure prepare message
23069 25790  ;
23070 25790  ; prepares transmission of a header , followed by the content of
23071 25790  ; the messagebuffer (only the user part is transmitted).
23072 25790  ; the field <current message> in the subproc is cleared.
23073 25790  ;
23074 25790  ;        call          return
23075 25790  ; w0                   undefined
23076 25790  ; w1     subproc       unchanged
23077 25790  ; w2     message       unchanged
23078 25790  ; w3     link          mainproc
23079 25790  
23079 25790  b. i10, j10
23080 25790  w.
23081 25790  
23081 25790  u33: rs. w3  j0.       ; prepare message: save link
23082 25792       al  w0  0         ;  current message(subproc):= 0
23083 25794       rs  w0  x1+p13    ;
23084 25796       rl  w3  x1+a50    ;  main:= mainproc(subproc)
23085 25798       al  w0  x2+8      ;  first(main):= first user addr(mes)
23086 25800       rs  w0  x3+p65    ;
23087 25802       al  w0  (:22-8+2:)/2*3; header size(main):= data size(main):=
23088 25804       rs  w0  x3+p64    ;    size of user part(mes)
23089 25806       rs  w0  x3+p66    ;
23090 25808       al  w0  v54+(:1<0:); function(mainproc):= message+databit
23091 25810       hs  w0  x3+p61    ;
23092 25812  c. p103-1
23093 25812       al  w0  8         ;
23094 25814       hs  w0  x3+p72    ;
23095 25816  z.
23096 25816  
23096 25816  ; return
23097 25816  
23097 25816       jl.     (j0.)     ;  
23098 25818  
23098 25818  j0:  0                 ; saved link
23099 25820  
23099 25820  e.                     ; end of prepare message
23100 25820  \f


23100 25820  ; fpa-subproc          common procedures
23101 25820  ; eli, 11.2.1976
23102 25820  
23102 25820  ; procedure test header and data transmitted
23103 25820  ;
23104 25820  ; tests the result of transmission of a header and (maybe)
23105 25820  ; a datablock.
23106 25820  ; if the <stop count increased>-flag is set, the stop count
23107 25820  ; of the sender of current message is decreased.
23108 25820  ; if a transmission error has occured, the message is returned
23109 25820  ; with result=4 (receiver malfunction) and the <current message>-
23110 25820  ; field cleared. return will then be made to <link+0>.
23111 25820  ;
23112 25820  ; if no error has occured, <current bufno> is
23113 25820  ; increased and return made to <link+2>.
23114 25820  ;
23115 25820  ;        call          return
23116 25820  ; w0                   undefined
23117 25820  ; w1     subproc       unchanged
23118 25820  ; w2                   undefined
23119 25820  ; w3     link          undefined
23120 25820  
23120 25820  b. i10, j10
23121 25820  w.
23122 25820  
23122 25820  u40:                   ; test header and data transmitted:
23123 25820       rs. w3  j0.       ;  save link
23124 25822       rl  w3  x1+a50    ;  if function type(main(subproc))=answer then
23125 25824       bz  w0  x3+p61    ;
23126 25826       sz  w0  2.10      ;
23127 25828       jl.     i1.       ;  goto after answer attention
23128 25830       jl. w3  u8.       ;  <current buffer>:= w2:=
23129 25832       rs  w2  b18       ;  message
23130 25834       bl  w2  x1+p17    ;  get messageno
23131 25836       sz  w0  2.1       ;  if databit(function)=1 then
23132 25838       jl. w3  u18.      ;  test and decrease stop count
23133 25840       rl  w2  b18       ;
23134 25842  
23134 25842  ; test transmission state
23135 25842  
23135 25842       am      (x1+a50)  ;  if internal state(mainproc(subproc))<>0 then
23136 25844       bl  w0  +p60      ;  begin
23137 25846       sn  w0  0         ;
23138 25848       jl.     i0.       ;  
23139 25850  
23139 25850  ; transmission trouble
23140 25850  
23140 25850       sl  w2  (b8+4)    ;  if message addr>=first message then
23141 25852       jl.     +4        ;  begin
23142 25854       jl.     i2.       ;
23143 25856                         ;
23144 25856       se  w0  p161      ;   if state<>1 then
23145 25858       al  w2  0         ;   mes:= 0
23146 25860       rs  w2  x1+p13    ;   comment: state=1 after wait;
23147 25862       bl  w2  x1+p17    ;   get messageno;
23148 25864       jl. w3  u18.      ;   test and decrease stopcount;
23149 25866       rl  w2  x1+p13    ;   mes:= current message(subproc);
23150 25868       al  w0  4         ;   current message(subproc):= mes
23151 25870       sn  w2  0         ;   if mes=0 then
23152 25872       jl  w3  g19       ;   deliver result(4)
23153 25874  i2:  al  w0  -1-v70    ;  end
23154 25876       la  w0  x1+p12    ;  blocked(subproc):= false
23155 25878       rs  w0  x1+p12    ;
23156 25880  c.p101 b. f1 w.        ;*****test57*****
23157 25880       rs. w3  f0.       ;*
23158 25882       jl. w3  f4.       ;*
23159 25884       57                ;*
23160 25886  f0:  0                 ;*
23161 25888       jl.     f1.       ;*
23162 25890       rl  w2  b18       ;*
23163 25892       al  w0  x2        ;*
23164 25894       al  w1  x2+22     ;*
23165 25896       jl. w3  f5.       ;*
23166 25898  f1:                    ;*
23167 25898  e.z.                   ;*****test57*****
23168 25898       al  w0  0         ;
23169 25900       jl. w3  u9.       ;   message addr(current entry):= 0 
23170 25902       rs  w0  x2        ;
23171 25904       al  w0  1         ;   increase(free buffers(subproc))
23172 25906       ba  w0  x1+p16    ;
23173 25908       hs  w0  x1+p16    ;
23174 25910       jl.     (j0.)     ;   goto link+0
23175 25912                         ;  end
23176 25912  
23176 25912  ; transmission ok.
23177 25912  
23177 25912  i0:                    ;
23178 25912  c.p101 b.f1 w.         ;*****test58*****
23179 25912       rs. w3  f0.       ;*
23180 25914       jl. w3  f4.       ;*
23181 25916       58                ;*
23182 25918  f0:  0                 ;*
23183 25920       jl.     f1.       ;*
23184 25922       rs  w2  x3        ;*
23185 25924       rl  w2  x1+p13    ;*
23186 25926       rs  w2  x3+2      ;*
23187 25928       al  w0  x3        ;*
23188 25930       al  w1  x3+2      ;*
23189 25932       jl. w3  f5.       ;*
23190 25934  f1:                    ;*
23191 25934  e.z.                   ;*****test58*****
23192 25934       jl. w3  u10.      ;  increase(current entry(subproc))
23193 25936  
23193 25936  ; return
23194 25936  
23194 25936       jl.     i3.       ;  goto link+2
23195 25938  
23195 25938  ; answer attention has been transmitted
23196 25938  
23196 25938  i1:  bz  w3  x3+p60    ; after answer attention:
23197 25940  c.p101 b.f1 w.         ;*****test59*****
23198 25940       rs. w3  f0.       ;*
23199 25942       jl. w3  f4.       ;*
23200 25944       59                ;*
23201 25946  f0:  0                 ;*
23202 25948       jl.     f1.       ;*
23203 25950       rs  w0  x3        ;*
23204 25952       al  w0  x3        ;*
23205 25954       al  w1  x3        ;*
23206 25956       jl. w3  f5.       ;*
23207 25958  f1:                    ;*
23208 25958  e.z.                   ;*****test59*****
23209 25958       al  w0  -1-v71    ;  if internal state(main)=0 then
23210 25960       la  w0  x1+p12    ;
23211 25962       sn  w3  0         ;
23212 25964       rs  w0  x1+p12    ;  answer attention flag(subproc):= false
23213 25966  i3:  rl. w3  j0.       ;  goto link+2
23214 25968       jl      x3+2      ;
23215 25970  
23215 25970  j0:  0                 ;  saved link
23216 25972  
23216 25972  e.                     ; end of test header and data transmitted
23217 25972  \f


23217 25972  ; fpa-subproc          common procedures
23218 25972  ; eli, 15.1.1976
23219 25972  
23219 25972  ; procedure test answer header
23220 25972  ;
23221 25972  ; called when a header, which is going to be followed by a datablock has
23222 25972  ; been received.
23223 25972  ; in the current version only answers to previously transmitted messages
23224 25972  ; may be handled.
23225 25972  ; functions may be <answer input> or <answer message>.
23226 25972  ; the bufno in the answer is used to find the message table entry.
23227 25972  ;   depending on the value in the entry, the following is performed:
23228 25972  ;
23229 25972  ; message entry:
23230 25972  ;
23231 25972  ;   0       the message has been returned due to line errors. a reject
23232 25972  ;           status is returned on the communication line. return
23233 25972  ;           will be made to testmore.
23234 25972  ;   impossible message address: signals a special function for the
23235 25972  ;           subproc. return to <link+2>.
23236 25972  ;   normal message address: procedure corresponding to function is
23237 25972  ;           activated. if the datablock can be received return is
23238 25972  ;           made to mainproc. otherwise a skip-status is signalled
23239 25972  ;           and return made to <link>.
23240 25972  ;
23241 25972  ;        call          return
23242 25972  ; w0                   undefined
23243 25972  ; w1     subproc       unchanged
23244 25972  ; w2                   undefined
23245 25972  ; w3     link          undefined
23246 25972  
23246 25972  b.i10, j10
23247 25972  w.
23248 25972  
23248 25972  u50:                   ; test header:
23249 25972       rs. w3  j0.       ;  save link
23250 25974       jl. w3  u23.      ;  testlink
23251 25976       jl.     u24.      ; error: goto reject
23252 25978       rl. w3  j0.       ;  restore link
23253 25980       al  w0  p160      ;
23254 25982       hs  w0  x2+p80    ;  skip(main):= false
23255 25984       bz  w0  x2+p81    ;  func:= function(main)
23256 25986       bz  w2  x2+p88    ;  mes:= even message table(bufno(main))
23257 25988       am      x2        ;
23258 25990       am      x2        ;
23259 25992       rl  w2  x1+p19    ;
23260 25994  c.p101 b.f1 w.         ;*****test60*****
23261 25994       rs. w3  f0.       ;*
23262 25996       jl. w3  f4.       ;*
23263 25998       60                ;*
23264 26000  f0:  0                 ;*
23265 26002       jl.     f1.       ;*
23266 26004       al  w0  x2        ;*
23267 26006       al  w1  x2+22     ;*
23268 26008       jl. w3  f5.       ;*
23269 26010  f1:                    ;*
23270 26010  e.z.                   ;*****test60*****
23271 26010       la  w2  g50       ;
23272 26012       sl  w2  (b8+4)    ;  if mes<first message then
23273 26014       jl.     i0.       ;  begin
23274 26016       sn  w2  0         ;  if mes=0 then
23275 26018       jl.     u24.      ;  goto reject
23276 26020  c.p101 b.f1 w.         ;*****test61*****
23277 26020       rs. w3  f0.       ;
23278 26022       jl. w3  f4.       ;*
23279 26024       61                ;*
23280 26026  f0:  0                 ;*
23281 26028       jl.     f1.       ;*
23282 26030       al  w0  x1+p19    ;*
23283 26032       al  w1  x1+p19+14 ;*
23284 26034       jl. w3  f5.       ;*
23285 26036  f1:                    ;*
23286 26036  e.z.                   ;*****test61*****
23287 26036       jl      x3+2      ;   goto <link+2>
23288 26038                         ;  end
23289 26038  i0:  rs  w2  b18       ;  current message(monitor):= mes
23290 26040       am      (x1+a50)  ;  if local function(rec)=
23291 26042       bz  w3  +p99      ;     rejected packet then
23292 26044       se  w3  3         ;  begin comment: deliver answer malfunction;
23293 26046       jl.     i1.       ;
23294 26048       am      (x1+a50)  ;   w2:= bufno(rec)
23295 26050       bz  w2  +p88      ;
23296 26052       jl. w3  u18.      ;   test and decrease stopcount
23297 26054       jl. w3  u11.      ;   clear message entry
23298 26056       al  w0  4      ;
23299 26058       jl  w3  g19       ;   deliver result(4)
23300 26060       al  w0  p162      ;   internal status(main):= skip
23301 26062       am      (x1+a50)  ;
23302 26064       hs  w0  +p80      ;
23303 26066       jl.     u2.       ;   goto testmore
23304 26068  i1:  rl. w3  j0.       ;  end
23305 26070  
23305 26070  ; switch to action
23306 26070  
23306 26070       sn  w0  v51+(:1<0:);  if function= <answer input with data> then
23307 26072       jl.     u51.      ;     goto test answer input
23308 26074       jl.     u53.      ;   goto test answer message
23309 26076  
23309 26076  j0:  0                 ; saved link
23310 26078  
23310 26078  e.                     ; end of test answer header
23311 26078  \f


23311 26078  
23311 26078  ; fpa-subproc          common procedures
23312 26078  ; eli, 11.2.1976
23313 26078  
23313 26078  ; procedure test answer input header
23314 26078  ;
23315 26078  ; called, when a header with function=<answer input with data> has been
23316 26078  ; received.
23317 26078  ; the state of the receiving process
23318 26078  ; is checked.  if it is still running, the mainproc parameters
23319 26078  ; are initialized and the procedure returns to mainproc.
23320 26078  ;
23321 26078  ; if the receiver is stopped an answer is returned and a skip-status signalled
23322 26078  ; to mainproc.
23323 26078  ;
23324 26078  ;        call          return
23325 26078  ; w0                   undefined
23326 26078  ; w1     subproc       unchanged
23327 26078  ; w2     message       undefined
23328 26078  ; w3     link          undefined
23329 26078  
23329 26078  b. i10, j10
23330 26078  w.
23331 26078  
23331 26078  u51:                   ; test answer input header:
23332 26078       rs. w3  j0.       ;  save link
23333 26080  
23333 26080  ; examine state of receiving process
23334 26080  
23334 26080       jl. w3  u21.      ;  test and increase stop count
23335 26082       jl.     i0.       ; stopped: goto skip 
23336 26084  
23336 26084  ; sender still running
23337 26084  
23337 26084       rl  w3  x1+a50    ;  main:= mainproc(subproc)
23338 26086       rl  w0  x2+22     ;  first(main):= updated first(mes)
23339 26088       rs  w0  x3+p85    ;
23340 26090       rl  w0  x3+p84    ;  
23341 26092       rs  w0  x3+p86    ;  data size(main):= header size(main)
23342 26094  c. p103-1
23343 26094       al  w0  0         ; addres code(main):=
23344 26096       hs  w0  x3+p92    ; sender area
23345 26098       rs  w2  x3+p91    ; messagebuf(main):= message
23346 26100  z.
23347 26100  
23347 26100  ; return to mainproc, which will then receive the datablock
23348 26100  
23348 26100       jl      (b101)    ;  goto mainproc return
23349 26102  
23349 26102  ; receiver of databuffer stopped
23350 26102  
23350 26102  i0:  al  w0  p162      ; skip:  signal skip-status to mainproc
23351 26104       am      (x1+a50)  ;
23352 26106       hs  w0  +p80      ;
23353 26108       al  w0  0         ;
23354 26110       rs  w0  x1+p12    ;   state(proc):=0;
23355 26112  
23355 26112  ; return
23356 26112  
23356 26112       jl.     (j0.)     ;
23357 26114  
23357 26114  j0:  0                 ;  saved link
23358 26116  
23358 26116  e.                     ; end of test answer input header
23359 26116  \f


23359 26116  ; fpa-subproc          common procedures
23360 26116  ; eli, 15.1.1976
23361 26116  
23361 26116  ; procedure test answer message header
23362 26116  ;
23363 26116  ; called when a header with function=<answer message with data> has been 
23364 26116  ; received.
23365 26116  ; the parameters in mainproc are initiated to receive the answer.
23366 26116  ; return will always be made to mainproc.
23367 26116  ;
23368 26116  ; note, that it is not necessary to check the running status
23369 26116  ;       of the receiver, as the datablock is received directly
23370 26116  ;       in the messagebuffer area in the monitor.
23371 26116  ;
23372 26116  ;        call          no return
23373 26116  ; w0
23374 26116  ; w1     subproc
23375 26116  ; w2     message
23376 26116  ; w3
23377 26116  
23377 26116  b. i10, j10
23378 26116  w.
23379 26116  
23379 26116  u53:                   ; test answer message header: 
23380 26116       rl  w3  x1+a50    ;  main:= mainproc(subproc)
23381 26118       al  w0  x2+8      ;  first(main):= first user word(mes)
23382 26120       rs  w0  x3+p85    ;  
23383 26122       al  w0  (:22-8+2:)/2*3;  data size(main):=
23384 26124       rs  w0  x3+p86    ;  size of user part(mes)
23385 26126       al  w0  8         ;  address code(main):= dirty
23386 26128       hs  w0  x3+p92    ;
23387 26130  c. p103-1
23388 26130       al  w0  0         ;
23389 26132       rs  w0  x3+p91    ;
23390 26134  z.
23391 26134       jl      (b101)    ;  return to mainproc
23392 26136  
23392 26136  e.                     ; end of test answer message header
23393 26136  \f


23393 26136  
23393 26136  ; fpa-subproc          common procedures
23394 26136  ; eli, 11.2.1976
23395 26136  
23395 26136  ; procedure test answer data received
23396 26136  ;
23397 26136  ; a header without a datablock, or the datablock following a header has
23398 26136  ; been received.
23399 26136  ; if stop count has been increased (answer input) it is decreased.
23400 26136  ;
23401 26136  ; if the function field of the header corresponds to a message received
23402 26136  ; (attention) return will be made to <link+2>.
23403 26136  ;
23404 26136  ; if the message table of the entry corresponding to the bufno in the
23405 26136  ; answer does not describe a message (value to small) return will be made
23406 26136  ; to <link+4>. in this case w2 will hold the content of the message table entry.
23407 26136  ;
23408 26136  ; otherwise the procedure, corresponding to the mainproc <function>-
23409 26136  ; field is activated and return made to <link>.
23410 26136  ;
23411 26136  ;        call          return
23412 26136  ; w0                   undefined
23413 26136  ; w1     subproc       unchanged
23414 26136  ; w2                   undefined (see above for return to <link+4>
23415 26136  ; w3     link          undefined
23416 26136  
23416 26136  b. i10, j10
23417 26136  w.
23418 26136  
23418 26136  u60:                   ; test answer data received:
23419 26136       rl  w2  x1+a50    ;  if function(mainproc(subproc))=attention then
23420 26138       bz  w0  x2+p81    ;
23421 26140       sn  w0  v58       ;
23422 26142       jl.     u64.      ;  goto attention received.
23423 26144                         ;  note: link unchanged. will return to <link+2>
23424 26144       rs. w3  j0.       ;  save link
23425 26146       sz  w0  2.1       ;  if no data then
23426 26148       jl.     i2.       ;  begin
23427 26150       jl. w3  u23.      ;   testlink
23428 26152       jl.     u24.      ; error: goto reject
23429 26154                         ;  end
23430 26154  i2:  bz  w2  x2+p88    ;  mes:= even message addr(bufno(mainproc(subproc)))
23431 26156       am      x2        ;
23432 26158       am      x2        ;
23433 26160       rl  w3  x1+p19    ;
23434 26162       la  w3  g50       ;
23435 26164       sn  w3  0         ;  if mes=0 then
23436 26166       jl.     u24.      ;  goto reject
23437 26168       rs  w3  b18       ;  current message(monitor):= mes
23438 26170       jl. w3  u18.      ;  test and decrease stopcount(w2=messageno)
23439 26172       rl  w2  b18       ;  restore message
23440 26174       jl. w3  u11.      ;  clear message entry
23441 26176       al  w0  -1-v70    ;   blocked(subproc):=false;
23442 26178       la  w0  x1+p12    ;
23443 26180       rs  w0  x1+p12    ;
23444 26182       sl  w2  (b8+4)    ;  if mes<first message buffer then
23445 26184       jl.     i0.       ;
23446 26186       rl. w3  j0.       ;   goto <link+4>
23447 26188       jl      x3+4      ;  
23448 26190  
23448 26190  ; switch to action
23449 26190  i0:  rl  w3  x1+a50    ;
23450 26192       bz  w0  x3+p99    ;  if local function(rec)=
23451 26194       se  w0  3         ;     rejected packet then
23452 26196       jl.     i1.       ;  begin
23453 26198       al  w0  0         ; if mess=cur mess then
23454 26200       sn  w2  (x1+p13)  ; cur mess=0
23455 26202       rs  w0  x1+p13    ;
23456 26204       al  w0  4         ;
23457 26206       jl  w3  g19       ;   deliver result(4)
23458 26208       jl.     u2.       ;   goto testmore
23459 26210  i1:                    ;  end
23460 26210       bz  w0  x3+p81    ;  w0:= function(mainproc(subproc))
23461 26212       la  w0  g50       ;  remove databit
23462 26214       rl. w3  j0.       ;  link:= saved link
23463 26216       sn  w0  v51       ;  if function=<answer input> then
23464 26218       jl.     u61.      ;    goto answer input data received 
23465 26220       sn  w0  v53       ;  if function=<answer output> then
23466 26222       jl.     u62.      ;    goto test answer output header
23467 26224       jl.     u63.      ;  goto test answer message data
23468 26226  
23468 26226  j0:  0                 ;  saved link
23469 26228  
23469 26228  e.                     ; end of test answer data received
23470 26228  \f


23470 26228  
23470 26228  ; fpa-subproc          common procedures
23471 26228  ; eli, 15.1.1976
23472 26228  
23472 26228  ; procedure answer input data received
23473 26228  ;
23474 26228  ; called, when the datablock following a header with <function>=
23475 26228  ; <answer input (with or without data)> has been received.
23476 26228  ;
23477 26228  ; if the message is not current message, if a result- or status error
23478 26228  ; is detected or if less than wanted is input, an answer with result=1
23479 26228  ; is generated. otherwise the next block may be input.
23480 26228  ;
23481 26228  ;        call          return
23482 26228  ; w0                   undefined
23483 26228  ; w1     subproc       unchanged
23484 26228  ; w2     message       unchanged
23485 26228  ; w3     link          undefined
23486 26228  
23486 26228  b. i10, j10
23487 26228  w.
23488 26228  
23488 26228  u61:                   ; answer input data received:
23489 26228       rs. w3  j0.       ;  save link
23490 26230       se  w2  (x1+p13)  ;  if mes=current message(subproc) then
23491 26232       jl.     i1.       ;  begin
23492 26234       rl  w3  x1+a50    ;   main:= mainproc(subproc)
23493 26236       rl  w0  x3+p84    ;   
23494 26238       zl  w3  x3+p82    ;      
23495 26240       am      (x1+a50)  ;
23496 26242       wa  w3  +p83      ;
23497 26244       sn  w3  0         ;   if result(main)=status(main)=0 or
23498 26246       sn  w0  0         ; size(main) = 0 then
23499 26248       jl.     i0.       ;   begin
23500 26250       jl. w3  u15.      ;    updated first(mes):=
23501 26252       wa  w0  x2+22     ;      updated first(mes)+ convert to 12-bit(header size(main))
23502 26254       rs  w0  x2+22     ;
23503 26256       jl.     (j0.)     ;    goto return
23504 26258                         ;   end result ok
23505 26258  
23505 26258  ; after some error in current message
23506 26258  
23506 26258  i0:  al  w0  0         ;   current message(subproc):= 0
23507 26260       rs  w0  x1+p13    ;  end current message
23508 26262  
23508 26262  ; not current message
23509 26262                         ;  else
23510 26262  i1:  jl. w3  u7.       ;  prepare answer
23511 26264       rl. w3  j0.       ;  link:= saved link
23512 26266       jl.     u5.       ;  goto get and deliver result
23513 26268  
23513 26268  j0:  0                 ;  saved link
23514 26270  
23514 26270  e.                     ; end of answer input data received
23515 26270  \f


23515 26270  ; fpa-subproc          common procedures
23516 26270  ; eli, 15.1.1976
23517 26270  
23517 26270  ; procedure test answer output 
23518 26270  ;
23519 26270  ; test the parameters in a header corresponding to function
23520 26270  ; =answer output.
23521 26270  ; if the following conditions:
23522 26270  ;
23523 26270  ;   -the corresponding message is <current message>
23524 26270  ;   -the result is ok (=0)
23525 26270  ;   -the status is ok (=0)
23526 26270  ;   -the whole block has been output
23527 26270  ; a transfer of next part is prepared.
23528 26270  ;
23529 26270  ; otherwise an answer is generated
23530 26270  ;
23531 26270  ;        call          return
23532 26270  ; w0                   undefined
23533 26270  ; w1     subproc       unchanged
23534 26270  ; w2     message       undefined
23535 26270  ; w3     link          undefined
23536 26270  
23536 26270  b. i10,j10
23537 26270  w.
23538 26270  u62:                   ; test answer output header:
23539 26270       rs. w3  j0.       ;  save link
23540 26272       se  w2  (x1+p13)  ;  if mes=current message(subproc) then
23541 26274       jl.     i1.       ;  begin
23542 26276       rl  w3  x1+a50    ;   main:= mainproc(subproc)
23543 26278       rl  w0  x3+p84    ;   if size(main)=expected size(mes)
23544 26280       bl  w3  x3+p82    ;     and
23545 26282       am      (x1+a50)  ;
23546 26284       wa  w3  +p83      ;
23547 26286  c.p101 b.f1 w.         ;*****test62*****
23548 26286       rs. w3  f0.       ;*
23549 26288       jl. w3  f4.       ;*
23550 26290       62                ;*
23551 26292  f0:  0                 ;*
23552 26294       jl.     f1.       ;*
23553 26296       rs  w0  x3        ;*
23554 26298       rs  w1  x3+2      ;*
23555 26300       rs  w2  x3+4      ;*
23556 26302       rl. w0  f0.       ;*
23557 26304       rs  w0  x3+6      ;*
23558 26306       al  w0  x3        ;*
23559 26308       al  w1  x3+6      ;*
23560 26310       jl. w3  f5.       ;*
23561 26312  f1:                    ;*
23562 26312  e.z.                   ;*****test62*****
23563 26312       sn  w3  0         ;
23564 26314       se  w0  (x2+20)   ;      result(main)=status(main)=0 then
23565 26316       jl.     i0.       ;   begin
23566 26318       jl. w3  u15.      ;    updated first(mes):=
23567 26320       wa  w0  x2+22     ;      updated first(mes)+convert to 12-bit(size(main)
23568 26322       rs  w0  x2+22     ;
23569 26324       jl.     (j0.)     ;    goto return
23570 26326                         ;   end result ok
23571 26326  
23571 26326  ; after an error in current message
23572 26326  
23572 26326  i0:  al  w3  0         ;   current message(subproc):= 0
23573 26328       rs  w3  x1+p13    ;  end current message
23574 26330  
23574 26330  ; not current message
23575 26330  i1:                    ;
23576 26330  c.p101 b.f1 w.         ;*****test63*****
23577 26330       rs. w3  f0.       ;*
23578 26332       jl. w3  f4.       ;*
23579 26334       63                ;*
23580 26336  f0:  0                 ;*
23581 26338       jl.     f1.       ;*
23582 26340       al  w0  x2        ;*
23583 26342       al  w1  x2+22     ;*
23584 26344       jl. w3  f5.       ;*
23585 26346  f1:                    ;*
23586 26346  e.z.                   ;*****test63*****
23587 26346  
23587 26346       jl. w3  u7.       ;  prepare answer
23588 26348       jl. w3  u5.       ;  get and deliver result
23589 26350       jl.     (j0.)     ;  goto return
23590 26352  
23590 26352  j0:  0                 ;  saved link
23591 26354  
23591 26354  e.                     ; end of test answer output header
23592 26354  \f


23592 26354  ; fpa-subproc          common procedures
23593 26354  ; eli, 15.1.1976
23594 26354  
23594 26354  ; procedure answer message data received
23595 26354  ;
23596 26354  ; the datablock holding the answer of a message has been received.
23597 26354  ; 
23598 26354  ; the message is returned as an answer, with result and status as
23599 26354  ; defined in the preceding header. the other fields in the answer
23600 26354  ; are taken from the datablock (if any).
23601 26354  ;
23602 26354  ;        call          return
23603 26354  ; w0                   undefined
23604 26354  ; w1     subproc       unchanged
23605 26354  ; w2     message       unchanged
23606 26354  ; w3     link          undefined
23607 26354  
23607 26354  b. i10, j10
23608 26354  w.
23609 26354  
23609 26354  u63: am      (x1+a50)  ; answer message data received: status(mess):=
23610 26356       rl  w0  +p83      ;
23611 26358       ls  w0  4         ;  status(mon):= status(mes):=
23612 26360       sz. w0  (j0.)     ;  status(main)<12+
23613 26362       ba. w0  1         ;  if stopped bit then 1<8
23614 26364       ls  w0  8         ;
23615 26366       rs  w0  g20       ;
23616 26368       rs  w0  x2+8      ;
23617 26370       al  w0  0         ;
23618 26372       rs  w0  g21       ;  bytes:= chars:= 0
23619 26374       rs  w0  g22       ;
23620 26376       hs  w0  x2+9      ;
23621 26378  
23621 26378  ; note: link unchanged
23622 26378  
23622 26378       jl.     u5.       ;  goto get and deliver result
23623 26380  
23623 26380  j0:  (:1<12:)<4        ;  stopped bit in main status<4
23624 26382  
23624 26382  e.                     ; end of answer message data received
23625 26382  \f


23625 26382  ; fpa-subproc          common procedures
23626 26382  ; eli, 15.1.1976
23627 26382  
23627 26382  ; procedure attention received
23628 26382  ;
23629 26382  ; a header with function equal to a message type (i.e. attention) has
23630 26382  ; been received.
23631 26382  ; the answer attention-flag is set and the bufferno saved in the
23632 26382  ; state field of the subproc.
23633 26382  ;
23634 26382  ; return will be made to <link+2>.
23635 26382  ;
23636 26382  ;        call          return
23637 26382  ; w0                   undefined
23638 26382  ; w1     subproc       unchanged
23639 26382  ; w2                   undefined
23640 26382  ; w3     link          undefined
23641 26382  
23641 26382  b. i10, j10
23642 26382  w.
23643 26382  
23643 26382  u64:                   ; attention received:
23644 26382       al  w3  x3+2      ;  save link+2
23645 26384       rs. w3  j0.       ;
23646 26386       jl. w3  u23.      ;  testlink
23647 26388       jl.     u24.      ; error: goto reject
23648 26390       al  w0  v71       ;  w0:= answer attention flag+bufferno(main)
23649 26392       bz  w2  x2+p88    ;
23650 26394       la  w2  g53       ;  keep only last 8 bits of bufno
23651 26396       lo  w0  4         ;
23652 26398       lo  w0  x1+p12    ;  save in state(subproc)
23653 26400       rs  w0  x1+p12    ;
23654 26402       jl.     (j0.)     ;  goto link+2
23655 26404  
23655 26404  j0:  0                 ; saved link+2
23656 26406  
23656 26406  e.                     ; end of attention received
23657 26406    
23657 26406  ; stepping stones:
23658 26406       jl.     u3.   , u3 =k-2
23659 26408       jl.     u4.   , u4 =k-2
23660 26410       jl.     u12.  , u12=k-2
23661 26412       jl.     u20.  , u20=k-2
23662 26414       jl.      u21.   , u21=k-2
23663 26416       jl.     u30.  , u30=k-2
23664 26418       jl.     u50.  , u50=k-2
23665 26420       jl.     u14.  , u14=k-2
23666 26422  \f


23666 26422  
23666 26422  ; fpa-subproc          standard types
23667 26422  ; eli, 16.12.1975
23668 26422  
23668 26422  b. q20, s10
23669 26422  w.
23670 26422  
23670 26422  ; this code handles standard sequential devices with no special
23671 26422  ; actions, such as:
23672 26422  ;
23673 26422  ;     paper tape reader
23674 26422  ;     paper tape punch
23675 26422  ;     line printer
23676 26422  ;     card reader
23677 26422  ; etc.
23678 26422  
23678 26422  m.
23678 26422                  standard links

23679 26422  
23679 26422  ; entry point table:
23680 26422  h100:                  ; general sequential device
23681 26422  h110:                  ; paper tape reader
23682 26422  h112:                  ; paper tape punch
23683 26422  h114:                  ; line printer
23684 26422  h116:                  ; card reader
23685 26422  h120:                  ; plotter:
23686 26422  
23686 26422               q0        ;  after send message
23687 26424               q1        ;  before header transmit
23688 26426               q2        ;  after header transmit
23689 26428               q3        ;  after header received
23690 26430               q4        ;  after data received
23691 26432               q5        ;  after creation
23692 26434  
23692 26434  ; no structure of private part of process description required
23693 26434  \f


23693 26434  ; fpa-subproc          standard types
23694 26434  ; eli, 4.11.1975
23695 26434  
23695 26434  ; after send message 
23696 26434  ;
23697 26434  ; a new message has been received. check that user- or reservation
23698 26434  ; status is ok and link message to queue of subproc.
23699 26434  ; if the subproc is not busy, then link it to mainproc.
23700 26434  ; 
23701 26434  ; upon entry:
23702 26434  ; w0
23703 26434  ; w1     subproc
23704 26434  ; w2  
23705 26434  ; w3     
23706 26434  
23706 26434  b. i10, j10
23707 26434  w.
23708 26434  q0:                    ; after send message:
23709 26434       jl. w3  u4.       ;  check and link operation
23710 26436       jl.     u2.       ;  goto testmore
23711 26438  
23711 26438  e.                     ; end of after send message
23712 26438  \f


23712 26438  ; fpa-subproc          standard types
23713 26438  ; eli, 21.8.1975
23714 26438  
23714 26438  ; before header
23715 26438  ;
23716 26438  ; a header (and maybe a corresponding datablock) is to be transmitted.
23717 26438  ; find first non-processed message in queue of subproc and initialize
23718 26438  ; transmit-parameters in mainproc.
23719 26438  ;
23720 26438  ; upon entry:
23721 26438  ; w0
23722 26438  ; w1     subproc
23723 26438  ; w2
23724 26438  ; w3
23725 26438  
23725 26438  b. i10, j10
23726 26438  w.
23727 26438  q1:                    ; before header:
23728 26438       jl. w3  u20.      ;  test answer attention
23729 26440       jl. w3  u12.      ;  w2:=mes:= first pending message
23730 26442       sn  w2  0         ;  if mes=0 then
23731 26444       jl.     u3.       ;   goto no block.
23732 26446  
23732 26446  ; message found. initiate transfer
23733 26446  
23733 26446       jl. w3  u30.      ;  prepare transfer
23734 26448       jl      (b101)    ;  goto mainproc return
23735 26450  
23735 26450  e.                     ; end of before header
23736 26450  \f


23736 26450  ; fpa-subproc          standard types
23737 26450  ; eli, 21.8.1975
23738 26450  
23738 26450  ; after header and data transmitted
23739 26450  ;
23740 26450  ; entered by mainproc, when a header and a corresponding datablock
23741 26450  ; (if any) has been transmitted.
23742 26450  ; the result of the transmission is checked and if an error has
23743 26450  ; occured, the message is returned with result=4 (receiver
23744 26450  ; malfunction).
23745 26450  ;
23746 26450  ; finally the state of the subproc is checked for transmission of a
23747 26450  ; new block.
23748 26450  
23748 26450  b. i10, j10
23749 26450  w.
23750 26450  
23750 26450  q2:  jl. w3  u40.      ; after header: test header transmitted
23751 26452       jl.     u2.       ; error: goto testmore
23752 26454       jl.     u2.       ;  goto testmore
23753 26456  
23753 26456  e.                     ; end of header and data transmitted
23754 26456  \f


23754 26456  ; fpa-subproc          standard types
23755 26456  ; eli, 15.1.1976
23756 26456  
23756 26456  ; after header received
23757 26456  ;
23758 26456  ; a header has been received.
23759 26456  ; for this kind of subprocs (with no special actions) it can
23760 26456  ; only specify the functions <answer input with data> or
23761 26456  ; <answer message with data>.
23762 26456  ;
23763 26456  ; upon entry:
23764 26456  ; w0
23765 26456  ; w1     subproc
23766 26456  ; w2
23767 26456  ; w3 
23768 26456  
23768 26456  b. i10, j10
23769 26456  w.
23770 26456  
23770 26456  q3:  jl. w3  u50.      ; after header received: test answer header
23771 26458       jl.     u2.       ;  goto testmore
23772 26460  
23772 26460  e.                     ; end of after header received
23773 26460  \f


23773 26460  ; fpa-subproc          standard types
23774 26460  ; eli, 15.1.1976
23775 26460  
23775 26460  ; after data received
23776 26460  ;
23777 26460  ; check transmission.
23778 26460  ;
23779 26460  ; upon entry:
23780 26460  ; w0
23781 26460  ; w1     subproc
23782 26460  ; w2
23783 26460  ; w3
23784 26460  
23784 26460  b. i10, j10
23785 26460  w.
23786 26460  
23786 26460  q4:  jl. w3  u60.      ; after data received: test data received
23787 26462       jl.     u2.       ;  goto testmore
23788 26464  
23788 26464  ; attention. no special action
23789 26464  
23789 26464       jl.     u2.       ;  goto testmore
23790 26466  
23790 26466  e.                     ; end of data received
23791 26466  \f


23791 26466  ; fpa-subproc          standard types
23792 26466  ; eli, 16.12.1975
23793 26466  
23793 26466  ; after create
23794 26466  ;
23795 26466  ; the subproc has just been created.
23796 26466  ; no special action
23797 26466  ;
23798 26466  ; upon entry:
23799 26466  ; w0
23800 26466  ; w1     subproc
23801 26466  ; w2
23802 26466  ; w3
23803 26466  
23803 26466  b. i10, j10
23804 26466  w.
23805 26466  
23805 26466  q5:                    ; after create:
23806 26466       jl      (b101)    ;  goto return
23807 26468  
23807 26468  e.                     ; end of after create
23808 26468  
23808 26468  e.                     ; end of standard types
23809 26468  \f


23809 26468  ; fpa-subproc          terminals
23810 26468  ; eli, 20.1.1976
23811 26468  
23811 26468  c.(:a80>12a.1:)-1      ; if terminal bit then include:
23812 26468  
23812 26468  b. q20, s20
23813 26468  w.
23814 26468  
23814 26468  ; this code takes care of special actions (such as <to>, <from>,
23815 26468  ; <attention> etc.) needed for terminals connected as subprocesses.
23816 26468  
23816 26468  m.
23816 26468                  terminal link

23817 26468  
23817 26468  ; entry point table:
23818 26468  
23818 26468  h108:      q0        ; after send message
23819 26470             q1        ; before header transmit
23820 26472             q2        ; after header transmit
23821 26474             q3        ; before data receive
23822 26476             q4        ; after data receive
23823 26478             q5        ; after create
23824 26480  
23824 26480  ; definition of local part of subproc
23825 26480  
23825 26480  b. j0
23826 26480  w.
23827 26480  
23827 26480  s0=p0                ; start of local area
23828 26480  j0=s0                ; save start
23829 26480  
23829 26480  s5= s0               ; <special actions mask> (1 byte)
23830 26480  s6= s0+1, s0=s0+2    ; <special action selected> (1 byte)
23831 26480  s7= a71 , s0=s0+2    ; att buffer adr. (fixed position)
23832 26480                       ; (used by driverproc when answer arrives)
23833 26480  
23833 26480  s1= s0               ; <1st word of user name>
23834 26480  s2= s0+2             ; <2nd   -   -   -    -<
23835 26480  s3= s0+4             ; <3rd   -   -   -    - >
23836 26480  s4= s0+6, s0=s0+8    ; <4th   -   -   -    - >
23837 26480  
23837 26480  ; test for size of private part not exceeded
23838 26480  
23838 26480  c. (:s0-j0-v1-1:)    ; v1= max size allowed for private part
23839 26480       m.  fpa terminal: private part too long
23840 26480  z.
23841 26480  e.                   ; end of definition of private part
23842 26480  
23842 26480  ; maskbits in <special actions mask>
23843 26480  
23843 26480  s10= 2.0001          ; output <:att:>
23844 26480  s11= 2.0010          ; input name
23845 26480  s12= 2.0100          ; output <:unknown:>
23846 26480  s13= 2.1000          ; output name
23847 26480  s14 =2.10000          ; initial state until first att-mess
23848 26480  \f


23848 26480  ; fpa-subproc          terminals
23849 26480  ; eli, 15.1.1976
23850 26480  
23850 26480  ; after send message
23851 26480  ;
23852 26480  ; a new message has been received.
23853 26480  ; check accessrights and (if ok) link the message into the queue
23854 26480  ; of pending messages. if subproc is not busy, then link subproc
23855 26480  ; in queue of mainproc for later activation.
23856 26480  ;
23857 26480  ; upon entry:
23858 26480  ; w0
23859 26480  ; w1     subproc
23860 26480  ; w2
23861 26480  ; w3
23862 26480  
23862 26480  b. i10, j10
23863 26480  w.
23864 26480  
23864 26480  q0:                    ; after send message:
23865 26480       jl. w3  u4.       ;  check and link operation
23866 26482       jl.     u2.       ;  goto testmore
23867 26484  
23867 26484  e.                     ; end of after send message
23868 26484  \f


23868 26484  ; fpa-subproc          terminals
23869 26484  ; eli, 15.1.1976
23870 26484  
23870 26484  ; before header
23871 26484  ;
23872 26484  ; the subproc has been activated by mainproc for transmission
23873 26484  ; of a header and maybe an associated datablock
23874 26484  ;
23875 26484  ; first pending special actions such as <answer attention>,
23876 26484  ; output of user name etc. will be processed.
23877 26484  ;
23878 26484  ; then the messagequeue of the subproc is examined for a pending
23879 26484  ; message and if none is found return is made to mainproc with a
23880 26484  ; <no block>-status
23881 26484  ;
23882 26484  ; if an input- or output message is found the name of the sending
23883 26484  ; process is output first, if it is different from <user name>,
23884 26484  ; i.e. the name of the last sending process.
23885 26484  ;
23886 26484  ; otherwise standard transmission of the message is initiated.
23887 26484  ;
23888 26484  ; upon entry:
23889 26484  ; w0
23890 26484  ; w1     subproc
23891 26484  ; w2
23892 26484  ; w3
23893 26484  
23893 26484  b. i30, j20
23894 26484  w.
23895 26484  
23895 26484  q1:                    ; before header:
23896 26484       jl. w3  u20.      ;  test answer attention
23897 26486  
23897 26486  ; no answer attention pending.
23898 26486  ; test for pending special actions
23899 26486  
23899 26486       bz  w0  x1+s5     ;  if special actions mask(subproc)<>0 then
23900 26488       sz  w0  s10+s11+s12+s13;
23901 26490       jl.     q10.      ;  goto find special action
23902 26492  
23902 26492       jl. w3  u12.      ;  mes:= find first message
23903 26494       sn  w2  0         ;  if mes=0 then
23904 26496       jl.     u3.       ;   goto no block
23905 26498  
23905 26498  ; message found. test for input or output
23906 26498  
23906 26498       bz  w0  x2+8      ;  oper:= operation(mes)
23907 26500       se  w0  3         ;  if oper=input or output then
23908 26502       sn  w0  5         ;
23909 26504       jl.     i1.       ;
23910 26506       jl.     i4.       ;  begin
23911 26508  
23911 26508  ; test username
23912 26508  
23912 26508  i1:  rs. w0  j0.       ;   save operation
23913 26510       rl  w2  x2+6      ;   if name(sender(mes))<>user name(subproc) then
23914 26512       dl  w0  x2+a11+2  ;
23915 26514       sn  w3  (x1+s1)   ;
23916 26516       se  w0  (x1+s2)   ;
23917 26518       jl.     i2.       ;
23918 26520       dl  w0  x2+a11+6  ;
23919 26522       sn  w3  (x1+s3)   ;
23920 26524       se  w0  (x1+s4)   ;
23921 26526       jl.     i3.       ;
23922 26528       jl.     i4.       ;   begin
23923 26530  i2:  ds  w0  x1+s2     ;    user name(subproc):= name(sender(mes))
23924 26532       dl  w0  x2+a11+6  ;
23925 26534  i3:  ds  w0  x1+s4     ;
23926 26536  
23926 26536  ; the text <:to:> or <:from:> followed by the name of the
23927 26536  ; sender should be output before the message itself
23928 26536  
23928 26536       al  w0  s13       ;    special action(subproc):= output name
23929 26538       hs  w0  x1+s5     ;
23930 26540       al  w0  v72       ;    special messages(state(subproc)):= true
23931 26542       lo  w0  x1+p12    ;
23932 26544       rs  w0  x1+p12    ;
23933 26546       rl. w0  j0.       ;    goto if saved operation=output then
23934 26548       se  w0  3         ;         output(FROM) else
23935 26550       am      i17       ;         output(to)
23936 26552       jl.     i14.      ;   end name<>user
23937 26554                         ;  end input or output
23938 26554  
23938 26554  ; prepare normal message and (maybe) datablock
23939 26554  
23939 26554  i4:  rl  w2  b18       ;  mes:= current message(monitor)
23940 26556       jl. w3  u30.      ;  prepare transfer
23941 26558       jl      (b101)    ;  goto mainproc return
23942 26560  
23942 26560  j0:  0                 ;  saved operation
23943 26562  
23943 26562  ; the following table is used to select special actions
23944 26562  ;
23945 26562  ;  - the first byte holds a bit to be tested against the <special
23946 26562  ;    actions mask>
23947 26562  ;  - the second byte holds the relative address of the action (relative to i10)
23948 26562  ;     of the action to be performed if the bit is set
23949 26562  ;
23950 26562  ; note, that the ordering of the entries is important. it describes
23951 26562  ;       (as an example) that the text <:att:> should be otuput
23952 26562  ;       before the name is read in
23953 26562  
23953 26562  i10: h.
23954 26562               s12, i16. ; unknown
23955 26564               s10, i13. ; attention
23956 26566               s11, i19. ; input name
23957 26568               s13, i18. ; output name
23958 26570       w.
23959 26570  
23959 26570  q10:                   ; find special action:
23960 26570       al. w3  i10.      ;  w0 holds special actions mask
23961 26572       jl.     i12.      ;
23962 26574  i11: al  w3  x3+2      ;  find entry with bit set in special actions mask
23963 26576  i12: bz  w2  x3        ;
23964 26578       so  w0  x2        ;
23965 26580       jl.     i11.      ;
23966 26582  
23966 26582  ; w3 points to entry
23967 26582  
23967 26582       hs  w2  x1+s6     ;  save action selected
23968 26584       ba  w3  x3+1      ;
23969 26586       jl      x3+1      ;  goto action
23970 26588  
23970 26588  ; table of special texts
23971 26588  ; first word holds length of following text in 8-bit characters
23972 26588  
23972 26588  j16: i20, <:<10>att<32>:>,     i20=(:k-j16-2:)/2*3
23973 26594  j17: i21, <:<10>to<32>:>,      i21=(:k-j17-2:)/2*3
23974 26600  j18: i22, <:<10>from<32>:>,    i22=(:k-j18-2:)/2*3
23975 26606  j19: i23, <:unknown<10>:>,     i23=(:k-j19-2:)/2*3
23976 26614  
23976 26614  i13: am      j16-j17   ; text:= att     or
23977 26616  i14: am      j17-j18   ;        to      or
23978 26618  i15: am      j18-j19   ;        from    or
23979 26620  i16: al. w2  j19.      ;        unknown
23980 26622  i17=i15-i14
23981 26622  
23981 26622  ; w2 points in table above
23982 26622  
23982 26622       rl  w3  x1+a50    ;  main:= mainproc(subproc)
23983 26624  c. p103-1
23984 26624       al  w0  2         ; addresscode(main):= driver area
23985 26626       hs  w0  x3+p72    ;
23986 26628  z.
23987 26628       al  w0  x2+2      ;  first(main):= first(text)
23988 26630       rs  w0  x3+p65    ;
23989 26632       rl  w0  x2        ;  data size(main):= header size(main):=
23990 26634       rs  w0  x3+p66    ;  size(text)
23991 26636       rs  w0  x3+p64    ;
23992 26638       al  w0  v52+(:1<0:); function(main):= output+databit
23993 26640       hs  w0  x3+p61    ;
23994 26642       la  w0  g50       ;  store even function in messagetable
23995 26644  
23995 26644  ; set rest
23996 26644  ; 
23997 26644  ; initiate standard parameters in mainproc
23998 26644  ;
23999 26644  ; upon entry:
24000 26644  ; w0     value to store in message table(subproc, bufno)
24001 26644  ; w1     subproc
24002 26644  ; w2
24003 26644  ; w3
24004 26644  
24004 26644  q11: jl. w3  u9.       ; set rest: message table(subproc,bufno):= w0
24005 26646       rs  w0  x2        ;
24006 26648       al  w0  -1        ;  decrease(free buffers(subproc))
24007 26650       ba  w0  x1+p16    ;
24008 26652       hs  w0  x1+p16    ;
24009 26654       jl. w3  u25.      ;  set linkparams
24010 26656  
24010 26656       jl      (b101)    ;  goto mainproc return
24011 26658  
24011 26658  ; initiate output of user name
24012 26658  ;
24013 26658  ; note: during transmission a newline character (value=10) is
24014 26658  ;       inserted as the 12th character in the user name.
24015 26658  ;       it is removed again after transmission.
24016 26658  
24016 26658  i18: al  w0  10        ;  last character(user name(subproc)):= 10
24017 26660       lo  w0  x1+s4     ;
24018 26662       rs  w0  x1+s4     ;
24019 26664  c. p103-1
24020 26664       rl  w3  x1+a50    ; main:= main(subproc)
24021 26666       al  w0  8         ; addresscode(main):= dirty
24022 26668       hs  w0  x3+p72    ;
24023 26670       al  w0  0         ; messagebuf(main):= 0  (no buf.)
24024 26672       rs  w0  x3+p71    ;
24025 26674  z.
24026 26674       al  w0  v52+(:1<0:); function:= output+databit
24027 26676       jl.     i5.       ;
24028 26678  
24028 26678  ; initiate input of user name
24029 26678  
24029 26678  i19: al  w0  v70       ;  blocked(subproc):= true
24030 26680       lo  w0  x1+p12    ;
24031 26682       rs  w0  x1+p12    ;
24032 26684       al  w0  v50       ;  function:= input
24033 26686  i5:                    ;
24034 26686       rl  w3  x1+a50    ;  main:= mainproc(subproc)
24035 26688       hs  w0  x3+p61    ;  function(main):= function selected
24036 26690       al  w2  8/2*3     ;  size:= size of user name
24037 26692       rs  w2  x3+p64    ;  header size(main):= size
24038 26694       so  w0  2.1       ;  if even(function) then size:= 0
24039 26696       al  w2  0         ;
24040 26698       rs  w2  x3+p66    ;  data size(main):= size
24041 26700       al  w0  x1+s1     ;  first(main):= first of user name(subproc)
24042 26702       rs  w0  x3+p65    ;
24043 26704  
24043 26704  ; store function selected in message table as special flag
24044 26704  
24044 26704       bz  w0  x3+p61    ;  w0:= even function(main)
24045 26706       la  w0  g50       ;
24046 26708       jl.     q11.      ;  goto set rest
24047 26710  
24047 26710  e.                     ; end of before header
24048 26710  \f


24048 26710  ; fpa-subproc          terminals
24049 26710  ; eli, 16.1.1976
24050 26710  
24050 26710  ; after header and data transmitted
24051 26710  ;
24052 26710  ; a header and maybe a datablock has been transmitted
24053 26710  ;
24054 26710  ; if the <special action selected>-flag is nonzero it is used
24055 26710  ; to clear a bit in the <special actions mask>. if this thereby
24056 26710  ; becomes zero the <special messages> flag in the state-field of
24057 26710  ; the subproc is cleared
24058 26710  ;
24059 26710  ; upon entry:
24060 26710  ; w0  
24061 26710  ; w1     subproc
24062 26710  ; w2
24063 26710  ; w3
24064 26710  
24064 26710  b. i10, j10
24065 26710  w.
24066 26710  
24066 26710  q2:                    ; after header:
24067 26710       jl. w3  u40.      ;  test header and data transmitted
24068 26712       jl.     u2.       ; error: goto testmore
24069 26714       al  w3  -1        ;
24070 26716       bs  w3  x1+s6     ;  if special action selected(subproc)=0 or
24071 26718       am      (x1+a50)  ;    transmission state(mainproc)<>0 then
24072 26720       bz  w0  +p60      ;
24073 26722       se  w3  -1        ;
24074 26724       se  w0  0         ;
24075 26726       jl.     u2.       ;  goto testmore
24076 26728       bz  w0  x1+s5     ;  remove bit in special actions mask(subproc)
24077 26730       la  w0  6         ;
24078 26732       hs  w0  x1+s5     ;
24079 26734       al  w3  0         ;  special action selected(subproc):= 0
24080 26736       hs  w3  x1+s6     ;
24081 26738       al  w2  (:-1:)<8  ;  last char(username(subproc)):= 0
24082 26740       la  w2  x1+s4     ;
24083 26742       rs  w2  x1+s4     ;
24084 26744       se  w0  0         ;  if special actions mask(subproc)<>0 then
24085 26746       jl.     u2.       ;  goto testmore
24086 26748       al  w0  -1-v72    ;  remove special message flag
24087 26750       la  w0  x1+p12    ;
24088 26752       rs  w0  x1+p12    ;
24089 26754       jl.     u2.       ;  goto testmore
24090 26756  
24090 26756  e.                     ; end of after header
24091 26756  \f


24091 26756  ; fpa-subproc          terminals
24092 26756  ; eli, 15.1.1976
24093 26756  
24093 26756  ; before data receive
24094 26756  ;
24095 26756  ; activated, when a header which will be followed by a datablock has been
24096 26756  ; received
24097 26756  ;
24098 26756  ; upon entry:
24099 26756  ; w0
24100 26756  ; w1     subproc
24101 26756  ; w2
24102 26756  ; w3
24103 26756  
24103 26756  b. i10, j10
24104 26756  w.
24105 26756  
24105 26756  q3:                    ; before data receive:
24106 26756       jl. w3  u50.      ;  test answer header
24107 26758  
24107 26758  ; return to <link>: normal function
24108 26758  ;  return will only be made if the datablock could not be 
24109 26758  ;  received (sender stopped etc.)
24110 26758  
24110 26758       jl.     u2.       ;  goto testmore
24111 26760  
24111 26760  ; return to <link+2>: special function
24112 26760  ;  can only be input of attention name
24113 26760  ; note: if only a single character has been received and result and
24114 26760  ;       status is ok (=0) then a newline character must have been
24115 26760  ;       typed alone. in that case the datablock is skipped
24116 26760  ;       and the current name used.
24117 26760  
24117 26760       rl  w3  x1+a50    ;  main:= mainproc(subproc)
24118 26762       al  w0  8         ;  address code(main):= dirty
24119 26764       hs  w0  x3+p92    ;
24120 26766  c. p103-1
24121 26766       al  w0  0         ; messagebuf(main):= 0  (no buf)
24122 26768       rs  w0  x3+p91    ;
24123 26770  z.
24124 26770       al  w0  x1+s1     ;  first(main):= first of user name(subproc)
24125 26772       rs  w0  x3+p85    ;
24126 26774       rl  w0  x3+p84    ;  size8:=
24127 26776       rs  w0  x3+p86    ;  data size(main):= header size(main)
24128 26778       bl  w2  x3+p82    ;  if size8<>1 or
24129 26780       ba  w2  x3+p83+1  ;
24130 26782       sn  w0  1         ;     result(main)<>0 or status(main,0:11)<>0 then
24131 26784       se  w2  0         ;  
24132 26786       jl      (b101)    ;  goto mainproc return
24133 26788       al  w0  p162      ;  skip(main):= true
24134 26790       hs  w0  x3+p80    ; 
24135 26792       jl. w3  u11.      ;  clear message entry
24136 26794       al  w0  -1-v70    ; 
24137 26796       la  w0  x1+p12    ;  blocked(subproc):= false
24138 26798       rs  w0  x1+p12    ;
24139 26800       jl.     q15.      ;  goto attention name ready
24140 26802  
24140 26802  e.                     ; end of before data
24141 26802  \f


24141 26802  ; fpa-subproc          terminals
24142 26802  ; eli, 15.1.1976
24143 26802  
24143 26802  ; after data received
24144 26802  ;
24145 26802  ; activated, when a header without data or a datablock following a
24146 26802  ; header has been received
24147 26802  ;
24148 26802  ; upon entry:
24149 26802  ; w0
24150 26802  ; w1     subproc
24151 26802  ; w2
24152 26802  ; w3
24153 26802  
24153 26802  b. i10, j10
24154 26802  w.
24155 26802  
24155 26802  q4:                    ; after data received:
24156 26802       jl. w3  u60.      ;  test data received
24157 26804  
24157 26804  ; return to <link>: normal function
24158 26804  
24158 26804       jl.     u2.       ;  goto testmore
24159 26806  
24159 26806  ; return to <link+2>: attention
24160 26806  
24160 26806       jl.     q12.      ;  goto attention received
24161 26808  
24161 26808  ; return to <link+4>: special function received
24162 26808  ; a special text (unknown, to, from, att) has been output or
24163 26808  ; an attention name has been read in.
24164 26808  
24164 26808       sn  w2  v50       ;  goto if message entry(bufno)=input then
24165 26810       jl.     q13.      ;    attention name received else
24166 26812       jl.     u2.       ;    testmore
24167 26814  
24167 26814  e.                     ; end of after data received
24168 26814  \f


24168 26814  ; fpa-subproc          terminals
24169 26814  ; eli, 15.1.1976
24170 26814  
24170 26814  ; attention received
24171 26814  ;
24172 26814  ; an attention message has been received.
24173 26814  ; check reserverstatus of subproc and, if not reserved initiate
24174 26814  ; input of name.
24175 26814  ;
24176 26814  
24176 26814  b. i10, j10
24177 26814  w.
24178 26814  
24178 26814  q12:                   ; attention:
24179 26814       rl  w0  x1+a52    ;  if reserved(subproc)<>0 then
24180 26816       sn  w0  0         ;  begin comment: find reserver
24181 26818       jl.     i2.       ;
24182 26820       rl  w2  x1+a71    ;
24183 26822       se  w2     0      ;    if att mess pedling then
24184 26824       jl.        u2.    ;    return
24185 26826       rl  w3  b6        ;   entry:= first internal in name table
24186 26828       jl.     i1.       ;
24187 26830  i0:  al  w3  x3+2      ;   while idbit(proc(entry))<>reserver(subproc) do
24188 26832  i1:  rl  w2  x3        ;   entry:= entry+2
24189 26834       se  w0  (x2+a14)  ;
24190 26836       jl.     i0.       ;
24191 26838       jl.     q14.      ;   goto process found
24192 26840                         ;  end reserved<>0
24193 26840  
24193 26840  ; prepare subproc to print text <:att:> and read in name
24194 26840  
24194 26840  i2:  al  w0  s10+s11   ;  special actions mask(subproc):= output(att),
24195 26842       hs  w0  x1+s5     ;    input(name)
24196 26844       al  w0  v72       ;  special messages(subproc):= true
24197 26846       lo  w0  x1+p12    ;
24198 26848       rs  w0  x1+p12    ;
24199 26850       jl.     u2.       ;  goto testmore
24200 26852  
24200 26852  e.                     ; end of attention received
24201 26852  \f


24201 26852  ; fpa-subproc          terminals
24202 26852  ; eli, 22.1.1976
24203 26852  
24203 26852  ; attention name received
24204 26852  ;
24205 26852  ; any error status cause the text <:unknown:> to be output
24206 26852  ;
24207 26852  ; otherwise the terminating newline is removed and the
24208 26852  ; name searched for
24209 26852  
24209 26852  b. i10, j10
24210 26852  w.
24211 26852  
24211 26852  q13:                   ; attention name:
24212 26852       rl  w3  x1+a50    ;  main:= mainproc(subproc)
24213 26854       bl  w2  x3+p82    ;
24214 26856       ba  w2  x3+p83+1  ;
24215 26858       se  w2  0         ;  if status(main, 0:11)=result(main)=0 then
24216 26860       jl.     i0.       ;  begin
24217 26862       rl  w3  x3+p84    ;   if size(main)=0 then
24218 26864       sn  w3  0         ;   goto testmore
24219 26866       jl.     u2.       ;   mask of last received character with value=10
24220 26868       al  w3  x3-1      ;
24221 26870       wd. w3  j1.       ;   note: w2 already zero
24222 26872       ls  w3  1         ;   index:= (size-1)//3*2
24223 26874       ls  w2  3         ;   position:= -((size-1) mod 3*8)
24224 26876       ac  w2  x2        ;
24225 26878       rl. w0  j0.       ;   mask:= newline shift position
24226 26880       as  w0  x2        ;
24227 26882       am      x3        ;   address:= first of user name(subproc)+index
24228 26884       al  w3  x1+s1     ;
24229 26886       la  w0  x3        ;
24230 26888  i1:  rs  w0  x3        ;
24231 26890       al  w0  0         ;   rest of user name(subproc):= 0
24232 26892       al  w3  x3+2      ;
24233 26894       sh  w3  x1+s4     ;
24234 26896       jl.     i1.       ;
24235 26898  
24235 26898  ; now a terminating newline has been replaced by a zero
24236 26898  ;  search for process
24237 26898  
24237 26898  q15:                   ; attention name ready:
24238 26898       al  w2  x1+s1     ;   search name(user,entry,interval(subproc))
24239 26900       dl  w1  x1+a49    ;
24240 26902       jl  w3  d71       ;
24241 26904       rl  w1  b19       ;
24242 26906       sn  w3  (b7)      ;   if entry= name table end then goto unknown
24243 26908       jl.     i0.       ;
24244 26910       rl  w2  x3        ;   if kind(entry)<>internal or pseudoproc then
24245 26912       rl  w0  x2+a10    ;   goto unknown
24246 26914       se  w0  64        ;   goto process found
24247 26916       sn  w0  0         ;
24248 26918       jl.     q14.      ;  end
24249 26920  
24249 26920  ; prepare subproc to output the text <:unknown:>
24250 26920  
24250 26920  i0:  al  w0  s12       ;  special actions mask(subproc):= output(unknown)
24251 26922       hs  w0  x1+s5     ;
24252 26924       al  w0  v72       ;  special messages(subprocstate):= true
24253 26926       lo  w0  x1+p12    ;
24254 26928       rs  w0  x1+p12    ;
24255 26930  ; remove procfunc as user of the subprocess. it was included as user when the
24256 26930  ; (temp) link was created to prevent removel of a partly created link.
24257 26930  ; (If the subproc is perm procfunc has already been removed - but one more 
24258 26930  ;   remove  doesn't matter).
24259 26930  
24259 26930       al  w2  x1        ;  proc := subproess;
24260 26932       rl  w1 (b6)       ;  internal := procfunc;
24261 26934       jl  w3  d123      ;  remove user(internal,proc);
24262 26936       jl.     u2.       ;  goto testmore
24263 26938  
24263 26938  j0:  (:-1-10:)<16      ;  mask to remove newline
24264 26940  j1:  3                 ;  division constant
24265 26942  
24265 26942  e.                     ; end of attention name
24266 26942  \f


24266 26942  ; fpa-subproc          terminals
24267 26942  ; eli, 15.1.1976
24268 26942  
24268 26942  ; process found
24269 26942  ;
24270 26942  ; clear message queue and deliver attention message
24271 26942  ;
24272 26942  ; upon entry:
24273 26942  ; w0
24274 26942  ; w1     subproc
24275 26942  ; w2  receiver of att-mess
24276 26942  ; w3
24277 26942  
24277 26942  b. i10, j10
24278 26942  w.
24279 26942  
24279 26942  q14:                   ; process found:
24280 26942       rs. w2  j1.       ; save  receiver
24281 26944       al  w2  0         ; if att bufer pending then
24282 26946       rx  w2  x1+a71    ;
24283 26948       se  w2  0         ;
24284 26950       jl  w3  d75       ; regret message
24285 26952       rs. w1  j2.       ; save subproc
24286 26954       rl. w1   j1.      ; if receiver.att := pseudo proc then
24287 26956       rl  w0  x1+a10    ; 
24288 26958       se  w0  0         ; internal := main.pseudoproc
24289 26960       rl  w1  x1+a50    ;
24290 26962       am.     (j2.)     ; external :=subhost.sub
24291 26964       rl  w2  +a50      ; if internal user of subhost then 
24292 26966       al  w2  x2+p202   ;
24293 26968       jl  w3  d102      ;  include internal as user of sub
24294 26970       jl.     i2.       ;+0 not user
24295 26972       rl. w2  j2.       ;+2 user
24296 26974       jl  w3  d126      ;
24297 26976  ; remove procfunc as user. it was included as user when the subproc was
24298 26976  ; created to prevent removel of a partly created subprocess.
24299 26976  
24299 26976  i1:
24300 26976       rl  w1 (b6)       ;  internal := procfunc;
24301 26978       jl  w3  d123      ;  remove user(internal, subproc);
24302 26980  i2:  rl. w1  j2.       ;
24303 26982       zl  w0  x1+s5     ; if initial create then
24304 26984       la. w0  j4.       ; begin
24305 26986       ls  w0  -4        ;    attflag.init := true
24306 26988       zl  w2  x1+s5     ;    sub.special_action.init := false
24307 26990       sz  w2  s14       ; end;
24308 26992       lx. w2  j4.       ;
24309 26994       hs  w2  x1+s5     ;
24310 26996       am     (x1+a50)   ; attflag.i-o := attoperation.status.att_bit
24311 26998       rl  w2    +p83    ;
24312 27000       la. w2     j5.    ;  
24313 27002       ls  w2    -2      ;
24314 27004       lo  w0    +4      ;
24315 27006       rs. w0    j3.     ;
24316 27008       rl. w3  j0.       ;
24317 27010       al  w0  0         ;   attention message
24318 27012       ds  w0  g21       ;    +0  :  0
24319 27014       al  w3  0         ;    +2  : status
24320 27016       ds  w0  g23       ;    +4  : 0
24321 27018       jl.     i4.       ;  for mes:= first pending(subproc) while mes<>0 do
24322 27020  i3:  jl  w3  g18       ;  deliver result(1,mes,intervention)
24323 27022  i4:  jl. w3  u22.      ;
24324 27024       sn  w2  0         ;
24325 27026       jl.     i5.       ;
24326 27028       zl  w0  x2+a150   ; if mess.operation = i-o then
24327 27030       so  w0     2.1    ;    set att_i-o flag.
24328 27032       jl.        i3.    ;
24329 27034       rl. w0     j3.    ;
24330 27036       lo. w0     j6.    ;
24331 27038       rs. w0     j3.    ;
24332 27040       jl.        i3.    ;
24333 27042  
24333 27042  ; deliver the att-message
24334 27042  
24334 27042  i5:  al  w2  x1        ;  
24335 27044       al  w3     0      ;  att.mess0 := 0;
24336 27046       al  w1     g20    ;  att.mess1 := status;
24337 27048       rl. w0     j3.    ;
24338 27050       ds  w0     g21    ;
24339 27052       rs  w2     g22    ; att.mess2 := pd.terminal
24340 27054       dl  w0  x2+a11+2  ; att.mess3-mess6 := name of terminal
24341 27056       ds  w0     g23+2  ;
24342 27058       dl  w0  x2+a11+6  ;
24343 27060       ds  w0     g23+6  ;
24344 27062  
24344 27062       rl. w3  j1.       ;  w3:=  receiver
24345 27064       jd      1<11+17   ;  send message(w2=sender, w3= rec.)
24346 27066       rl. w1  j2.       ;  <*get subproc*>
24347 27068       rs  w2  x1+a71    ; save att buffer;
24348 27070  
24348 27070  ; end of attention
24349 27070  
24349 27070       jl.     u2.       ;  goto testmore
24350 27072  
24350 27072  j0:  1<16              ;  attention status
24351 27074  j1:  0                 ;  saved message or process
24352 27076  j2: 0
24353 27078  j3 : 0                 ; status for att-message
24354 27080  j4 : s14               ; special action mask : initial state
24355 27082  j5 : 8.020             ; status mask : att_bit
24356 27084  j6 : 1<2               ; att status  : i-o
24357 27086  
24357 27086  e.                     ; end of process found
24358 27086  \f


24358 27086  ; fpa-subproc          terminals
24359 27086  ; eli, 16.12.1975
24360 27086  
24360 27086  ; after create
24361 27086  ;
24362 27086  ; the subproc has just been created.
24363 27086  ;
24364 27086  ; upon entry:
24365 27086  ; w0
24366 27086  ; w1     subproc
24367 27086  ; w2
24368 27086  ; w3
24369 27086  
24369 27086  b. i10, j10
24370 27086  w.
24371 27086  
24371 27086  q5:                    ; after create:
24372 27086       al  w0  0         ;  user name(subproc,0):= 0
24373 27088       rs  w0  x1+s1     ;  action selected(subproc):=
24374 27090       al  w0  s14       ;  action mask(subproc) := initial
24375 27092       ls  w0  12        ;
24376 27094       rs  w0  x1+s6     ; 
24377 27096       rl  w0  x1+a10    ; 
24378 27098       se  w0     85     ;  if temp link then 
24379 27100       jl.        j2.    ;  begin
24380 27102       al  w2  x1        ;
24381 27104       rl  w3    (b3)    ;   
24382 27106       al  w0  x3+a54    ;         message:= remoter.eventq.first;
24383 27108       rl  w3  x3+a54    ;         while message <> none do
24384 27110       rs. w0     i3.    ;         begin
24385 27112  j3:  rs. w3     i2.    ;
24386 27114       sn. w3    (i3.)   ;
24387 27116       jl.        j2.    ;
24388 27118       zl  w0  x3+a150   ;           if message.operation = wait for connect then
24389 27120       se  w0     2      ;           begin
24390 27122       jl.        j1.    ;
24391 27124       zl  w0  x3+a150+1 ;             if (message.mode = all connections) or
24392 27126       so  w0     2.1    ;                (message.mode = specific main and
24393 27128       jl.        j4.    ;                 message.mainaddress = this main) then
24394 27130       rl  w0  x3+a151   ;             begin
24395 27132       se  w0 (x2+a50)   ;
24396 27134       jl.        j1.    ;
24397 27136  j4:  rl  w1  x3+a142   ;               sender:= message.sender;
24398 27138       rl  w0  x1+a10    ;               if sender.kind<>internal then
24399 27140       se  w0     0      ;                  sender:=sender.main; <*pseudo proc*>
24400 27142       rl  w1  x1+a50    ;
24401 27144       jl  w3     d125   ;               include reserver(sender,proc);
24402 27146       jl.        j2.    ;           end;
24403 27148  j1:  rl. w3     i2.    ;
24404 27150       rl  w3  x3+a140   ;           message:=message.next;
24405 27152       jl.        j3.    ;         end;
24406 27154  j2:  jl        (b101)  ; done: end;
24407 27156  
24407 27156  i2:  0                 ; message
24408 27158  i3:  0                 ; mess queue head
24409 27160       jl      (b101)    ;  goto return
24410 27162  
24410 27162  e.                     ; end of after create
24411 27162  
24411 27162  e.                     ; end of terminals
24412 27162  
24412 27162  z.                     ;
24413 27162  
24413 27162  h108=h100
24414 27162  \f


24414 27162  
24414 27162  ; fpa-subproc          magnetic tape
24415 27162  ; eli, 4.11.1975
24416 27162  
24416 27162  c.(:a80>13a.1:)-1      ; if magtape bit then include:
24417 27162  
24417 27162  b. q20, s10
24418 27162  w.
24419 27162  
24419 27162  ; this code takes care of special actions for magnetic tapes,
24420 27162  ; connected to rc4000 through a devicecontroler
24421 27162  
24421 27162  m.
24421 27162                  magnetic tape link

24422 27162  
24422 27162  ; entry point table:
24423 27162  
24423 27162  h118:      q0        ; after send message
24424 27164             q1        ; before header transmit
24425 27166             q2        ; after header  transmit
24426 27168             q3        ; after header received
24427 27170             q4        ; after data received
24428 27172             q5        ; after create
24429 27174  
24429 27174  ; definition of local part of subproc
24430 27174  
24430 27174  b. j0
24431 27174  w.
24432 27174  
24432 27174  s0=p0                ;  start of local area
24433 27174  j0=s0                ;  save start
24434 27174  
24434 27174  s1= s0,   s0=s0+2    ;  <state>
24435 27174  s2= s0,   s0=s0+2    ;  <file count>
24436 27174  s3= s0,   s0=s0+2    ;  <block count>
24437 27174  s5= s0,   s0=s0+2    ;   <last status>
24438 27174            s0=s0+2    ;  one unused word
24439 27174  s4= s0,   s0=s0+2    ;  <remoter proc>
24440 27174  
24440 27174  ; test for size of private part not exceeded
24441 27174  
24441 27174  c.(:s0-j0-v1-1:)     ;  v1= max. size of private part
24442 27174       m. fpa magnetic tape: private part too long
24443 27174  z.
24444 27174  e.                   ; end of definition of local part
24445 27174  \f


24445 27174  ; fpa-subproc          magnetic tape
24446 27174  ; eli, 12.9.1975
24447 27174  
24447 27174  ; after send message
24448 27174  ;
24449 27174  ; a new message has been received.
24450 27174  ; check message and link it to queue of subproc.
24451 27174  ; if subproc is free, then link it to mainproc.
24452 27174  ;
24453 27174  ; upon entry:
24454 27174  ; w0     
24455 27174  ; w1     subproc
24456 27174  ; w2     
24457 27174  ; w3
24458 27174  
24458 27174  b. i10, j10
24459 27174  w.
24460 27174  
24460 27174  q0:  jl. w3  u4.       ; after send message: check and link operation
24461 27176       al  w0  0         ;  state(magnetic tape):= 0
24462 27178       rs  w0  x1+s1     ;
24463 27180       rl  w2  b18       ; 
24464 27182       bz  w0  x2+8      ;  oper:= operation(mes)
24465 27184       sn  w0  5         ;  if oper<>output then
24466 27186       jl.     i0.       ;  
24467 27188       jl.     u2.       ;  goto testmore
24468 27190  i0:  al  w3  1         ;  sizeminus1:=
24469 27192       wa  w3  x2+12     ;   last(mes)-first(mes)+1
24470 27194       ws  w3  x2+10     ;  if sizeminus1>=maxsize(subproc) then
24471 27196       sl  w3  (x1+p18)  ;
24472 27198       jl      g5        ;  goto result 3
24473 27200       jl.     u2.       ;  goto testmore
24474 27202  
24474 27202  e.                     ; end of after send message
24475 27202  \f


24475 27202  ; fpa-subproc          magnetic tape
24476 27202  ; eli, 15.1.1976
24477 27202  
24477 27202  ; before header
24478 27202  ;
24479 27202  ; examine the message-queue of the subproc for a pending message.
24480 27202  ; if none is found return to mainproc with <no block>-status.
24481 27202  ;
24482 27202  ; otherwise initialize the mainproc sender table for transmission
24483 27202  ; of a header and maybe a datablock.
24484 27202  ;
24485 27202  ; upon entry:
24486 27202  ; w0     
24487 27202  ; w1     subproc
24488 27202  ; w2
24489 27202  ; w3
24490 27202  
24490 27202  b. i10, j10
24491 27202  w.
24492 27202  
24492 27202  q1:                    ; before header:
24493 27202       jl. w3  u20.      ;  test answer attention
24494 27204       jl. w3  u12.      ;  mes:= find first message(subproc)
24495 27206       sn  w2  0         ;  if mes=0 then
24496 27208       jl.     u3.       ;   goto no block
24497 27210    al  w0  0         ;   current message(subproc) := 0;
24498 27212    rs  w0  x1+p13    ;
24499 27214       bz  w0  x2+8      ;
24500 27216       so  w0  2.1       ;   if odd operation then
24501 27218       jl.     j0.       ;     examine sender(mess);
24502 27220       jl  w3  g34       ;      stopped: goto stopped;
24503 27222       jl.     j1.       ;      ok:
24504 27224  
24504 27224  j0:  jl. w3  u30.      ;  prepare transfer
24505 27226  
24505 27226  ; the stop count of the sender will be increased at
24506 27226  ; this point for input messages, thus assuring that the sender has not been
24507 27226  ; stopped when the datablock arrives.
24508 27226  
24508 27226       bz  w0  x2+8      ;  if oper(mes)<>input then
24509 27228       se  w0  3         ;
24510 27230       jl      (b101)    ;  goto mainproc return
24511 27232       jl. w3  u21.      ;  test and increase stop count
24512 27234       jl.     u3.       ; stopped: goto no block
24513 27236       jl      (b101)    ; ok: goto mainproc return
24514 27238  j1:  rl  w0  x1+s5     ; stopped:
24515 27240       rs  w0  g20       ;     status(mess):=saved status(sub);
24516 27242       ld  w0  -100      ;
24517 27244       ds  w0  g22       ;      bytes, chars trf(mess):=0,0;
24518 27246       dl  w0  x1+s3     ;   file,block count(mess):=saved file, block count(sub);
24519 27248       ds  w0  g24       ;
24520 27250       jl  w3  g18       ;     deliver result1;
24521 27252       jl.     u3.       ;     goto no block;
24522 27254  
24522 27254  e.                     ; end of before header
24523 27254  \f


24523 27254  ; fpa-subproc          magnetic tape
24524 27254  ; eli, 15.1.1976
24525 27254  
24525 27254  ; after header transmitted
24526 27254  ;
24527 27254  ; a header and maybe a datablock has been transmitted.
24528 27254  ;
24529 27254  ; transmission is checked
24530 27254  ;
24531 27254  ; upon entry
24532 27254  ; w0    
24533 27254  ; w1     subproc
24534 27254  ; w2
24535 27254  ; w3
24536 27254  
24536 27254  b. i10, j10
24537 27254  w.
24538 27254  
24538 27254  q2:                    ; after header transmit:
24539 27254       jl. w3  u40.      ;  test header and data transmitted
24540 27256       jl.     u2.       ; error: goto testmore
24541 27258       jl.     u2.       ;  goto testmore
24542 27260  
24542 27260  e.                     ; end of header transmitted
24543 27260  \f


24543 27260  ; fpa-subproc          magnetic tape
24544 27260  ; eli, 15.1.1976
24545 27260  
24545 27260  ; after header received
24546 27260  ;
24547 27260  ; a header has been received.
24548 27260  ; the function of the header may be
24549 27260  ;
24550 27260  ;     <answer input with data> or <answer message with data>
24551 27260  ;
24552 27260  ; upon entry:
24553 27260  ; w0
24554 27260  ; w1     subproc
24555 27260  ; w2    
24556 27260  ; w3
24557 27260  
24557 27260  b. i10, j10
24558 27260  w.
24559 27260  q3:                    ; before data receive:
24560 27260       jl. w3  u50.      ;  test answer header
24561 27262       jl.     u2.       ;  goto testmore
24562 27264  
24562 27264  e.                     ; end of after header received
24563 27264  \f


24563 27264  ; fpa-subproc          magnetic tape
24564 27264  ; eli, 5.11.1975
24565 27264  
24565 27264  ; after data received
24566 27264  ;
24567 27264  ; a datablock following a header has been received.
24568 27264  ;
24569 27264  ; first adjust the position of the tape described in <file count>
24570 27264  ; and <block count>.
24571 27264  ;
24572 27264  ; then check transmission in standard way
24573 27264  ;
24574 27264  ; upon entry
24575 27264  ; w0
24576 27264  ; w1     subproc
24577 27264  ; w2
24578 27264  ; w3
24579 27264  
24579 27264  b. i10, j10
24580 27264  w.
24581 27264  
24581 27264  q4:  jl. w3  q10.      ; after data received: adjust position
24582 27266       jl. w3  u60.      ;  test data received
24583 27268       jl.     u2.       ;  goto testmore
24584 27270  
24584 27270  ; <link+2>: attention received
24585 27270  ; find remoterprocess, if any
24586 27270       jl. w3     q11.   ;   clear queue(state=2);
24587 27272       rl  w3    (b3)    ;
24588 27274       al  w0  x3+a54    ;   message:=remoter.eventq.first;
24589 27276       rl  w3  x3+a54    ;
24590 27278       rs. w0     j2.    ;
24591 27280  i1:  sn. w3    (j2.)   ;   while message<>none do
24592 27282       jl.        i4.    ;   begin
24593 27284       rl  w0  x3+a140   ;     next-message:=message.next;
24594 27286       rs. w0     j1.    ;
24595 27288       zl  w0  x3+a150   ;     if message.operation=wait for mt-online and
24596 27290       se  w0     0      ;      ((message.mode=specific main and
24597 27292       jl.        i3.    ;        message.main=proc.main) or
24598 27294       zl  w0  x3+a150+1 ;        message.mode=all main) then
24599 27296       so  w0     2.1    ;     begin
24600 27298       jl.        i2.    ;
24601 27300       rl  w0  x3+a151   ;
24602 27302       se  w0 (x1+a50)   ;
24603 27304       jl.        i3.    ;
24604 27306  i2:  rs  w3     b18    ;       message.status:=0;
24605 27308       al  w0     0      ;       message.mt-addr:=proc;
24606 27310       ds  w1     g21    ;       deliver result(1);
24607 27312       jl  w3     g18    ;
24608 27314  i3:  rl. w3     j1.    ;     end;
24609 27316       jl.        i1.    ;     message:=next-message;
24610 27318  i4:  jl.        u2.    ;   end;
24611 27320   
24611 27320  j1:  0                 ;   next-message
24612 27322  j2:  0                 ;   remoter eventq
24613 27324  
24613 27324  e.
24614 27324  \f


24614 27324  ; fpa-subproc          magnetic tape
24615 27324  ; eli, 5.11.1975
24616 27324  
24616 27324  ; after create
24617 27324  ;
24618 27324  ; the subproc has just been created.
24619 27324  ; no special actions needed
24620 27324  ;
24621 27324  ; upon entry
24622 27324  ; w0
24623 27324  ; w1     subproc
24624 27324  ; w2
24625 27324  ; w3
24626 27324  
24626 27324  b. i10, j10
24627 27324  w.
24628 27324  q5:                    ; after create:
24629 27324       rl  w0  (b3)      ;  remoter(subproc):= first in name table
24630 27326       rs  w0  x1+s4     ;
24631 27328       jl      (b101)    ;  goto return
24632 27330  
24632 27330  e.                     ; end of after create
24633 27330  \f


24633 27330  
24633 27330  ; fpa-subproc          magnetic tape
24634 27330  ; eli, 14.9.1975
24635 27330  
24635 27330  ; procedure adjust position
24636 27330  ;
24637 27330  ; the position of the tape as described in <file count> and <block count>
24638 27330  ; is adjusted in the following way:
24639 27330  ;
24640 27330  ; after an input- or output operation <block count> is increased by
24641 27330  ; one, unless
24642 27330  ;     status bit2 (timer) is set or
24643 27330  ;     the size-field of mainproc is zero.
24644 27330  ;
24645 27330  ; if status bit7 is set (tape mark), <file count> is increased by
24646 27330  ; one and <block count> is cleared.
24647 27330  ;
24648 27330  ; in case of answer message with data, the <file count> and
24649 27330  ; <block count> is given in the datablock following.
24650 27330  ;
24651 27330  ; the new values of <block count> and <file count> are stored
24652 27330  ; in the answer-variables g23 and g24, ready for sending of an
24653 27330  ; answer
24654 27330  ;
24655 27330  ;        call          return
24656 27330  ; w0                   undefined
24657 27330  ; w1     subproc       unchanged
24658 27330  ; w2                   unchanged
24659 27330  ; w3     link          unchanged
24660 27330  
24660 27330  b. i10, j10
24661 27330  w.
24662 27330  
24662 27330  q10: ds. w3  j0.       ; adjust position: save link and w2
24663 27332       rl  w3  x1+a50    ;  main:= mainproc(subproc)
24664 27334       zl  w0  x3+p83+1  ;  if status(main)=intervention then
24665 27336       ls  w0  12       ; shift status
24666 27338       sh  w0  -1        ;
24667 27340       jl.     i4.       ;  goto intervention
24668 27342       rs  w0  x1+s5     ;  last status(proc):=status(main);
24669 27344       bz  w0  x3+p81    ;  func:= function(main)
24670 27346       rl  w2  0         ;  save function in w2
24671 27348       la  w0  g50       ;  remove databit
24672 27350       se  w0  v51       ;  if func=answer input or
24673 27352       sn  w0  v53       ;     func=answer output then
24674 27354       jl.     i0.       ;  goto increase
24675 27356       se  w2  v55+(:1<0:); if func<>answer message with data then
24676 27358       jl.     i2.       ;  goto set g23 and g24
24677 27360  
24677 27360  ; get values from datablock of answer
24678 27360  
24678 27360       am      (x1+a50)  ;  w2:= first received address(mainproc(subproc))
24679 27362       rl  w2  +p85      ;
24680 27364       dl  w0  x2+8      ;  get file- and blockcount from datablock
24681 27366       ds  w0  x1+s3     ;  goto set g23 and g24
24682 27368       jl.     i2.       ;
24683 27370  
24683 27370  ; after input- or output
24684 27370  ; adjust file- and blockcount as described above
24685 27370  
24685 27370  i0:  bz  w2  x3+p83+1  ; increase:
24686 27372       rl  w3  x3+p84    ;  if timer(status(main))=0 and
24687 27374       so  w2  1<9       ;     size(main)<>0 then
24688 27376       sn  w3  0         ;
24689 27378       jl.     i1.       ;  
24690 27380       dl  w0  x1+s3     ;   block count(subproc):= 
24691 27382       ba. w0  1         ;      blockcount(subproc)+1
24692 27384       rs  w0  x1+s3     ;
24693 27386  
24693 27386  i1:  so  w2  1<4       ;  if tape mark(status(main))=1 then
24694 27388       jl.     i2.       ;  begin
24695 27390       al  w3  1         ;   file count(subproc):= file count(subproc)+1
24696 27392       wa  w3  x1+s2     ;
24697 27394       al  w0  0         ;   block count(subproc):= 0
24698 27396       ds  w0  x1+s3     ;  end
24699 27398  
24699 27398  ; set new (or saved) content in g23 and g24.
24700 27398  ; w3w0 holds value
24701 27398  
24701 27398  i2:  dl  w0  x1+s3     ; set g23 and g24:
24702 27400       ds  w0  g24       ;
24703 27402       jl.     i3.       ;
24704 27404  
24704 27404  ; intervention status (tape has been set local)
24705 27404  
24705 27404  i4:  jl. w3  q12.      ;  clear queue(state:= 1)
24706 27406  
24706 27406  ; restore w2 and w3 and return
24707 27406  
24707 27406  i3:  dl. w3  j0.       ;
24708 27408       jl      x3        ;
24709 27410  
24709 27410       0                 ; saved w2
24710 27412  j0:  0                 ; saved link
24711 27414  
24711 27414  e.                     ; end of procedure adjust position
24712 27414  \f


24712 27414  ; fpa-subproc          magnetic tape
24713 27414  ; eli, 25.3.1976
24714 27414  
24714 27414  ; procedure clear queue
24715 27414  ;
24716 27414  ; called when the tape has been set offline or online.
24717 27414  ; the name of the process is removed. an eventual reserver
24718 27414  ; is removed. filecount, blockcount are set to -1.
24719 27414  ; state is set depending on entrypoint selected.
24720 27414  ; an answer with result 4 from the device is simulated.
24721 27414  ; all pending messages are returned with result 5 (unknown).
24722 27414  ;
24723 27414  ;        call          return
24724 27414  ; w0                   undefined
24725 27414  ; w1     subproc       unchanged
24726 27414  ; w2                   undefined
24727 27414  ; w3     link          undefined
24728 27414  
24728 27414  b. i10, j10
24729 27414  w.
24730 27414  
24730 27414                         ; clear queue:
24731 27414  q11: am      1         ;     state:= 2 (i.e. unknown mounted)
24732 27416  q12: al  w0  1         ;  or state:= 1 (i.e. local)
24733 27418       rs  w0  x1+s1     ;
24734 27420       rs. w3  j0.       ;  save link
24735 27422       al  w0  0         ;  reserver(subproc):=
24736 27424       rs  w0  x1+a11    ;  name(0):=  0
24737 27426       rs  w0  x1+a52    ;
24738 27428       rs  w0  x1+s5     ;  last status(proc):=status(main);
24739 27430       al  w0  4         ;  simulated result(mainproc(subproc)):= 4
24740 27432       am      (x1+a50)  ;
24741 27434       hs  w0  +p82      ;
24742 27436       al  w0  -1        ;  filecount(subproc):=
24743 27438       al  w3  -1        ;  blockcount(subproc):= -1
24744 27440       ds  w0  x1+s3     ;
24745 27442       jl.     i1.       ;
24746 27444  i0:  al  w0  5         ;  for mes:= all unprocessed messages(subproc) do
24747 27446       jl  w3  g19       ;  deliver result(mes, 5)
24748 27448  i1:  jl. w3  (j1.)     ;
24749 27450       se  w2  0         ;
24750 27452       jl.     i0.       ;
24751 27454  
24751 27454  ; return
24752 27454  
24752 27454       jl.     (j0.)     ;
24753 27456  
24753 27456  j0:  0                 ;  saved link
24754 27458  j1:  u22               ;
24755 27460  
24755 27460  e.                     ; end of clear queue
24756 27460  
24756 27460  e.                     ; end of magnetic tape
24757 27460  
24757 27460  z.                     ;
24758 27460  
24758 27460  h118=h100
24759 27460  
24759 27460  
24759 27460  
24759 27460  ; stepping stones.
24760 27460  
24760 27460       jl.   u2.   , u2 =k-2
24761 27462       jl.   u20.  , u20=k-2
24762 27464       jl.   u21.  , u21=k-2
24763 27466  
24763 27466  \f


24763 27466  
24763 27466  ; fpa-subproc          disc- and areatypes
24764 27466  ; eli, 14.10.1975
24765 27466  
24765 27466  c.(:a80>14a.1:)-1     ; if disc bit then include:
24766 27466  
24766 27466  b. q20, s10
24767 27466  w.
24768 27466  ;
24769 27466  ; a disc connected to an rc3600 is in rc4000 represented by a subproc.
24770 27466  ;
24771 27466  ; an area on the disc is represented by a normal area process having
24772 27466  ; 'document name' equal to the name of the disc-subproc (as defined
24773 27466  ; by 'create peripheral process').
24774 27466  ;
24775 27466  ; the filestructure of the disc is defined in the normal way by a 
24776 27466  ; slicetable in the monitor, provided the disc has been included in
24777 27466  ; the bs-system by a call of 'include bs'.
24778 27466  ;
24779 27466  ; messages may be sent either directly to the disc, in which case
24780 27466  ; absolute segment addressing is used, or to an areaprocess in which
24781 27466  ; case adressing relative to the start of the area is used.
24782 27466  ;
24783 27466  ; the following subproc handles both messages to discs and areas.
24784 27466  ; the only difference is the initial handling of the message just
24785 27466  ; after 'send message'. here the segment number in a message to an
24786 27466  ; areaprocess is converted to a physical (absolute) segment number.
24787 27466  ;
24788 27466  ; like other subprocesses a message may be split into a number of
24789 27466  ; messages to the device, each (exept the last) corresponding to
24790 27466  ; the maximum buffer length of the device as stated in 'create'.
24791 27466  ; but due to the file structure of a disc another level of message-
24792 27466  ; splitting is introduced (note: this level of message-splitting
24793 27466  ; is already known from the existing handling of a disc, connected
24794 27466  ; directly to an rc4000).
24795 27466  ;
24796 27466  ;    a file need not correspond to a number of physically con-
24797 27466  ;    secutive segments.
24798 27466  ;
24799 27466  ; therefore a message to an areaprocess is treated in the following
24800 27466  ; levels:
24801 27466  ;
24802 27466  ;    1. message level
24803 27466  ;       2. slice level: prepare a number of consecutive segments.
24804 27466  ;          3. buffer level: transfer these segments in a number
24805 27466  ;             of blocks corresponding to the maximum device buffer
24806 27466  ;             length.
24807 27466  ;
24808 27466  ; stage 3 is executed 1 or more times for each instance of stage 2,
24809 27466  ; and stage 2 is repeated for each group of consecutive segments
24810 27466  ; until either the file in question or the message data area suppli-
24811 27466  ; ed from the internal process is exhausted.
24812 27466  ;
24813 27466  ; in stage 2 and 3 there is no destinction between messages originally
24814 27466  ; sent to an areaprocess or to a discprocess. as there is no file-
24815 27466  ; structure for messages to the disc, stage 2 must 'automatically'
24816 27466  ; be dummy in that case.
24817 27466  ;
24818 27466  ; the subproc uses the message as storage for information making this
24819 27466  ; possible.
24820 27466  ;
24821 27466  ; originally a message to an area- or a discprocess holds the following
24822 27466  ; information:
24823 27466  ;
24824 27466  ;    message+8:   operation<12+mode
24825 27466  ;          +10:   first address
24826 27466  ;          +12:   last address
24827 27466  ;          +14:   first segment
24828 27466  ;                 (absolute for messages to disc,
24829 27466  ;                 relative to start of area otherwise)
24830 27466  ;
24831 27466  ; after 'send message' and in the following processing of the message
24832 27466  ; it is transformed in the following way:
24833 27466  ;
24834 27466  ;    message+8:   unchanged from above
24835 27466  ;          +10:   unchanged from above
24836 27466  ;          +12:   last address corresponding to current consecutive
24837 27466  ;                 segments (initially set equal to +10)
24838 27466  ;          +14:   first physical segment 
24839 27466  ;          +16:   next physical segment, i.e. start segment for the
24840 27466  ;                 next consecutive segments
24841 27466  ;          +18:   original value of last address (from above)
24842 27466  ;          +20:   expected size
24843 27466  ;          +22:   updated first address
24844 27466  ;
24845 27466  ; note, that +8, +10, +12, +20 and +22 corresponds to a message as it
24846 27466  ; is normally required by the common fpa-procedures.
24847 27466  ; these procedures may then handle the splitting of the consecutive
24848 27466  ; segments depending on the buffersize of the device. only a little
24849 27466  ; extra code is required here, taking care of updating of 'first phy-
24850 27466  ; sical segment' after each transfer.
24851 27466  ;
24852 27466  ; when the consecutive segments are exhausted the next number of 
24853 27466  ; consecutive segments are selected, and +12, +14 and +16 updated
24854 27466  ; correspondingly.
24855 27466  ;
24856 27466  ; for a message directly to the discprocess, +12 and +18 will be
24857 27466  ; set equal to each other, thus simulating that the last part of a
24858 27466  ; message is processed.
24859 27466  ;
24860 27466  ; when a message is sent to an areaprocess the standard 'send message'
24861 27466  ; action is entered. there the discprocess corresponding to the area
24862 27466  ; is found and if the kind of the discprocess is a subprocess, a jump
24863 27466  ; is performed through send message for subprocs to the
24864 27466  ; send message action for disc-subprocs. a flag in the
24865 27466  ; subproc description shows the area process that is the
24866 27466  ; actual receiver of the message
24867 27466  ;
24868 27466  ; a message to the discprocess itself enters here at q0.
24869 27466  \f


24869 27466  ; fpa-subproc          disc- and areatypes
24870 27466  ; eli, 15.10.1975
24871 27466  
24871 27466  m.
24871 27466                  disc link

24872 27466  
24872 27466  ; entry point table
24873 27466  
24873 27466  h106:        q0        ; after send message (only for disc)
24874 27468               q1        ; before header
24875 27470               q2        ; after header transmit
24876 27472               q3        ; after header receive
24877 27474               q4        ; after data receive
24878 27476               q5        ; after create
24879 27478  
24879 27478  ; definition of local part of subproc
24880 27478  
24880 27478  b. j0
24881 27478  w.
24882 27478  
24882 27478  s0= p0                 ; start of local part
24883 27478  j0= p0                 ; save start
24884 27478  
24884 27478          s0=s0+2        ; 1 unused word
24885 27478  s2=s0,  s0=s0+2        ; <chaintable>
24886 27478  s3=s0,  s0=s0+2        ; <slicelength>
24887 27478  s4=s0,  s0=s0+2        ; <state>
24888 27478  
24888 27478  ; test for size of private part not exceeded
24889 27478  
24889 27478  c. (:s0-j0-v1-1:)
24890 27478     m. fpa subproc: disctype private part too long
24891 27478  z.
24892 27478  e.                     ; 
24893 27478  
24893 27478  q12:         (:-1:)<9  ; constant to mask of to integral number
24894 27480                         ; of segments
24895 27480  \f


24895 27480  ; fpa-subproc          disc- and areatypes
24896 27480  ; eli, 22.1.1976
24897 27480  
24897 27480  ; after send message (disc)
24898 27480  ;
24899 27480  ; set up the message, so that the procedure 'prepare consecutive
24900 27480  ; area' will be dummy when applied to this message. this is done
24901 27480  ; by setting
24902 27480  ;
24903 27480  ;    saved last address(message):= first addr(mes)+
24904 27480  ;       (first addr(mes)-last addr(mes))//512*512
24905 27480  ;
24906 27480  ; upon entry:
24907 27480  ; w0   
24908 27480  ; w1     subproc
24909 27480  ; w2     
24910 27480  ; w3
24911 27480  
24911 27480  b. i10, j10
24912 27480  w.
24913 27480  
24913 27480  q0:                    ; after send message:
24914 27480       rl  w0  x1+a56    ;  if called via areaprocess then
24915 27482       sz  w0  (:-1:)<1  ;
24916 27484       jl.     q11.      ;   goto after send message(area)
24917 27486       jl. w3  u4.       ;  check and link operation
24918 27488       rl  w2  b18       ;  w2:= current message
24919 27490       bz  w0  x2+8      ;  if oper(mes)<>input and
24920 27492       se  w0  3         ;     oper(mes)<>output then 
24921 27494       sn  w0  5         ;
24922 27496       jl.     i0.       ;  
24923 27498       jl.     u2.       ;  goto testmore
24924 27500  i0:  al  w3  2         ;  saved last(mes):= last(mes):=
24925 27502       wa  w3  x2+12     ;
24926 27504       rl  w0  x2+10     ;    (last(mes)-first(mes)+2)//512*512
24927 27506       ws  w3  0         ;
24928 27508       la. w3  q12.      ;
24929 27510       wa  w3  0         ;    + first(mes)
24930 27512       al  w3  x3-2      ;    - 2
24931 27514       rs  w3  x2+12     ;
24932 27516       rs  w3  x2+18     ;
24933 27518                         ;
24934 27518       jl.     u2.       ;  goto testmore
24935 27520  
24935 27520  e.
24936 27520  \f


24936 27520  ; fpa-subproc          disc- and areatypes
24937 27520  ; eli, 22.1.1976
24938 27520  
24938 27520  ; after send message (area)
24939 27520  ;
24940 27520  ; prepare message for first call of 'prepare consecutive area'
24941 27520  
24941 27520  ; note, that upon entry w0 will hold the areaprocess address,
24942 27520  ;       and b19 (monitor entry) will hold the mainproc
24943 27520  ;       address of the areaprocess (i.e. the disc-subproc)
24944 27520  ;
24945 27520  ; upon entry:
24946 27520  ; w0     area
24947 27520  ; w1     subproc (disc)   
24948 27520  ; w2
24949 27520  ; w3
24950 27520  
24950 27520  b. i10, j10
24951 27520  w.
24952 27520  
24952 27520  q11:                   ; after send message:
24953 27520       al  w2  0         ;  called via areaprocess:= false
24954 27522       rs  w2  x1+a56    ;
24955 27524       rl  w1  0         ;  proc:= area
24956 27526       rl  w2  b18       ;  w2:= current message
24957 27528       bz  w0  x2+8      ;  if oper(mes)<>input and
24958 27530       se  w0  3         ;     oper(mes)<>output then
24959 27532       sn  w0  5         ;
24960 27534       jl.     i0.       ;
24961 27536       jl.     i1.       ;  goto link
24962 27538  
24962 27538  ; input or output operation
24963 27538  
24963 27538  i0:  rl  w0  x2+14     ;  if first segment(mes)<0 or
24964 27540       sl  w0  0         ;     first segment(mes)>=segments(area) then
24965 27542       sl  w0  (x1+a61)  ;  goto outside
24966 27544       jl.     i2.       ;
24967 27546  
24967 27546  ; adjust addresses to correspond to an integral number of
24968 27546  ; segments
24969 27546  
24969 27546       dl  w0  x2+12     ;  last:= last(mes)
24970 27548       rs  w3  x2+22     ;  updated first(mes):= first(mes)
24971 27550       al  w3  x3-2      ;
24972 27552       rs  w3  x2+12     ;  last(mes):= first(mes)-2
24973 27554       ws  w0  6         ;  coresize:= (last-first(mes)+2)//512*512
24974 27556       la. w0  q12.      ;
24975 27558       rl  w3  x1+a61    ;  areasize:= (segments(area)-first segment(mes))*512
24976 27560       ws  w3  x2+14     ;
24977 27562       ls  w3  9         ;
24978 27564       sh  w0  (6)       ;  size:= min(coresize, areasize)
24979 27566       rl  w3  0         ;
24980 27568       al  w3  x3-2      ;
24981 27570       wa  w3  x2+10     ;  saved last(mes):= first(mes)+ size -2
24982 27572       rs  w3  x2+18     ;
24983 27574  
24983 27574  ; get start in chain table of segments
24984 27574  
24984 27574       rl  w0  x2+14     ;  no of slices:= first segment(mes)/
24985 27576       al  w3  0         ;                 slicelength(mainproc(area))
24986 27578       am      (x1+a50)  ;
24987 27580       wd  w0  +s3       ;
24988 27582       rs  w3  x2+16     ;  save first segment in slice
24989 27584  
24989 27584  ; normally last(mes) points to the last address for which data
24990 27584  ;   has been transferred.
24991 27584  ; segments are normally transferred from the first segment in
24992 27584  ;   a slice an on. this does however not hold for the first
24993 27584  ;   transfer, where it starts with segment no
24994 27584  ;   (first segment modulo slicelength).
24995 27584  ; this is corrected for by subtracting from last(mes)
24996 27584  ;   the core occupied by the not transferred segments in the
24997 27584  ;   slice.
24998 27584  ; this makes last(mes) point to a logical address (ahead of the
24999 27584  ;   users buffer) where the transfer of a previous slice would have 
25000 27584  ;   terminated.
25001 27584  
25001 27584       ls  w3  9         ;  last(mes):= last(mes)-
25002 27586       rx  w3  x2+12     ;
25003 27588       ws  w3  x2+12     ;    first segm in slice*512
25004 27590       rs  w3  x2+12     ;
25005 27592       rl  w2  x1+a60    ;  w2:= first slice(area)
25006 27594  
25006 27594  ; now change to run in mainproc(area), i.e. in the subproc actually
25007 27594  ; corresponding to the disc
25008 27594  
25008 27594       rl  w1  x1+a50    ;  proc:= mainproc(area)
25009 27596       wa  w2  x1+s2     ;  first slice:= first slice(area)+chaintable(proc)
25010 27598       jl  w3  d74       ;  follow chain(w2=first slice, w0=no of slices)
25011 27600       ws  w2  x1+s2     ;  next phys segm:= slice*slicelength(proc)+
25012 27602       al  w0  x2        ;
25013 27604       rl  w2  b18       ;  +
25014 27606       wm  w0  x1+s3     ;
25015 27608       wa  w0  x2+16     ;  first segment in slice
25016 27610       rs  w0  x2+16     ;
25017 27612       jl. w3  q10.      ;  prepare consecutive area
25018 27614  i1:  am      (b19)     ; link:
25019 27616       al  w1  +a54      ;  w1:= addr of message queue of subproc
25020 27618       jl  w3  d6        ;  link(w1=head, w2=elem)
25021 27620       rl  w1  b19       ;  restore current subproc.
25022 27622       jl.     u2.       ;  goto testmore
25023 27624  
25023 27624  ; first segment of message is outside the area. return
25024 27624  ; status 'end of document'.
25025 27624  
25025 27624  i2:  rl  w1  g62       ; outside: status:= bit5
25026 27626       rs  w1  g20       ;
25027 27628       ld  w1  -65       ;  bytes:= chars:= 0
25028 27630       ds  w1  g22       ;
25029 27632       jl  w3  g18       ;  deliver result(1)
25030 27634       jl.     u2.       ;  goto testmore
25031 27636  
25031 27636  e.                     ; end of after message (area)
25032 27636  \f


25032 27636  ; fpa-subproc          disc- and areatypes
25033 27636  ; eli, 14.10.1975
25034 27636  
25034 27636  ; before header (disc and area)
25035 27636  ;
25036 27636  ; prepare transmission of next block.
25037 27636  ;
25038 27636  ; note, that the fields <status> and <mode> are used to hold the
25039 27636  ; segment number in case of an input- or output operation.
25040 27636  ;
25041 27636  ; upon entry
25042 27636  ; w0
25043 27636  ; w1     subproc
25044 27636  ; w2
25045 27636  ; w3
25046 27636  
25046 27636  b. i10, j10
25047 27636  w.
25048 27636  q1:                    ; before header:
25049 27636       jl. w3  u20.      ;  test answer attention
25050 27638       jl. w3  u12.      ;  w2:= find first message
25051 27640       sn  w2  0         ;  if w2=0 then
25052 27642       jl.     u3.       ;   goto no block
25053 27644  
25053 27644  ; test for input- or output message
25054 27644  
25054 27644       jl. w3  u30.      ;  prepare transfer(message)
25055 27646       bz  w0  x2+8      ;  if oper(mes)<>input and
25056 27648       se  w0  3         ;     oper(mes)<>output then
25057 27650       sn  w0  5         ;
25058 27652       jl.     i1.       ;
25059 27654       jl      (b101)    ;  goto mainproc return
25060 27656  i1:  rl  w0  x2+14     ;  w0:= first phys segment(mes)
25061 27658       am      (x1+a50)  ;  state,mode(mainproc(subproc)):= w0
25062 27660       rs  w0  +p63      ;
25063 27662  
25063 27662  ; increase stop count at this time also for input messages,
25064 27662  ; thus ensuring that the process is still present when
25065 27662  ; the answer arrives (which does not take long time for
25066 27662  ; discs)
25067 27662  
25067 27662       jl. w3  u21.      ;  test and increase stop count
25068 27664       jl.     u3.       ; stopped: goto no block
25069 27666       jl      (b101)    ; running: goto mainproc return
25070 27668  
25070 27668  e.                     ; end of before header
25071 27668  \f


25071 27668  
25071 27668  ; fpa-subproc          disc- and areatypes
25072 27668  ; eli, 3.2.1976
25073 27668  
25073 27668  ; after header transmit
25074 27668  ;
25075 27668  ; a header and maybe a corresponding datablock has been transmitted.
25076 27668  ; for messages originally sent to an areaprocess, the field
25077 27668  ; first physical segment is increased corresponding to the
25078 27668  ; size of the datablock transferred.
25079 27668  ;
25080 27668  ; upon entry:
25081 27668  ; w0
25082 27668  ; w1     subproc
25083 27668  ; w2
25084 27668  ; w3
25085 27668  
25085 27668  b. i10, j10
25086 27668  w.
25087 27668  
25087 27668  q2:                    ; after header transmit:
25088 27668       jl. w3  u8.       ;  mes:= message table(current bufno)
25089 27670       rs. w2  j0.       ;  save mes
25090 27672       jl. w3  u40.      ;  test header transmit
25091 27674       jl.     u2.       ; error: goto testmore
25092 27676       rl. w2  j0.       ;   restore mes;
25093 27678       se  w2  0         ;   if mes = 0 then
25094 27680       jl.     i1.       ;   begin
25095 27682       rl  w2  x1+p13    ;     mes:= current message;
25096 27684       sn  w2  0         ;     if mes = 0
25097 27686       jl.     u2.       ;        then goto testmore;
25098 27688  i1:                    ;   end;
25099 27688       rl  w3  x1+a50    ;  main:= mainproc(subproc)
25100 27690       bz  w0  x3+p61    ;  if function(main)<>input and
25101 27692       se  w0  v50       ;     function(main)<>output then
25102 27694       sn  w0  v52+(:1<0:);
25103 27696       jl.     i0.       ;
25104 27698       jl.     u2.       ;  goto testmore
25105 27700  i0:  rl  w0  x3+p64    ;  segments:= convert to 12(size(main))//512
25106 27702       jl. w3  u15.      ;
25107 27704       ls  w0  -9        ;
25108 27706       rl. w2  j0.       ;  restore mes
25109 27708       wa  w0  x2+14     ;  first phys segm(mes):= first phys segm(mes)+segments
25110 27710       rs  w0  x2+14     ;
25111 27712  
25111 27712  ; if the last portion of the current consecutive area has been
25112 27712  ;   initialized and more is to be transferred, then prepare
25113 27712  ;   next consecutive segments.
25114 27712  
25114 27712       rl  w3  x1+p13    ;  if current message(subproc)=0 and
25115 27714       rl  w0  x2+12     ;     last(mes)<>saved last(mes) then
25116 27716       sn  w3  0         ;  begin
25117 27718       sn  w0  (x2+18)   ;
25118 27720       jl.     u2.       ;
25119 27722       rs  w2  x1+p13    ;   current message(subproc):= mes
25120 27724       jl. w3  q10.      ;   prepare consecutive area
25121 27726                         ;  end
25122 27726       jl.     u2.       ;  goto testmore
25123 27728  
25123 27728  j0:  0                 ;  saved message address
25124 27730  
25124 27730  e.                     ; end of after header transmit
25125 27730  \f


25125 27730  ; fpa-subproc          disc- and areatypes
25126 27730  ; eli, 14.10.1975
25127 27730  
25127 27730  ; after header received
25128 27730  ;
25129 27730  ; a header has been received.
25130 27730  ; no special actions required
25131 27730  ;
25132 27730  ; upon entry
25133 27730  ; w0
25134 27730  ; w1     subproc
25135 27730  ; w2
25136 27730  ; w3
25137 27730  
25137 27730  b. i10, j10
25138 27730  w.
25139 27730  
25139 27730  q3:  jl. w3  u50.      ; after header receive: test header received
25140 27732       jl.     u2.       ;  goto testmore
25141 27734  
25141 27734  e.                     ; end of after header received
25142 27734  \f


25142 27734  ; fpa-subproc          disc- and areatypes
25143 27734  ; eli, 14.10.1975
25144 27734  
25144 27734  ; after data received
25145 27734  ;
25146 27734  ; a datablock following a header has been received
25147 27734  ; 
25148 27734  ; status intervention or result disconnected will cause the name of the
25149 27734  ; subproc to be removed and the message returned with result 5
25150 27734  ; (receiver does not exist)
25151 27734  ;
25152 27734  ; upon entry
25153 27734  ; w0
25154 27734  ; w1     subproc
25155 27734  ; w2
25156 27734  ; w3
25157 27734  
25157 27734  b. i10, j10
25158 27734  w.
25159 27734  
25159 27734  q4:                    ; after data:
25160 27734       rl  w3  x1+a50    ;  main:= mainproc(subproc)
25161 27736       bl  w2  x3+p82    ;  if result(main)=disconnected or
25162 27738       bl  w0  x3+p81+1  ;     status(main)=intervention then
25163 27740       sl  w0  0         ;  begin comment: remove name of proces;
25164 27742       sn  w2  3         ;
25165 27744       jl.     +4        ;
25166 27746       jl.     i1.       ;
25167 27748       al  w0  4         ;   simulated result(main):= 4
25168 27750       hs  w0  x3+p82    ;
25169 27752       al  w0  0         ;   name(subproc):=
25170 27754       rs  w0  x1+a11    ;   reserver(subproc):= 0
25171 27756       rs  w0  x1+a52    ;
25172 27758       rl  w3  b5        ;   for area:= all area procs do
25173 27760  i0:  rl  w2  x3        ;
25174 27762       sn  w1  (x2+a50)  ;   if main(area)=subpproc then
25175 27764       rs  w0  x2+a50    ;   main(area):= 0
25176 27766       al  w3  x3+2      ;
25177 27768       se  w3  (b6)      ;
25178 27770       jl.     i0.       ;  end
25179 27772                         ;
25180 27772  i1:  jl. w3  u60.      ;  test data received
25181 27774       jl.     u2.       ; normal:    goto testmore
25182 27776       jl.     u2.       ; attention: goto testmore
25183 27778  
25183 27778  e.                     ; end of data received
25184 27778  \f


25184 27778  
25184 27778  ; fpa-subproc          disc- and areatypes
25185 27778  ; eli, 16.12.1975
25186 27778  
25186 27778  ; after create
25187 27778  ;
25188 27778  ; a disctype subproc has been created.
25189 27778  ;
25190 27778  ; the fields <chaintable> and <slice length> will later be
25191 27778  ; initialized by procfunc when an internal process executes
25192 27778  ; 'create bs'.
25193 27778  ;
25194 27778  ; upon entry
25195 27778  ; w0
25196 27778  ; w1     subproc
25197 27778  ; w2
25198 27778  ; w3
25199 27778  
25199 27778  b. i10, j10
25200 27778  w.
25201 27778  
25201 27778  q5:                    ; after create:
25202 27778  
25202 27778  ; adjust maximum buffer size to an integral number of segments
25203 27778  
25203 27778       rl. w0  q12.      ;
25204 27780       la  w0  x1+p18    ;  size(subproc):= size(subproc)//512*512
25205 27782       rs  w0  x1+p18    ;
25206 27784  
25206 27784       jl      (b101)    ;  goto return
25207 27786  
25207 27786  e.                     ; end of create
25208 27786  \f


25208 27786  ; fpa-subproc          disc- and areatypes
25209 27786  ; eli, 22.1.1976
25210 27786  
25210 27786  ; procedure prepare consecutive area
25211 27786  ;
25212 27786  ; makes the pointers <updated first> and <last> in the
25213 27786  ; messagebuffer describe a storage area corresponding to
25214 27786  ; a number of consecutive disc segments
25215 27786  ;
25216 27786  ;        call          return
25217 27786  ; w0                   undefined
25218 27786  ; w1     subproc(disc) unchanged
25219 27786  ; w2     message       unchanged
25220 27786  ; w3     link          undefined
25221 27786  
25221 27786  b. i10, j10
25222 27786  w.
25223 27786  
25223 27786  q10: ds. w3  j1.       ; prepare consecutive area:
25224 27788       rl  w0  x2+16     ;  save message and link
25225 27790       rs  w0  x2+14     ;  first phys segm(mes):= next phys segm(mes)
25226 27792       al  w3  0         ;  slice:= next phys segm(mes)/slicelength(subproc)+
25227 27794       wd  w0  x1+s3     ;  
25228 27796       wa  w0  x1+s2     ;  chaintable(subproc)
25229 27798       rl  w3  x2+18     ;
25230 27800       rl  w2  x1+s3     ;  length:= slicelength(subproc)*512
25231 27802       ls  w2  9         ;
25232 27804       ds. w3  j3.       ;
25233 27806       am.     (j0.)     ;
25234 27808       rl  w3  +12       ;
25235 27810       wa. w3  j2.       ;  addr:= last addr(mes)+ length
25236 27812  
25236 27812  ; scan slicetable as long as a slice with content 1 is encountered
25237 27812  
25237 27812  i0:  bz  w2  (0)       ;  while chaintable(slice)=1 and
25238 27814       sn  w2  1         ;        addr<saved last(mes) do
25239 27816       sl. w3  (j3.)     ;  begin
25240 27818       jl.     i1.       ;
25241 27820       ba. w0  1         ;   slice:= slice+1
25242 27822       wa. w3  j2.       ;   addr:= addr+length
25243 27824       jl.     i0.       ;  end
25244 27826  
25244 27826  ; dataarea at user exhausted or nonconsecutive segments
25245 27826  
25245 27826  i1:  rl. w2  j0.       ;  restore message
25246 27828       sl. w3  (j3.)     ;  if addr<saved last(mes) then
25247 27830       jl.     i2.       ;  begin nonconsecutive, more to send.
25248 27832       rs  w3  x2+12     ;   last(mes):= addr
25249 27834       ba  w0  (0)       ;   next phys segm(mes):= (next slice(slice)-
25250 27836       ws  w0  x1+s2     ;      chaintable(subproc))*slicelength(subproc)
25251 27838       wm  w0  x1+s3     ;
25252 27840       rs  w0  x2+16     ;  
25253 27842       jl.     (j1.)     ;  end else
25254 27844       
25254 27844  i2:  rl  w0  x2+18     ;   last addr(mes):= saved last(mes)
25255 27846       rs  w0  x2+12     ;
25256 27848  
25256 27848  ; return
25257 27848  
25257 27848       jl.     (j1.)     ;  goto return
25258 27850  
25258 27850  ; working locations
25259 27850  
25259 27850  j0:  0                 ;  saved message
25260 27852  j1:  0                 ;  saved link
25261 27854  j2:  0                 ;  length (i.e. slicelength*512)
25262 27856  j3:  0                 ;  saved last address(mes)
25263 27858  
25263 27858  e.                     ; end of prepare consecutive area
25264 27858  \f


25264 27858  
25264 27858  
25264 27858  
25264 27858  e.                     ; end of disc- and areatypes
25265 27858  
25265 27858  z.                    ;
25266 27858  
25266 27858  h106=h100
25267 27858  \f


25267 27858  
25267 27858  ; fpa-subproc          discette
25268 27858  ; jr, 78.08.22
25269 27858  
25269 27858  ; stepping stone:
25270 27858       jl.     u3. , u3=k-2
25271 27860       jl.     u12., u12=k-2
25272 27862       jl.     u4.  , u4=k-2
25273 27864       jl.     u14. , u14=k-2
25274 27866       jl.     u30. , u30=k-2
25275 27868       jl.     u40. , u40=k-2
25276 27870  
25276 27870  c.(:a80>15 a.1 :)-1   ; if floppy disc bit then include
25277 27870  
25277 27870  
25277 27870  b. q20,s10,n10 w.
25278 27870  
25278 27870  ; this subdriver is used for links to discettes. it differs from the
25279 27870  ; 'standard type driver' in these ways:
25280 27870  ;   - the stopcount of a sender that wants to input is raised
25281 27870  ;     already in entry 1 to prevent a stopped sender when receiving in
25282 27870  ;     entry 3.
25283 27870  ;   - if sender is stopped (only when inputting or outputting) in entry 1,
25284 27870  ;     the state of the process is set to 'stopped' which causes all messages
25285 27870  ;     (except reset) to be answered immediately with status stopped.
25286 27870  
25286 27870  ; note: this driver cannot handle links with more than one operation.
25287 27870  
25287 27870  m.
25287 27870                  flexible disc link

25288 27870  
25288 27870  ; entry point table:
25289 27870  h122:                  ; discette:
25290 27870  
25290 27870               q0        ;  after send message
25291 27872               q1        ;  before header transmit
25292 27874               q2        ;  after header transmit
25293 27876               q3        ;  after header received
25294 27878               q4        ;  after data received
25295 27880               q5        ;  after creation
25296 27882  
25296 27882  ; definition of privat part of process description:
25297 27882  
25297 27882     s0=p0               ; state
25298 27882  
25298 27882  ; state :  0   running
25299 27882  ;          2   waiting for stop
25300 27882  ;          4   stopped
25301 27882  
25301 27882  \f


25301 27882  
25301 27882  ; fpa-subproc         discette
25302 27882  ; jr, 78.08.22
25303 27882  
25303 27882  ; after send message 
25304 27882  ;
25305 27882  ; a new message has been received. check that user- or reservation
25306 27882  ; status is ok and link message to queue of subproc.
25307 27882  ; if state is stopped and if operation is odd then
25308 27882  ; deliver answer with status stopped.
25309 27882  ; if operation is reset then state is changed to running.
25310 27882  ; if the subproc is not busy, then link it to mainproc.
25311 27882  ; 
25312 27882  ; upon entry: w1=subproc
25313 27882  
25313 27882  b. i10,j10 w.
25314 27882  
25314 27882  q0:                    ; after send message:
25315 27882       jl. w3  u4.       ;   check and link operation;
25316 27884       rl  w3  x1+s0     ;   
25317 27886       jl.     x3+i0.    ;   goto case state of
25318 27888  i0:  jl.     u2.       ;    ( 0: testmore,
25319 27890       jl.     j2.       ;      2: exit0,
25320 27892                         ;      4: stopped);
25321 27892  
25321 27892  j0:  am     (b18)      ; stopped:
25322 27894       bz  w0  +8        ;
25323 27896       sz  w0  2.1       ;  if operation is odd
25324 27898       jl.     j1.       ;  then deliver result stopped;
25325 27900       sn  w0  0         ;  else if not sense then goto test more;
25326 27902       jl.     u2.       ;
25327 27904       se  w0  2         ;   if operation(mess)=reset then
25328 27906       jl.     j1.       ;     state:=running;
25329 27908       al  w0  0         ;     goto testmore;
25330 27910       rs  w0  x1+s0     ;
25331 27912       jl.     u2.       ;
25332 27914  j1:  jl. w3  n0.       ;   deliver result(stopped);
25333 27916  j2:  jl     (b101)     ; exit0: return;
25334 27918  
25334 27918  e.                     ; end of after send message
25335 27918  \f


25335 27918  
25335 27918  ; fpa-subproc          discette
25336 27918  ; jr, 78.08.22
25337 27918  
25337 27918  ; before header
25338 27918  ;
25339 27918  ; a header (and maybe a corresponding datablock) is to be transmitted.
25340 27918  ; find first non-processed message in queue of subproc and initialize
25341 27918  ; transmit-parameters in mainproc.
25342 27918  ;
25343 27918  ; upon entry: w1=subproc
25344 27918  
25344 27918  b. i10,j10 w.
25345 27918  
25345 27918  q1:                    ; before header:
25346 27918       jl. w3  u20.      ;   test answer attention;
25347 27920       jl. w3  u12.      ;   mes:= first pending message;
25348 27922       sn  w2  0         ;   if mes=0 then
25349 27924       jl.     u3.       ;     goto no block;
25350 27926  
25350 27926  ; message found.
25351 27926  
25351 27926       bz  w0  x2+8      ;
25352 27928       so  w0  2.1       ;   if odd operation then
25353 27930       jl.     j0.       ;     examine sender(mess);
25354 27932       jl  w3  g34       ;      stopped: goto stopped;
25355 27934       jl.     j1.       ;      ok:
25356 27936  
25356 27936  j0:  jl. w3  u30.      ;   prepare transfer;
25357 27938       bz  w0  x2+8      ;
25358 27940       so  w0  3         ;   if operation=input then
25359 27942       jl      (b101)    ;
25360 27944       jl. w3  u21.      ;   test and increase stopcount;
25361 27946               -1        ;    stopped: impossible (checked above(g34));
25362 27948       jl      (b101)    ;   goto mainproc return;
25363 27950  
25363 27950  j1:  jl. w3  n1.       ; stopped: check queue;
25364 27952       jl.     u3.       ;    queue not empty: goto no block;
25365 27954       jl. w3  n2.       ;    queue empty: clean mess queue;
25366 27956       jl.     u3.       ;    end: goto no block;
25367 27958       al  w0  0         ;    reset:
25368 27960       rs  w0  x1+s0     ;   state:=running;
25369 27962       jl.     j0.       ;   goto prepare;
25370 27964  
25370 27964  e.                     ; end of before header
25371 27964  \f


25371 27964  ; fpa-subproc          discette
25372 27964  ; jr, 78.08.22
25373 27964  
25373 27964  ; after header and data transmitted
25374 27964  ;
25375 27964  ; entered by mainproc, when a header and a corresponding datablock
25376 27964  ; (if any) has been transmitted.
25377 27964  ; the result of the transmission is checked and if an error has
25378 27964  ; occured, the message is returned with result=4 (receiver
25379 27964  ; malfunction).
25380 27964  ;
25381 27964  ; finally the state of the subproc is checked for transmission of a
25382 27964  ; new block.
25383 27964  
25383 27964  b. i10,j10 w.
25384 27964  
25384 27964  q2:  jl. w3  u40.      ; after header: test header transmitted
25385 27966       jl.     u2.       ; error: goto testmore
25386 27968       jl.     u2.       ;  goto testmore
25387 27970  
25387 27970  e.                     ; end of header and data transmitted
25388 27970  \f


25388 27970  ; fpa-subproc          discette
25389 27970  ; jr, 78.08.22
25390 27970  
25390 27970  ; after header received
25391 27970  ;
25392 27970  ; a header has been received.
25393 27970  ; for this kind of subprocs (with no special actions) it can
25394 27970  ; only specify the functions <answer input with data> or
25395 27970  ; <answer message with data>.
25396 27970  ;
25397 27970  ; upon entry: w1=subproc
25398 27970  
25398 27970  b. i10,j10 w.
25399 27970  
25399 27970  q3:  jl. w3  u50.      ; after header received: test answer header
25400 27972       jl.     u2.       ;  goto testmore
25401 27974  
25401 27974  e.                     ; end of after header received
25402 27974  \f


25402 27974  ; fpa-subproc          discette
25403 27974  ; jr, 78.08.22
25404 27974  
25404 27974  ; after data received
25405 27974  ;
25406 27974  ; check transmission.
25407 27974  ;
25408 27974  ; upon entry: w1=subproc
25409 27974  
25409 27974  b. i10,j10 w.
25410 27974  
25410 27974  q4:  jl. w3  u60.      ; after data received: test data received
25411 27976       jl.     u2.       ;  goto testmore
25412 27978  
25412 27978  ; attention. no special action
25413 27978  
25413 27978       jl.     u2.       ;  goto testmore
25414 27980  
25414 27980  e.                     ; end of data received
25415 27980  \f


25415 27980  ; fpa-subproc          discette
25416 27980  ; jr, 78.08.22
25417 27980  
25417 27980  ; after create
25418 27980  ;
25419 27980  ; the subproc has just been created.
25420 27980  ; no special action
25421 27980  ;
25422 27980  ; upon entry: w1=subproc
25423 27980  
25423 27980  b. i10,j10 w.
25424 27980  
25424 27980  q5:                    ; after create:
25425 27980       jl      (b101)    ;  goto return
25426 27982  
25426 27982  e.                     ; end of after create
25427 27982  \f


25427 27982  
25427 27982  ; special procedures used in the discette driver.
25428 27982  
25428 27982  ; procedure deliver stopped answer.
25429 27982  ; the message buffer defined in b18 is returned to the sender with 
25430 27982  ; status = stopped and bytes, chars transferred = 0, 0.
25431 27982  ;        call:         return:
25432 27982  ; w0                   destroyed
25433 27982  ; w1                   proc
25434 27982  ; w2                   destroyed
25435 27982  ; w3     link          destroyed
25436 27982  
25436 27982  b.w.
25437 27982  
25437 27982  n0:  al  w0  1<8       ; deliver stopped answer:
25438 27984       rs  w0  g20       ;   status(answer):=stopped;
25439 27986       al  w0  0         ;   bytes trf(answer):=0;
25440 27988       rs  w0  g21       ;   chars trf(answer):=0;
25441 27990       rs  w0  g22       ;   deliver answer;
25442 27992       jl      g18       ; exit: return to link;
25443 27994  e.
25444 27994  
25444 27994  ; procedure check queue.
25445 27994  ; if the message entry table is empty (=> no operations under execution
25446 27994  ; in the net) the message buffers in the event queue are returned with
25447 27994  ; answer stopped until either the queue is empty or a reset operation is
25448 27994  ; met.
25449 27994  ; the procedure returnes to link+2 when the queue is emptied and a reset
25450 27994  ; operation is found, else to link.
25451 27994  ; by return the state is
25452 27994  ;        0   event queue emptied and reset found
25453 27994  ;        2   message entry table not empty
25454 27994  ;        4   event queue emptied
25455 27994  ;        call:         return:
25456 27994  ; w0                   destroyed
25457 27994  ; w1     proc          unchanged
25458 27994  ; w2                   destroyed
25459 27994  ; w3     link          destoyed
25460 27994  
25460 27994  b.j4 w.
25461 27994  n1:  al  w0  0         ; check queue:
25462 27996       al  w2  x1+p19    ;
25463 27998  j0:  se  w0 (x2)       ;   for entry:=first in entry table to last do
25464 28000       jl.     j1.       ;   if entry used then
25465 28002       al  w2  x2+2      ;       goto not empty;
25466 28004       se  w2  x1+p19+v0*2;
25467 28006       jl.     j0.       ;
25468 28008       am      4-2       ; empty: state:=stopped;
25469 28010  j1:  al  w2  2         ; not empty: state:=waiting for stop;
25470 28012       rs  w2  x1+s0     ;
25471 28014       am      x2-2      ;
25472 28016       jl      x3        ; exit: return to link+state-2;
25473 28018  e.
25474 28018  
25474 28018  ; procedure clean mess queue.
25475 28018  
25475 28018  b.i6,j6 w.
25476 28018  n2:  rs. w3  i0.       ; clean mess queue:
25477 28020  j0:  jl. w3  u12.      ;   for mess:=first in mess queue until last do
25478 28022       sn  w2  0         ;     if operation(mess)=reset then
25479 28024       jl.    (i0.)      ;       return to link+2;
25480 28026       bz  w0  x2+8      ;
25481 28028       sn  w0  2         ;
25482 28030       jl.     j1.       ;
25483 28032       jl. w3  n0.       ;
25484 28034       jl.     j0.       ;
25485 28036  j1:  am.    (i0.)      ;
25486 28038       jl      +2        ;
25487 28040  i0:   0                ;
25488 28042  e.
25489 28042  
25489 28042  
25489 28042  e.                     ; end of discette driver.
25490 28042  
25490 28042  z.                     ;
25491 28042  
25491 28042  h122=h100
25492 28042  \f


25492 28042  ; fpa-subproc          character level i/o
25493 28042  ; ncj, 02.01.1980
25494 28042    
25494 28042  
25494 28042  b. q20, s10
25495 28042  w.
25496 28042    
25496 28042  ; this code handles fpa i/o on character level and is used by fpa
25497 28042  ; test programs.
25498 28042    
25498 28042  ; messages received must have the following format:
25499 28042  ;
25500 28042  ;      +8: operation<12 + mode
25501 28042  ;     +10: first
25502 28042  ;     +12: last
25503 28042  ;     +14: characters
25504 28042  ;
25505 28042   
25505 28042  m.
25505 28042                  character level i/o link

25506 28042  
25506 28042  ; entry point table:
25507 28042  h124:
25508 28042               q0        ;  after send message
25509 28044               q1        ;  before header transmit
25510 28046               q2        ;  after header transmit
25511 28048               q3        ;  after header received
25512 28050               q4        ;  after data received
25513 28052               q5        ;  after creation
25514 28054  
25514 28054  ; no structure of private part of process description required
25515 28054  \f


25515 28054  ; fpa-subproc          character level i/o
25516 28054  ; ncj, 2.01.1980
25517 28054  
25517 28054  ; after send message 
25518 28054  ;
25519 28054  ; a new message has been received. check that user- or reservation
25520 28054  ; status is ok and link message to queue of subproc.
25521 28054  ; if the subproc is not busy, then link it to mainproc.
25522 28054  ; 
25523 28054  ; upon entry:
25524 28054  ; w0
25525 28054  ; w1     subproc
25526 28054  ; w2  
25527 28054  ; w3     
25528 28054  
25528 28054  b. i10, j10
25529 28054  w.
25530 28054  q0:                    ; after send message:
25531 28054       jl. w3  u4.       ;  check and link operation
25532 28056       rl  w2  b18       ;  mes:= current message;
25533 28058       al  w0  2         ;  size:=
25534 28060       wa  w0  x2+12     ;        last(mes) - first(mes) + 2;
25535 28062       ws  w0  x2+10     ;
25536 28064       jl. w3  u14.      ;  convert to 8bit(size);
25537 28066       ws  w0  x2+14     ;  rem:= size - chars(mes);
25538 28068       sl  w0  0         ;  if rem < 0 or
25539 28070       sl  w0  3         ;     rem > 2
25540 28072       jl.     j0.       ;     then deliver result 3;
25541 28074       bz  w0  x2+8      ;  oper:= operation(mes);
25542 28076       se  w0  3         ;  if oper = input or
25543 28078       sn  w0  5         ;     oper = output
25544 28080       jl.     u2.       ;     then goto testmore
25545 28082  j0:  al  w0  3         ;     else deliver result 3;
25546 28084       jl  w3  g19       ;
25547 28086       jl.     u2.       ;  goto testmore;
25548 28088    
25548 28088  e.                     ; end of after send message
25549 28088  \f


25549 28088  ; fpa-subproc         character level i/o
25550 28088  ; ncj, 2.01.1980
25551 28088  
25551 28088  ; before header
25552 28088  ;
25553 28088  ; a header (and maybe a corresponding datablock) is to be transmitted.
25554 28088  ; find first non-processed message in queue of subproc and initialize
25555 28088  ; transmit-parameters in mainproc.
25556 28088  ;
25557 28088  ; upon entry:
25558 28088  ; w0
25559 28088  ; w1     subproc
25560 28088  ; w2
25561 28088  ; w3
25562 28088  
25562 28088  b. i10, j10
25563 28088  w.
25564 28088  q1:                    ; before header:
25565 28088       jl. w3  u20.      ;  test answer attention
25566 28090       jl. w3  u12.      ;  w2:=mes:= first pending message
25567 28092       sn  w2  0         ;  if mes=0 then
25568 28094       jl.     u3.       ;   goto no block.
25569 28096  
25569 28096  ; message found. initiate transfer
25570 28096  
25570 28096       jl. w3  u30.      ;  prepare transfer
25571 28098       rl  w3  x1+a50    ;  main:= main(subproc);
25572 28100       rl  w0  x2+14     ;  chars:= chars(mess);
25573 28102       sl  w0 (x3+p64)   ;  if chars < header size(main) then
25574 28104       jl     (b101)   ;
25575 28106       rs  w0  x3+p64    ;    header size(main):= chars;
25576 28108       rs  w0  x2+20     ;    expected size(mes):= chars;
25577 28110       bz  w1  x2+8      ;    oper:= operation(mes);
25578 28112       sn  w1  5         ;    if oper = output
25579 28114       rs  w0  x3+p66    ;       then data size(main):= chars;
25580 28116      jl     (b101)   ;
25581 28118  
25581 28118  e.                     ; end of before header
25582 28118  \f


25582 28118  ; fpa-subproc          character level i/o
25583 28118  ; ncj, 2.01.1980
25584 28118  
25584 28118  ; after header and data transmitted
25585 28118  ;
25586 28118  ; entered by mainproc, when a header and a corresponding datablock
25587 28118  ; (if any) has been transmitted.
25588 28118  ; the result of the transmission is checked and if an error has
25589 28118  ; occured, the message is returned with result=4 (receiver
25590 28118  ; malfunction).
25591 28118  ;
25592 28118  ; finally the state of the subproc is checked for transmission of a
25593 28118  ; new block.
25594 28118  
25594 28118  b. i10, j10
25595 28118  w.
25596 28118  
25596 28118  q2:  jl. w3  u40.      ; after header: test header transmitted
25597 28120       jl.     u2.       ; error: goto testmore
25598 28122       jl.     u2.       ;  goto testmore
25599 28124  
25599 28124  e.                     ; end of header and data transmitted
25600 28124  \f


25600 28124  ; fpa-subproc          character level i/o
25601 28124  ; ncj, 2.01.1980
25602 28124  
25602 28124  ; after header received
25603 28124  ;
25604 28124  ; a header has been received.
25605 28124  ; for this kind of subprocs (with no special actions) it can
25606 28124  ; only specify the functions <answer input with data> or
25607 28124  ; <answer message with data>.
25608 28124  ;
25609 28124  ; upon entry:
25610 28124  ; w0
25611 28124  ; w1     subproc
25612 28124  ; w2
25613 28124  ; w3 
25614 28124  
25614 28124  b. i10, j10
25615 28124  w.
25616 28124  
25616 28124  q3:  jl. w3  u50.      ; after header received: test answer header
25617 28126       jl.     u2.       ;  goto testmore
25618 28128  
25618 28128  e.                     ; end of after header received
25619 28128  \f


25619 28128  ; fpa-subproc          character level i/o
25620 28128  ; ncj, 2.01.1980
25621 28128  
25621 28128  ; after data received
25622 28128  ;
25623 28128  ; check transmission.
25624 28128  ;
25625 28128  ; upon entry:
25626 28128  ; w0
25627 28128  ; w1     subproc
25628 28128  ; w2
25629 28128  ; w3
25630 28128  
25630 28128  b. i10, j10
25631 28128  w.
25632 28128  
25632 28128  q4:  jl. w3  u60.      ; after data received: test data received
25633 28130       jl.     u2.       ;  goto testmore
25634 28132  
25634 28132  ; attention. no special action
25635 28132  
25635 28132       jl.     u2.       ;  goto testmore
25636 28134  
25636 28134  e.                     ; end of data received
25637 28134  \f


25637 28134  ; fpa-subproc          character level i/o
25638 28134  ; ncj, 2.01.1980
25639 28134  
25639 28134  ; after create
25640 28134  ;
25641 28134  ; the subproc has just been created.
25642 28134  ; no special action
25643 28134  ;
25644 28134  ; upon entry:
25645 28134  ; w0
25646 28134  ; w1     subproc
25647 28134  ; w2
25648 28134  ; w3
25649 28134  
25649 28134  b. i10, j10
25650 28134  w.
25651 28134  
25651 28134  q5:                    ; after create:
25652 28134       jl      (b101)    ;  goto return
25653 28136  
25653 28136  e.                     ; end of after create
25654 28136  
25654 28136  e.                     ; end of character level i/o
25655 28136  
25655 28136  
25655 28136  
25655 28136  ; end of subprocess-code
25656 28136  ;***********************
25657 28136  
25657 28136  e.
25658 28136  
25658 28136  ; end of fpa-driver code
25659 28136  ;***********************
25660 28136  
25660 28136  e.
25661 28136  \f


25661 28136  
25661 28136  z.    
25662 28136  c. -(:a80>8 a.1 :)  ; if not fpa then  
25663 28136  b89  = -1000  ; define standart return point
25664 28136  z.
25665 28136  \f


25665 28136  
25665 28136  m.
25665 28136                  montabinit - monitor table initialisation 17.0 beta

25666 28136  ;88.05.06 7.50 kak    queue heads and own device number inserted in dlc/ioc ext. device desriptions
25667 28136  ;88.05.24 8.15 kak   change of cpa and address base included
25668 28136  
25668 28136  
25668 28136  b.i30 w.
25669 28136  i0=88 05 24, i1=11 45 00
25670 28136  
25670 28136  ; if newtime (i0,i1) > oldtime (a133,a134) then oldtime:=newtime;
25671 28136  c.i0-a133
25672 28136    c.i0-a133-1, a133=i0, a134=i1, z.
25673 28136    c.i1-a134-1,          a134=i1, z.
25674 28136  z.
25675 28136  
25675 28136  i10=i0, i20=i1
25676 28136  
25676 28136  i15=i10/100000 , i10=i10-i15*100000 , i25=i20/100000 , i20=i20-i25*100000 
25677 28136  i14=i10/10000  , i10=i10-i14*10000  , i24=i20/10000  , i20=i20-i24*10000 
25678 28136  i13=i10/1000   , i10=i10-i13*1000   , i23=i20/1000   , i20=i20-i23*1000
25679 28136  i12=i10/100    , i10=i10-i12*100    , i22=i20/100    , i20=i20-i22*100
25680 28136  i11=i10/10     , i10=i10-i11*10     , i21=i20/10     , i20=i20-i21*10
25681 28136  
25681 28136  i2:  <:                              date  :>
25682 28160       (:i15+48:)<16+(:i14+48:)<8+46
25683 28162       (:i13+48:)<16+(:i12+48:)<8+46
25684 28164       (:i11+48:)<16+(:i10+48:)<8+32
25685 28166  
25685 28166       (:i25+48:)<16+(:i24+48:)<8+46
25686 28168       (:i23+48:)<16+(:i22+48:)<8+46
25687 28170       (:i21+48:)<16+(:i20+48:)<8+ 0
25688 28172  
25688 28172  i3:  al. w0  i2.       ; write date:
25689 28174       rs  w0  x2+0      ;   first free:=start(text);
25690 28176       al  w2  0         ;
25691 28178       jl      x3        ;   return to slang(status ok);
25692 28180  
25692 28180       jl.     i3.       ;
25693 28182  e.
25694 28182  j.
25694 28136                                date  88.05.24 11.45.00

25695 28136  
25695 28136  
25695 28136  
25695 28136  b.i0                    ; begin
25696 28136  w.i0: al. w2  i0.       ; make room:
25697 28138        jl      x3+0      ;   autoloader(end external processes);
25698 28140        jl.     i0.       ; after loading:
25699 28142    g70= k-b127 + 2
25700 28142    k = i0                ;   goto make room;
25701 28136  e.                      ; end
25702 28136                           h3=g2,  h4=g2,  h5=g2,  h6=g2,  h7=g2,  h8=g2,  h9=g2
25703 28136  h10=g2, h11=g2, h12=g2, h13=g2, h14=g2, h15=g2, h16=g2, h17=g2, h18=g2, h19=g2
25704 28136  h20=g2, h21=g2, h22=g2,                 h25=g2, h26=g2,                 h29=g2
25705 28136  h30=g2, h31=g2, h32=g2, h33=g2, h34=g2, h35=g2,                 h38=g2,
25706 28136  h80=g2, h84=g2, h90=g2,
25707 28136  
25707 28136  e.    ; end of external process segment
25708 28136  \f


25708 28136  
25708 28136  
25708 28136  
25708 28136  ; segment 4: process descriptions
25709 28136  s. k=k, h25, g400, e50, j20
25710 28136  w. b127=k, h25, k=k-2
25711 28136  
25711 28136  ; name table:
25712 28136  ; the table has one entry for each process description.
25713 28136  ; an entry contains the address of the corresponding
25714 28136  ; process description.
25715 28136  
25715 28136  w.
25716 28136  f0:                     ; name table start:
25717 28136       h22                ; remoter process
25718 28138     h23                ; host process
25719 28140     h24                ; clock process
25720 28142    f18            ; errorlog process
25721 28144  f1:                     ; first device
25722 28144  t.
25722 28144* type 

25723 28144  
25723 28144  m.
25723 28144   name table

25724 28144  
25724 28144       g0  , g1  , g2  , g3  , g4  , g5  , g6  , g7  , g8  , g9
25725 28164       g10 , g11 , g12 , g13 , g14 , g15 , g16 , g17 , g18 , g19
25726 28184       g20 , g21 , g22 , g23 , g24 , g25 , g26 , g27 , g28 , g29
25727 28204       g30 , g31 , g32 , g33 , g34 , g35 , g36 , g37 , g38 , g39
25728 28224       g40 , g41 , g42 , g43 , g44 , g45 , g46 , g47 , g48 , g49
25729 28244       g50 , g51 , g52 , g53 , g54 , g55 , g56 , g57 , g58 , g59
25730 28264       g60 , g61 , g62 , g63 , g64 , g65 , g66 , g67 , g68 , g69
25731 28284       g70 , g71 , g72 , g73 , g74 , g75 , g76 , g77 , g78 , g79
25732 28304       g80 , g81 , g82 , g83 , g84 , g85 , g86 , g87 , g88 , g89
25733 28324       g90 , g91 , g92 , g93 , g94 , g95 , g96 , g97 , g98 , g99
25734 28344  ;    g100 ,g101 ,g102 ,g103 ,g104 ,g105 ,g106 ,g107 ,g108 ,g109
25735 28344  ;    g110 ,g111 ,g112 ,g113 ,g114 ,g115 ,g116 ,g117 ,g118 ,g119
25736 28344  n.m.
25736 28344                  monitor device list in name table included

25737 28344  f2:                     ; first area
25738 28344       h7, r.a1           ; area part
25739 29044  f3:                     ; first internal
25740 29044       h8, r.a3           ; internal part
25741 29092  f4:  c98                ; name table end (used by search name)
25742 29094  
25742 29094  f13:                    ; first drum chain
25743 29094       c.(:a113-1:),h9,r.a113,z.
25744 29094  f14:                    ; first disc chain
25745 29094       c.(:a115-1:),h10,r.a115,z.
25746 29110  f15: 0                  ; chain end
25747 29112  
25747 29112  
25747 29112  ; dummy internal process:
25748 29112       -8388607          ;
25749 29114        8388605          ;
25750 29116  f5:  0                 ;  dummy process description:    kind
25751 29118       0, <:dummy:>, 0   ;  name
25752 29126       0<12 + a95        ;  stopcount=0, state= waiting for cpu
25753 29128       0                 ;  id bit 
25754 29130       k, k-2            ;  event queue
25755 29134       b2, b2            ; timer q links: initially single in queue
25756 29138  r.(:a17-a16-2:)>1
25757 29138       h1, h2            ; first, top of process
25758 29142  r.(:a19-a18:)>1
25759 29142       0<12+0            ; claims
25760 29144       0<12+0            ;
25761 29146  r.(:a301-a21:)>1
25762 29146       1<23 - 3          ; priority = almost greatest integer
25763 29148  r.(:a27-a301:)>1
25764 29152       h1                ; interrupt address
25765 29154  r.(:a170-a27:)>1
25766 29154       h1                ; escape address
25767 29156       0                 ; all params
25768 29158  r.(:a28-a171:)>1
25769 29196  ; the following sequence will be executed in the registers,
25770 29196  ; until a technical panel is mounted, and data-switches all zero:
25771 29196       gg  w3     b97    ; test for panel:
25772 29198       se  w3     0      ;    if data-switches <> 0 then
25773 29200       jl         0      ;      goto test for panel;
25774 29202       0                 ;    (i.e. when panel and dswr=0: an exception will occur here)
25775 29204  r.(:a32-a31:)>1
25776 29204       1<23              ; status
25777 29206  r.(:a33-a32:)>1
25778 29206       h0                ; ic
25779 29208  r.(:a181-a33:)>1
25780 29212       8                 ; cpa
25781 29214       0                 ; base
25782 29216       8                 ; lower write limit
25783 29218       2047<12            ; upper write limit
25784 29220       b54 ;+0<12        ; interrupt levels
25785 29222  r.(:a302-a185:)>1
25786 29224       0                 ; save area address
25787 29226  r.(:a303-a302:)>1       ; (fill up for save area, used during upstart)
25788 29238  m.
25788 29238                  dummy internal reg dump

25789 29238  
25789 29238  b. i10, j10 w.
25790 29238  h0:  gg  w3  b100     ; test for rc8000 type:
25791 29240       sh  w3  0        ; if type <> 55 then the dummy loop
25792 29242       jl      0        ; is executed in the working registers,
25793 29244       sh  w3  55        ; if mp (60 and 65) then
25794 29246       jl.     0         ; wait event;
25795 29248       al  w2  0         ;
25796 29250       jd      1<11+24   ;
25797 29252       jl.    +0        ; if cpu=55 or 50 then execute in core; in core.
25798 29254  ; when an exception occurs, registers will be dumped here:
25799 29254  h1:  0, r. a180>1      ; register dump
25800 29270       dl. w3     j0.    ;    get loop-count;
25801 29272       rs. w3     h1.+a33-a28; prepare for resuming the quick-loop: ic := 0;
25802 29274  
25802 29274  i0:                    ; check for stability of the zero:
25803 29274       gg  w0     b97    ;    if the dataswitches are not stable for
25804 29276       se  w0     0      ;      some period then
25805 29278       re.        h1.    ;      resume the register-loop;
25806 29280       al  w2  x2-1      ;    (i.e. a short period of zeroes will not
25807 29282       se  w2     0      ;      destroy the algorithm)
25808 29284       jl.        i0.    ;    goto check for stability;
25809 29286  
25809 29286  i1:                    ; technical-panel loop:
25810 29286       gg  w0     b98    ;    w0 := regsel switches;
25811 29288       gg  w1     b97    ;    w1 := dswr register;
25812 29290       sn  w1    -1      ;    if dswr = all ones
25813 29292       so  w0     2.111111<1;
25814 29294       jl.        i2.    ;       and regsel = all ones then
25815 29296       re.        h1.    ;      resume register-loop;
25816 29298  
25816 29298  i2:  sz  w0     1<1    ;    if no-display bit then
25817 29300       jl.        i1.    ;      goto normal loop;
25818 29302  
25818 29302       sl  w1     8      ;    if legal core-address then
25819 29304       sl  w1    (b12)   ;      begin
25820 29306       jl.        i3.    ;
25821 29308       di  w2  x1        ;      display(core(w1));
25822 29310       gp  w2     b99    ;      goto normal loop;
25823 29312       jl.        i1.    ;      end;
25824 29314  
25824 29314  i3:                    ; not legal address:
25825 29314                         ; used for displaying the cpu-load
25826 29314       al  w2     0      ;
25827 29316       rl  w3     b11    ;    cputime := slice
25828 29318       aa. w3     f5.+a36+2;           + runtime.dummyprocess;
25829 29320                         ; (notice: if the dummy process is interrupted
25830 29320                         ;          between the above two instructions,
25831 29320                         ;          the cputime may not be consistent,
25832 29320                         ;          but this is not considered any harm)
25833 29320       ss. w3     j1.    ;
25834 29322       al  w0     a85    ;    if cputime is not updated
25835 29324       ls  w0  x1        ;      enough then
25836 29326       sl  w0  x3        ;      goto normal loop;
25837 29328       jl.        i1.    ;
25838 29330  
25838 29330       ds. w3     j2.    ;    cpu incr := new cpu time - old cpu time;
25839 29332       aa. w3     j1.    ;    old cpu time := new cpu time;
25840 29334       ds. w3     j1.    ;
25841 29336  
25841 29336  ; get real-time increment:
25842 29336       dl  w3     b13+2  ;
25843 29338       dl. w1     j3.    ;    real incr := new time - old time;
25844 29340       ds. w3     j3.    ;    old time := new time;
25845 29342       ss  w3     2      ;
25846 29344  
25846 29344       dl. w1     j2.    ;
25847 29346       nd  w1     3      ;
25848 29348       nd  w3     7      ;
25849 29350       fm. w1     j4.    ;    5pct := cpu incr * 20.0
25850 29352       fd  w1     6      ;            div(real incr);
25851 29354  
25851 29354       cf  w1     0      ;
25852 29356  
25852 29356  ; take some kind of arithmetic mean:
25853 29356       ws. w1     j5.    ;
25854 29358       as  w1    -1      ;
25855 29360       wa. w1     j5.    ;    5pct := (5pct - old 5pct) shift (- xx)
25856 29362       rs. w1     j5.    ;      + old 5pct;
25857 29364  
25857 29364       al  w0    -1      ;
25858 29366       ls  w0  x1+4      ;    display( (-1) shift (5pct + 4) );
25859 29368       rl. w2     j6.    ;    flicker := flicker shift (-1);
25860 29370       ls  w2    -1      ;
25861 29372       sn  w2     0      ;    if no bits left in flicker then
25862 29374       al  w2     1<3    ;      flicker := 1 shift 3;
25863 29376       rs. w2     j6.    ;    (i.e. flicker is one out of four bits to the rigth)
25864 29378       wa  w0     4      ;    add flicker to cpuload;
25865 29380       gp  w0     b99    ;    (i.e. use the leftmost 20 bits, 5 pct each)
25866 29382       jl.        i1.    ;    goto normal loop;
25867 29384  
25867 29384  j0=k+2, 100000, 0      ; loopcount, zero
25868 29388  j1=k+2, 0, 0           ; old cpu time
25869 29392  j2=k+2, 0, 0           ; cpu incr
25870 29396  j3=k+2, 0, 0           ; old time
25871 29400  f.
25872 29400  j4:  20.0              ; 5-pct factor
25873 29404  w.
25874 29404  j5:  0                 ; old 5pct
25875 29406  j6:  0                 ; flicker
25876 29408  e.                     ; end of dummy process
25877 29408  h2=k                   ; top of dummy process
25878 29408  \f


25878 29408  
25878 29408  
25878 29408  
25878 29408  ; external processes.
25879 29408  
25879 29408  ; dummy external process:
25880 29408  
25880 29408       0,0,0,0,0
25881 29418       0,r.4,-4
25882 29428       jl w2 c51,k,k-2,0,0,jl (b20)
25883 29440       0,r.a401,0,0,0
25884 29448  h4:  00,<:<0><0><0>dummy:>,0
25885 29458       0,0,0,k,k-2,0
25886 29470  
25886 29470  ; remoter process:
25887 29470  
25887 29470       0,r.a401,0,a107,a108-1
25888 29478  h22: 56,<:remoter:>,0
25889 29488       0,0,0,k,k-2,0
25890 29500  
25890 29500  ; host process:
25891 29500  
25891 29500       0,r.a401,0,a107,a108
25892 29508  h23: 90,<:host:>,0,0
25893 29518       0,0,0,k,k-2,0
25894 29530  
25894 29530  ; clock process:
25895 29530  
25895 29530       0,0,0,0,0
25896 29540       0,r.4,0
25897 29550       jl w2 c49,k,k-2,0,c35,jl w1 c30
25898 29562       0,r.a401,0,a107,a108-1
25899 29570  h24: 02,<:clock:>,0,0
25900 29580       0,0,0,k,k-2,0
25901 29592  
25901 29592  
25901 29592  ; errorlog process
25902 29592        0,r.a401,0,a107,a108-1
25903 29600  f18 : 54, <:errorlog:>,0
25904 29610        0,0,0,k,k-2,0
25905 29622        0,r.40
25906 29702  
25906 29702  
25906 29702  
25906 29702  ; peripheral processes:
25907 29702  f19=k       ; start
25908 29702  t.
25908 29702* type 

25909 29702  
25909 29702  m.
25909 29702   process descriptions

25910 29702  
25910 29702  
25910 29702       0, 0, r.a401, 0, 0
25911 29710  m.
25911 29710   device 0   reader   fpa1

25912 29710  g0:  85, 0, r.34
25913 29780  
25913 29780       0, 0, r.a401, 0, 0
25914 29788  m.
25914 29788   device 1   punch   fpa1

25915 29788  g1:  85, 0, r.34
25916 29858  
25916 29858       0, 0, r.a401, 0, 0
25917 29866  m.
25917 29866   device 2   console1   fpa1

25918 29866  g2:  85, 0, r.34
25919 29936  
25919 29936       0, 0, r.a401, 0, 0
25920 29944  m.
25920 29944   device 3   console2   fpa2

25921 29944  g3:  85, 0, r.34
25922 30014  
25922 30014  g4=h4
25923 30014  
25923 30014       0, 0, r.a401, 0, 0
25924 30022  m.
25924 30022   device 5   printer   fpa1

25925 30022  g5:  85, 0, r.34
25926 30092  
25926 30092       0, 0, r.a401, 0, 0
25927 30100  m.
25927 30100   device 6   fd0   fpa1

25928 30100  g6:  85, 0, r.34
25929 30170  
25929 30170       0, 0, r.a401, a107, a108-1
25930 30178  m.
25930 30178   device 7    part1 of unit 6

25931 30178  g7:  62, <:autodisc6:>, 0, g12, 0, 0, k, k-2, 0
25932 30200       0, r.3, 0, 1050
25933 30210        
25933 30210  
25933 30210       0, 0, r.a401, a107, a108-1
25934 30218  m.
25934 30218   device 8  disc  part2 of unit 6

25935 30218  g8:  62, 0, r.4, g12, 0, 0, k, k-2, 0
25936 30240       0, r.3, 1050, 42105
25937 30250  
25937 30250       0, 0, r.a401, a107, a108-1
25938 30258  m.
25938 30258   device 9  disc  part3 of unit 6

25939 30258  g9:  62, 0, r.4, g12, 0, 0, k, k-2, 0
25940 30280       0, r.3, 43155, 43056
25941 30290  
25941 30290       0, 0, r.a401, 0, 0
25942 30298  m.
25942 30298   device 10   mt0   fpa1

25943 30298  g10:  85, 0, r.34
25944 30368  
25944 30368  g11=h4
25945 30368  
25945 30368       b.j3 w.
25946 30368       j0, j1
25947 30372       0
25948 30374       j1, j2
25949 30378       0, r.4, 1<23+16<3
25950 30388       jl w2 c51, k, k-2, 0, c34, jl w1 c30
25951 30400       0, 0, r.a401, a107, a108-1
25952 30408  m.
25952 30408   discunit 6   66 mb

25953 30408  g12: 62,<:unit6:>, 0, r.2, 000, 0, 0, k, k-2, 0
25954 30430    j0=k-g12
25955 30430       0, r.4,   86415, 21, 0, r.5, 1<23, 0, r.32  ;
25956 30518       0, r.41                                     ; statistics
25957 30600       -1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0
25958 30630       -1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0
25959 30660    j1=k-g12
25960 30660       0,r.30   ; ch pg area
25961 30720    j2=k-g12
25962 30720    e.
25963 30720  
25963 30720  g13=h4
25964 30720  
25964 30720       b.j1 w.
25965 30720       m.
25965 30720   start of testbuffer

25966 30720       j0=k, 0, r.512, j1=k
25967 31744       m.
25967 31744   top of testbuffer

25968 31744       0, 0, r.a401, a107, a108-1
25969 31752  m.
25969 31752   main36001

25970 31752  g14: 80, <:main36001:> , 0, g14, 0, 0, k, k-2, 0
25971 31774       j0, j1, j0, j1
25972 31782       8.1023 2000
25973 31784       8.0100 2000
25974 31786       8.0004 0000
25975 31788       8.7610 5542
25976 31790       0, k, k-2, 0, 0, a124<16+a125
25977 31802       0, r.56
25978 31914       e.
25979 31914  
25979 31914       b.j1 w.
25980 31914       000, 000, 0, j0, j1, 0, r.4, 1<23+2<3
25981 31934       jl w2 c51, k, k-2, 0, c43, jl w1 c30
25982 31946       0, 0, r.a401, a107, a108-1
25983 31954  m.
25983 31954   rec36001

25984 31954  g15: 86, <:rec36001:> , 0 , g14, 0, 0, k, k-2, 0
25985 31976       0, r.15, 500
25986 32008       0, r.5  ; statistics
25987 32018       j0=k-g15, 0, r.21
25988 32060       j1=k-g15
25989 32060       e.
25990 32060  
25990 32060       b.j1 w.
25991 32060       000, 000, 0, j0, j1, 0, r.4, 1<23+3<3
25992 32080       jl w2 c51, k, k-2, 0, c44, jl w1 c30
25993 32092       0, 0, r.a401, a107, a108-1
25994 32100  m.
25994 32100   trm36001

25995 32100  g16: 88, <:trm36001:> , 0 , g14, 0, 0, k, k-2, 0
25996 32122       0, r.14, 100 000, 1000
25997 32154       0, r.13 ; statitics
25998 32180       j0=k-g16, 0, r.21
25999 32222       j1=k-g16
26000 32222       e.
26001 32222  
26001 32222       0, 0, r.a401, a107, a108-1
26002 32230  m.
26002 32230   host36001

26003 32230  g17: 82, <:host36001:> , 0 , g14, 0, 0, k, k-2, 0
26004 32252       0, r.6
26005 32264       0<12+17,-2<12+0,0,k,k-2,16<12+0,24,a123<12+a124,a125,0,0,r.16
26006 32316       0, r.20
26007 32356  
26007 32356       b.j1 w.
26008 32356       m.
26008 32356   start of testbuffer

26009 32356       j0=k, 0, r.512, j1=k
26010 33380       m.
26010 33380   top of testbuffer

26011 33380       0, 0, r.a401, a107, a108-1
26012 33388  m.
26012 33388   main36002

26013 33388  g18: 80, <:main36002:> , 0, g18, 0, 0, k, k-2, 0
26014 33410       j0, j1, j0, j1
26015 33418       8.1023 2000
26016 33420       8.0100 2000
26017 33422       8.0004 0000
26018 33424       8.7610 5542
26019 33426       0, k, k-2, 0, 0, a124<16+a125
26020 33438       0, r.56
26021 33550       e.
26022 33550  
26022 33550       b.j1 w.
26023 33550       000, 000, 0, j0, j1, 0, r.4, 1<23+8<3
26024 33570       jl w2 c51, k, k-2, 0, c43, jl w1 c30
26025 33582       0, 0, r.a401, a107, a108-1
26026 33590  m.
26026 33590   rec36002

26027 33590  g19: 86, <:rec36002:> , 0 , g18, 0, 0, k, k-2, 0
26028 33612       0, r.15, 500
26029 33644       0, r.5  ; statistics
26030 33654       j0=k-g19, 0, r.21
26031 33696       j1=k-g19
26032 33696       e.
26033 33696  
26033 33696       b.j1 w.
26034 33696       000, 000, 0, j0, j1, 0, r.4, 1<23+9<3
26035 33716       jl w2 c51, k, k-2, 0, c44, jl w1 c30
26036 33728       0, 0, r.a401, a107, a108-1
26037 33736  m.
26037 33736   trm36002

26038 33736  g20: 88, <:trm36002:> , 0 , g18, 0, 0, k, k-2, 0
26039 33758       0, r.14, 100 000, 1000
26040 33790       0, r.13 ; statitics
26041 33816       j0=k-g20, 0, r.21
26042 33858       j1=k-g20
26043 33858       e.
26044 33858  
26044 33858       0, 0, r.a401, a107, a108-1
26045 33866  m.
26045 33866   host36002

26046 33866  g21: 82, <:host36002:> , 0 , g18, 0, 0, k, k-2, 0
26047 33888       0, r.6
26048 33900       0<12+21,-2<12+0,0,k,k-2,16<12+0,24,a123<12+a124,a125,0,0,r.16
26049 33952       0, r.20
26050 33992  
26050 33992  
26050 33992  
26050 33992  
26050 33992  
26050 33992       b. j1 w.
26051 33992       m.
26051 33992   start of testbuffer

26052 33992       j0=k, 0, r.512, j1=k
26053 35016       m.
26053 35016   top of testbuffer

26054 35016       0, 0, -1, 0, 0
26055 35026       jl w2 c46, 0, 0, 0, 1<23+14<3
26056 35036       jl w2 c45, k, k-2, 0
26057 35044       c36, jl w1 c30, 0, 0, r.a401, a107, a108 ; 
26058 35056  m.
26058 35056   lanmain2

26059 35056  g22: 26, <:lanmain2:>, 0, g22, 0, 0, k, k-2, 0
26060 35078       j0, j1, j0, j1
26061 35086       8.0000 0000, 8.0000 0037
26062 35090       0, r.8
26063 35106       0, r.a219, 0, r.a219, 0, r.a219
26064 35178       0, r.8
26065 35194       e.
26066 35194        
26066 35194  
26066 35194  
26066 35194       b. j1 w.
26067 35194       m.
26067 35194   start of testbuffer

26068 35194       j0=k, 0, r.512, j1=k
26069 36218       m.
26069 36218   top of testbuffer

26070 36218       0, 0, -1, 0, 0
26071 36228       jl w2 c46, 0, 0, 0, 1<23+1<3
26072 36238       jl w2 c45, k, k-2, 0
26073 36246       c36, jl w1 c30, 0, 0, r.a401, a107, a108 ; 
26074 36258  m.
26074 36258   lanmain1

26075 36258  g23: 26, <:lanmain1:>, 0, g23, 0, 0, k, k-2, 0
26076 36280       j0, j1, j0, j1
26077 36288       8.0000 0000, 8.0000 0037
26078 36292       0, r.8
26079 36308       0, r.a219, 0, r.a219, 0, r.a219
26080 36380       0, r.8
26081 36396       e.
26082 36396        
26082 36396  
26082 36396       0, 0, r.a401, a107, a108-1
26083 36404  m.
26083 36404   device 24  disc  part2 of unit 4

26084 36404  g24: 62, 0, r.4, g28, 0, 0, k, k-2, 0
26085 36426       0, r.3, 1050, 42105
26086 36436  
26086 36436       0, 0, r.a401, a107, a108-1
26087 36444  m.
26087 36444   device 25  disc1  part3 of unit 4

26088 36444  g25: 62, 0, r.4, g28, 0, 0, k, k-2, 0
26089 36466       0, r.3, 43155, 43056
26090 36476  
26090 36476  g26=h4
26091 36476  
26091 36476       0, 0, r.a401, a107, a108-1
26092 36484  m.
26092 36484   device 27    part1 of unit 4

26093 36484  g27: 62, <:autodisc4:>, 0, g28, 0, 0, k, k-2, 0
26094 36506       0, r.3, 0, 1050
26095 36516  
26095 36516       b.j3 w.
26096 36516       j0, j1
26097 36520       0
26098 36522       j1, j2
26099 36526       0, r.4, 1<23+12<3
26100 36536       jl w2 c51, k, k-2, 0, c34, jl w1 c30
26101 36548       0, 0, r.a401, a107, a108-1
26102 36556  m.
26102 36556   discunit 4   66 mb

26103 36556  g28: 62,<:unit4:>, 0, r.2, 000, 0, 0, k, k-2, 0
26104 36578    j0=k-g28
26105 36578       0, r.4,   86415, 21, 0, r.5, 1<23, 0, r.32  ;
26106 36666       0, r.41                                     ; statistics
26107 36748       -1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0
26108 36778       -1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0
26109 36808    j1=k-g28
26110 36808       0,r.30   ; ch pg area
26111 36868    j2=k-g28
26112 36868    e.
26113 36868  
26113 36868  
26113 36868  
26113 36868       b. j1 w.
26114 36868       m.
26114 36868   start of testbuffer

26115 36868       j0=k, 0, r.512, j1=k
26116 37892       m.
26116 37892   top of testbuffer

26117 37892       0, 0, -1, 0, 0
26118 37902       jl w2 c46, 0, 0, 0, 1<23+40<3
26119 37912       jl w2 c45, k, k-2, 0
26120 37920       c36, jl w1 c30, 0, 0, r.a401, a107, a108-1
26121 37932  m.
26121 37932   iocmain2

26122 37932  g29: 20, <:iocmain2:>, 0, g29, 0, 0, k, k-2, 0
26123 37954       j0, j1, j0, j1
26124 37962       8.0000 0000, 8.0000 0037
26125 37966       0, r.8
26126 37982       0, r.a219, 0, r.a219, 0, r.a219
26127 38054       0, r.8
26128 38070       e.
26129 38070  
26129 38070  
26129 38070       b. j1 w.
26130 38070       m.
26130 38070   start of testbuffer

26131 38070       j0=k, 0, r.512, j1=k
26132 39094       m.
26132 39094   top of testbuffer

26133 39094       0, 0, -1, 0, 0
26134 39104       jl w2 c46, 0, 0, 0, 1<23+4<3
26135 39114       jl w2 c45, k, k-2, 0
26136 39122       c36, jl w1 c30, 0, 0, r.a401, a107, a108-1
26137 39134  m.
26137 39134   iocmain1

26138 39134  g30: 20, <:iocmain1:>, 0, g30, 0, 0, k, k-2, 0
26139 39156       j0, j1, j0, j1
26140 39164       8.0000 0000, 8.0000 0037
26141 39168       0, r.8
26142 39184       0, r.a219, 0, r.a219, 0, r.a219
26143 39256       0, r.8
26144 39272       e.
26145 39272  
26145 39272       -1, 0, r.a401, a107, a108-1 
26146 39280  m.
26146 39280   unit00, disc on iocmain1

26147 39280  g31: 68, 0, r.4, 0, r.a215
26148 39334  
26148 39334       -1, 0, r.a401, a107, a108-1 
26149 39342  m.
26149 39342   autopart of unit00 on iocmain1

26150 39342  g32: 68, 0, r.4, 0, r.a215
26151 39396  
26151 39396       -1, 0, r.a401, a107, a108-1 
26152 39404  m.
26152 39404   logical disc on unit00

26153 39404  g33: 68, 0, r.4, 0, r.a215
26154 39458  
26154 39458       -1, 0, r.a401, a107, a108-1 
26155 39466  m.
26155 39466   free ioc/lan subprocess

26156 39466  g34: 68, 0, r.4, 0, r.a215
26157 39520  
26157 39520       -1, 0, r.a401, a107, a108-1 
26158 39528  m.
26158 39528   unit01, disc on iocmain1

26159 39528  g35: 68, 0, r.4, 0, r.a215
26160 39582  
26160 39582       -1, 0, r.a401, a107, a108-1
26161 39590  m.
26161 39590   autopart of unit01 on iocmain1

26162 39590  g36: 68, 0, r.4, 0, r.a215
26163 39644  
26163 39644       -1, 0, r.a401, a107, a108-1
26164 39652  m.
26164 39652   logical disc on unit01

26165 39652  g37: 68, 0, r.4, 0, r.a215
26166 39706  
26166 39706       -1, 0, r.a401, a107, a108-1
26167 39714  m.
26167 39714   free ioc/lan subprocess

26168 39714  g38: 68, 0, r.4, 0, r.a215
26169 39768  
26169 39768       -1, 0, r.a401, a107, a108-1
26170 39776  m.
26170 39776   unit02, disc on iocmain1

26171 39776  g39: 68, 0, r.4, 0, r.a215
26172 39830  
26172 39830       -1, 0, r.a401, a107, a108-1
26173 39838  m.
26173 39838   autopart of unit02 on iocmain1

26174 39838  g40: 68, 0, r.4, 0, r.a215
26175 39892  
26175 39892       -1, 0, r.a401, a107, a108-1
26176 39900  m.
26176 39900   logical disc on unit02

26177 39900  g41: 68, 0, r.4, 0, r.a215
26178 39954  
26178 39954       -1, 0, r.a401, a107, a108-1
26179 39962  m.
26179 39962   logical disc on unit02

26180 39962  g42: 68, 0, r.4, 0, r.a215
26181 40016  
26181 40016       -1, 0, r.a401, a107, a108-1
26182 40024  m.
26182 40024   free ioc/lan subprocess

26183 40024  g43: 68, 0, r.4, 0, r.a215
26184 40078  
26184 40078       -1, 0, r.a401, a107, a108-1
26185 40086  m.
26185 40086   free ioc/lan subprocess

26186 40086  g44: 68, 0, r.4, 0, r.a215
26187 40140  
26187 40140       -1, 0, r.a401, a107, a108-1
26188 40148  m.
26188 40148   tape00, mag tape on iocmain1, keystone 2

26189 40148  g45: 68, 0, r.4, 0, r.a215
26190 40202  
26190 40202       -1, 0, r.a401, a107, a108-1
26191 40210  m.
26191 40210   free ioc/lan subprocess

26192 40210  g46: 68, 0, r.4, 0, r.a215
26193 40264  
26193 40264       -1, 0, r.a401, a107, a108-1
26194 40272  m.
26194 40272   free ioc/lan subprocess

26195 40272  g47: 68, 0, r.4, 0, r.a215
26196 40326  
26196 40326       -1, 0, r.a401, a107, a108-1
26197 40334  m.
26197 40334   free ioc/lan subprocess

26198 40334  g48: 68, 0, r.4, 0, r.a215
26199 40388  
26199 40388       -1, 0, r.a401, a107, a108-1
26200 40396  m.
26200 40396   free ioc/lan subprocess

26201 40396  g49: 68, 0, r.4, 0, r.a215
26202 40450  
26202 40450       b.j1 w.
26203 40450       m.
26203 40450   start of testbuffer

26204 40450       j0=k, 0, r.512, j1=k
26205 41474       m.
26205 41474   top of testbuffer

26206 41474       0, 0, r.a401, a107, a108-1
26207 41482  m.
26207 41482   main36003

26208 41482  g50: 80, <:main36003:> , 0, g50, 0, 0, k, k-2, 0
26209 41504       j0, j1, j0, j1
26210 41512       8.1023 2000
26211 41514       8.0100 2000
26212 41516       8.0004 0000
26213 41518       8.7610 5542
26214 41520       0, k, k-2, 0, 0, a124<16+a125
26215 41532       0, r.56
26216 41644       e.
26217 41644  
26217 41644       b.j1 w.
26218 41644       000, 000, 0, j0, j1, 0, r.4, 1<23+10<3
26219 41664       jl w2 c51, k, k-2, 0, c43, jl w1 c30
26220 41676       0, 0, r.a401, a107, a108-1
26221 41684  m.
26221 41684   rec36003

26222 41684  g51: 86, <:rec36003:> , 0 , g50, 0, 0, k, k-2, 0
26223 41706       0, r.15, 500
26224 41738       0, r.5  ; statistics
26225 41748       j0=k-g51, 0, r.21
26226 41790       j1=k-g51
26227 41790       e.
26228 41790  
26228 41790       b.j1 w.
26229 41790       000, 000, 0, j0, j1, 0, r.4, 1<23+11<3
26230 41810       jl w2 c51, k, k-2, 0, c44, jl w1 c30
26231 41822       0, 0, r.a401, a107, a108-1
26232 41830  m.
26232 41830   trm36003

26233 41830  g52: 88, <:trm36003:> , 0 , g50, 0, 0, k, k-2, 0
26234 41852       0, r.14, 100 000, 1000
26235 41884       0, r.13 ; statitics
26236 41910       j0=k-g52, 0, r.21
26237 41952       j1=k-g52
26238 41952       e.
26239 41952  
26239 41952       0, 0, r.a401, a107, a108-1
26240 41960  m.
26240 41960   host36003

26241 41960  g53: 82, <:host36003:> , 0 , g50, 0, 0, k, k-2, 0
26242 41982       0, r.6
26243 41994       0<12+17,-2<12+0,0,k,k-2,16<12+0,24,a123<12+a124,a125,0,0,r.16
26244 42046       0, r.20
26245 42086  
26245 42086       0, 0, r.a401, 0, 0
26246 42094  m.
26246 42094   device 54   subprocess

26247 42094  g54: 85, 0, r.34
26248 42164  
26248 42164       0, 0, r.a401, 0, 0
26249 42172  m.
26249 42172   device 55   subprocess

26250 42172  g55: 85, 0, r.34
26251 42242  
26251 42242       0, 0, r.a401, 0, 0
26252 42250  m.
26252 42250   device 56   subprocess

26253 42250  g56: 85, 0, r.34
26254 42320  
26254 42320       0, 0, r.a401, 0, 0
26255 42328  m.
26255 42328   device 57   subprocess

26256 42328  g57: 85, 0, r.34
26257 42398  
26257 42398       0, 0, r.a401, 0, 0
26258 42406  m.
26258 42406   device 58   subprocess

26259 42406  g58: 85, 0, r.34
26260 42476  
26260 42476       0, 0, r.a401, 0, 0
26261 42484  m.
26261 42484   device 59   subprocess

26262 42484  g59: 85, 0, r.34
26263 42554  
26263 42554  
26263 42554  
26263 42554       0, 0, r.a401, 0, 0
26264 42562  m.
26264 42562   device 60   subprocess

26265 42562  g60: 85, 0, r.34
26266 42632  
26266 42632       0, 0, r.a401, 0, 0
26267 42640  m.
26267 42640   device 61   subprocess

26268 42640  g61: 85, 0, r.34
26269 42710  
26269 42710       0, 0, r.a401, 0, 0
26270 42718  m.
26270 42718   device 62   subprocess

26271 42718  g62: 85, 0, r.34
26272 42788  
26272 42788       0, 0, r.a401, 0, 0
26273 42796  m.
26273 42796   device 63   subprocess

26274 42796  g63: 85, 0, r.34
26275 42866  
26275 42866       0, 0, r.a401, 0, 0
26276 42874  m.
26276 42874   device 64   subprocess

26277 42874  g64: 85, 0, r.34
26278 42944  
26278 42944       0, 0, r.a401, 0, 0
26279 42952  m.
26279 42952   device 65   subprocess

26280 42952  g65: 85, 0, r.34
26281 43022  
26281 43022       0, 0, r.a401, 0, 0
26282 43030  m.
26282 43030   device 66   subprocess

26283 43030  g66: 85, 0, r.34
26284 43100  
26284 43100       0, 0, r.a401, 0, 0
26285 43108  m.
26285 43108   device 67   subprocess

26286 43108  g67: 85, 0, r.34
26287 43178  
26287 43178       0, 0, r.a401, 0, 0
26288 43186  m.
26288 43186   device 68   subprocess

26289 43186  g68: 85, 0, r.34
26290 43256  
26290 43256       0, 0, r.a401, 0, 0
26291 43264  m.
26291 43264   device 69   subprocess

26292 43264  g69: 85, 0, r.34
26293 43334  
26293 43334       -1, 0, r.a401, a107, a108-1
26294 43342  m.
26294 43342   free ioc/lan subprocess

26295 43342  g70: 68, 0, r.4, 0, r.a215
26296 43396  
26296 43396       -1, 0, r.a401, a107, a108-1
26297 43404  m.
26297 43404   free ioc/lan subprocess

26298 43404  g71: 68, 0, r.4, 0, r.a215
26299 43458  
26299 43458       -1, 0, r.a401, a107, a108-1
26300 43466  m.
26300 43466   free ioc/lan subprocess

26301 43466  g72: 68, 0, r.4, 0, r.a215
26302 43520  
26302 43520       -1, 0, r.a401, a107, a108-1
26303 43528  m.
26303 43528   free ioc/lan subprocess

26304 43528  g73: 68, 0, r.4, 0, r.a215
26305 43582  
26305 43582       -1, 0, r.a401, a107, a108-1
26306 43590  m.
26306 43590   free ioc/lan subprocess

26307 43590  g74: 68, 0, r.4, 0, r.a215
26308 43644  
26308 43644       -1, 0, r.a401, a107, a108-1
26309 43652  m.
26309 43652   free ioc/lan subprocess

26310 43652  g75: 68, 0, r.4, 0, r.a215
26311 43706  
26311 43706       -1, 0, r.a401, a107, a108-1
26312 43714  m.
26312 43714   free ioc/lan subprocess

26313 43714  g76: 68, 0, r.4, 0, r.a215
26314 43768  
26314 43768       -1, 0, r.a401, a107, a108-1
26315 43776  m.
26315 43776   free ioc/lan subprocess

26316 43776  g77: 68, 0, r.4, 0, r.a215
26317 43830  
26317 43830       -1, 0, r.a401, a107, a108-1
26318 43838  m.
26318 43838   free ioc/lan subprocess

26319 43838  g78: 68, 0, r.4, 0, r.a215
26320 43892  
26320 43892       -1, 0, r.a401, a107, a108-1
26321 43900  m.
26321 43900   free ioc/lan subprocess

26322 43900  g79: 68, 0, r.4, 0, r.a215
26323 43954  
26323 43954       -1, 0, r.a401, a107, a108-1
26324 43962  m.
26324 43962   free ioc/lan subprocess

26325 43962  g80: 68, 0, r.4, 0, r.a215
26326 44016  
26326 44016       -1, 0, r.a401, a107, a108-1
26327 44024  m.
26327 44024   free ioc/lan subprocess

26328 44024  g81: 68, 0, r.4, 0, r.a215
26329 44078  
26329 44078       -1, 0, r.a401, a107, a108-1
26330 44086  m.
26330 44086   free ioc/lan subprocess

26331 44086  g82: 68, 0, r.4, 0, r.a215
26332 44140  
26332 44140       -1, 0, r.a401, a107, a108-1
26333 44148  m.
26333 44148   free ioc/lan subprocess

26334 44148  g83: 68, 0, r.4, 0, r.a215
26335 44202  
26335 44202       -1, 0, r.a401, a107, a108-1
26336 44210  m.
26336 44210   free ioc/lan subprocess

26337 44210  g84: 68, 0, r.4, 0, r.a215
26338 44264  
26338 44264       -1, 0, r.a401, a107, a108-1
26339 44272  m.
26339 44272   free ioc/lan subprocess

26340 44272  g85: 68, 0, r.4, 0, r.a215
26341 44326  
26341 44326       -1, 0, r.a401, a107, a108-1
26342 44334  m.
26342 44334   free ioc/lan subprocess

26343 44334  g86: 68, 0, r.4, 0, r.a215
26344 44388  
26344 44388       -1, 0, r.a401, a107, a108-1
26345 44396  m.
26345 44396   free ioc/lan subprocess

26346 44396  g87: 68, 0, r.4, 0, r.a215
26347 44450  
26347 44450       -1, 0, r.a401, a107, a108-1
26348 44458  m.
26348 44458   free ioc/lan subprocess

26349 44458  g88: 68, 0, r.4, 0, r.a215
26350 44512  
26350 44512       -1, 0, r.a401, a107, a108-1
26351 44520  m.
26351 44520   free ioc/lan subprocess

26352 44520  g89: 68, 0, r.4, 0, r.a215
26353 44574  
26353 44574       -1, 0, r.a401, a107, a108-1
26354 44582  m.
26354 44582   free ioc/lan subprocess

26355 44582  g90: 68, 0, r.4, 0, r.a215
26356 44636  
26356 44636       -1, 0, r.a401, a107, a108-1
26357 44644  m.
26357 44644   free ioc/lan subprocess

26358 44644  g91: 68, 0, r.4, 0, r.a215
26359 44698  
26359 44698       -1, 0, r.a401, a107, a108-1
26360 44706  m.
26360 44706   free ioc/lan subprocess

26361 44706  g92: 68, 0, r.4, 0, r.a215
26362 44760  
26362 44760       -1, 0, r.a401, a107, a108-1
26363 44768  m.
26363 44768   free ioc/lan subprocess

26364 44768  g93: 68, 0, r.4, 0, r.a215
26365 44822  
26365 44822       -1, 0, r.a401, a107, a108-1
26366 44830  m.
26366 44830   free ioc/lan subprocess

26367 44830  g94: 68, 0, r.4, 0, r.a215
26368 44884  
26368 44884       -1, 0, r.a401, a107, a108-1
26369 44892  m.
26369 44892   free ioc/lan subprocess

26370 44892  g95: 68, 0, r.4, 0, r.a215
26371 44946  
26371 44946       -1, 0, r.a401, a107, a108-1
26372 44954  m.
26372 44954   free ioc/lan subprocess

26373 44954  g96: 68, 0, r.4, 0, r.a215
26374 45008  
26374 45008       -1, 0, r.a401, a107, a108-1
26375 45016  m.
26375 45016   free ioc/lan subprocess

26376 45016  g97: 68, 0, r.4, 0, r.a215
26377 45070  
26377 45070       -1, 0, r.a401, a107, a108-1
26378 45078  m.
26378 45078   free ioc/lan subprocess

26379 45078  g98: 68, 0, r.4, 0, r.a215
26380 45132  
26380 45132       -1, 0, r.a401, a107, a108-1
26381 45140  m.
26381 45140   free ioc/lan subprocess

26382 45140  g99: 68, 0, r.4, 0, r.a215
26383 45194  
26383 45194  c.-1
26384 45194  
26384 45194       -1, 0, r.a401, a107, a108-1
26385 45194  m. free ioc/lan subprocess
26386 45194  g100: 68, 0, r.4, 0, r.a215
26387 45194  
26387 45194       -1, 0, r.a401, a107, a108-1
26388 45194  m. free ioc/lan subprocess
26389 45194  g101: 68, 0, r.4, 0, r.a215
26390 45194  
26390 45194       -1, 0, r.a401, a107, a108-1
26391 45194  m. free ioc/lan subprocess
26392 45194  g102: 68, 0, r.4, 0, r.a215
26393 45194  
26393 45194       -1, 0, r.a401, a107, a108-1
26394 45194  m. free ioc/lan subprocess
26395 45194  g103: 68, 0, r.4, 0, r.a215
26396 45194  
26396 45194       -1, 0, r.a401, a107, a108-1
26397 45194  m. free ioc/lan subprocess
26398 45194  g104: 68, 0, r.4, 0, r.a215
26399 45194  
26399 45194       -1, 0, r.a401, a107, a108-1
26400 45194  m. free ioc/lan subprocess
26401 45194  g105: 68, 0, r.4, 0, r.a215
26402 45194  
26402 45194       -1, 0, r.a401, a107, a108-1
26403 45194  m. free ioc/lan subprocess
26404 45194  g106: 68, 0, r.4, 0, r.a215
26405 45194  
26405 45194       -1, 0, r.a401, a107, a108-1
26406 45194  m. free ioc/lan subprocess
26407 45194  g107: 68, 0, r.4, 0, r.a215
26408 45194  
26408 45194       -1, 0, r.a401, a107, a108-1
26409 45194  m. free ioc/lan subprocess
26410 45194  g108: 68, 0, r.4, 0, r.a215
26411 45194  
26411 45194       -1, 0, r.a401, a107, a108-1
26412 45194  m. free ioc/lan subprocess
26413 45194  g109: 68, 0, r.4, 0, r.a215
26414 45194  
26414 45194       -1, 0, r.a401, a107, a108-1
26415 45194  m. free ioc/lan subprocess
26416 45194  g100: 68, 0, r.4, 0, r.a215
26417 45194  
26417 45194       -1, 0, r.a401, a107, a108-1
26418 45194  m. free ioc/lan subprocess
26419 45194  g111: 68, 0, r.4, 0, r.a215
26420 45194  
26420 45194       -1, 0, r.a401, a107, a108-1
26421 45194  m. free ioc/lan subprocess
26422 45194  g112: 68, 0, r.4, 0, r.a215
26423 45194  
26423 45194       -1, 0, r.a401, a107, a108-1
26424 45194  m. free ioc/lan subprocess
26425 45194  g113: 68, 0, r.4, 0, r.a215
26426 45194  
26426 45194       -1, 0, r.a401, a107, a108-1
26427 45194  m. free ioc/lan subprocess
26428 45194  g114: 68, 0, r.4, 0, r.a215
26429 45194  
26429 45194       -1, 0, r.a401, a107, a108-1
26430 45194  m. free ioc/lan subprocess
26431 45194  g115: 68, 0, r.4, 0, r.a215
26432 45194  
26432 45194       -1, 0, r.a401, a107, a108-1
26433 45194  m. free ioc/lan subprocess
26434 45194  g116: 68, 0, r.4, 0, r.a215
26435 45194  
26435 45194       -1, 0, r.a401, a107, a108-1
26436 45194  m. free ioc/lan subprocess
26437 45194  g117: 68, 0, r.4, 0, r.a215
26438 45194  
26438 45194       -1, 0, r.a401, a107, a108-1
26439 45194  m. free ioc/lan subprocess
26440 45194  g118: 68, 0, r.4, 0, r.a215
26441 45194  
26441 45194       -1, 0, r.a401, a107, a108-1
26442 45194  m. free ioc/lan subprocess
26443 45194  g119: 68, 0, r.4, 0, r.a215
26444 45194  
26444 45194  z.
26445 45194  
26445 45194  
26445 45194  n.m.
26445 45194                  monitor peripheral process descriptions included

26446 45194  
26446 45194  f20=k       ; top
26447 45194  
26447 45194  m.
26447 45194   start of pu information table

26448 45194  
26448 45194  f21: f22               ; address of pu-table
26449 45196       0                 ; inf register
26450 45198       0                 ; mon top register
26451 45200       0                 ; core size register
26452 45202       a27               ; exception address offset
26453 45204       a28               ; register dump offset
26454 45206                         ;
26455 45206  
26455 45206  m.
26455 45206   start of pu table

26456 45206  
26456 45206  f22: 1                 ; no of free pu
26457 45208       0                 ; pu no 0 (i-o pu)
26458 45210      -1                 ; pu no 1
26459 45212      -1                 ; pu no 2
26460 45214      -1                 ; pu no 3
26461 45216                         ;
26462 45216  ; real time clock table
26463 45216  ; initially holding the mp devicenumbers
26464 45216  
26464 45216  f23: 0                 ; rtc table, pu no 0
26465 45218       0                 ;            pu no 1
26466 45220       0                 ;            pu no 2
26467 45222       0                 ;            pu no 3
26468 45224  f24:                   ; top of rtc table
26469 45224  
26469 45224  
26469 45224  a300 = f21             ; address of pu information table
26470 45224  
26470 45224  ; external interrupt table:
26471 45224  ;
26472 45224  b53: c2                ; integer interrupt etc:
26473 45226       c2                ;
26474 45228       c2                ;
26475 45230  ; the next entries pertain to various cpu- or system faults:
26476 45230       c2                ; limit violation (due to monitor bugs)
26477 45232       c4                ; bus error , during operand transfer
26478 45234       c5                ; bus error , during instruction fetch
26479 45236       c6                ; power failure
26480 45238       h24+a240          ; clock
26481 45240       c99               ; dummy interrupt - pu may never enter monitor with 
26482 45242                         ; interrupt level 8 - reserved for rtc information.
26483 45242  ; the remaining entries are inserted via the monitor options:
26484 45242  t.
26484 45242* type 

26485 45242  
26485 45242  m.
26485 45242   interrupt table 

26486 45242                     ; interrupt level:
26487 45242     g15+a240        ;  9
26488 45244     g16+a240        ; 10
26489 45246     g30+a240        ; 11
26490 45248     g30+a228        ; 12
26491 45250     g28+a240        ; 13
26492 45252     0               ; 14
26493 45254     g19+a240        ; 15
26494 45256     g20+a240        ; 16
26495 45258     g23+a240        ; 17
26496 45260     g23+a228        ; 18
26497 45262     0               ; 19
26498 45264     g51+a240        ; 20
26499 45266     g52+a240        ; 21
26500 45268     g29+a240        ; 22
26501 45270     g29+a228        ; 23
26502 45272     g22+a240        ; 24
26503 45274     g22+a228        ; 25
26504 45276  n.m.
26504 45276                  monitor interrupt table included

26505 45276  
26505 45276  b54 = (:k - b53:) > 1 - 1; max interrupt number
26506 45276                           ;
26507 45276  f25: 0, r.(:b54+1:)<1    ; interrupt count table
26508 45380                           ;
26509 45380  
26509 45380  
26509 45380  ; controller description table:
26510 45380  ;
26511 45380  ; each entry consists (initially) of:
26512 45380  ;               normal controller    ida-ifp controller      mpu
26513 45380  ;
26514 45380  ; entry + a310:  irrelevant           comm. area address     pu-inf table address
26515 45380  ; entry + a311:  dev descr + a230     dev descr + a230       irrelevant
26516 45380  ; entry + a312:  io cpu address       io cpu address         irrelevant
26517 45380  ; entry + a313:  interrupt level      interrupt level        irrelevant
26518 45380  ;
26519 45380  f16:                   ; start of controller table:
26520 45380  t.
26520 45380* type 

26521 45380  m.
26521 45380   controller table

26522 45380                                  ; i/o address of device:
26523 45380     a300,0,0,0                   ;   0  io-pu
26524 45388     g23+a500,g23+a228,a198,17    ;   1  lan no.1
26525 45396     0,g15+a230,a198,9            ;   2  fpa rec
26526 45404     0,g16+a230,a198,10           ;   3  fpa trm
26527 45412     g30+a500,g30+a228,a198,11    ;   4  ioc no.1
26528 45420     0,0,0,0                      ;   5          
26529 45428     0,0,0,0                      ;   6          
26530 45436     0,0,0,0                      ;   7          
26531 45444     0,g19+a230,a198,15           ;   8  2ed fpa rec
26532 45452     0,g20+a230,a198,16           ;   9  2ed fpa trm
26533 45460     0,g51+a230,a198,20           ;  10  3ed fpa rec
26534 45468     0,g52+a230,a198,21           ;  11  3ed fpa trm
26535 45476     0,g28+a230,a198,13           ;  12  disc 66 mb
26536 45484     0,0,0,0                      ;  13  
26537 45492     g22+a500,g22+a228,a198,24    ;  14  lan no.2
26538 45500     0,0,0,0                      ;  15
26539 45508     0,0,0,0                      ;  16
26540 45516     0,0,0,0                      ;  17
26541 45524     0,0,0,0                      ;  18
26542 45532     0,0,0,0                      ;  19
26543 45540     0,0,0,0                      ;  20
26544 45548     0,0,0,0                      ;  21
26545 45556     0,0,0,0                      ;  22
26546 45564     0,0,0,0                      ;  23
26547 45572     0,0,0,0                      ;  24
26548 45580     0,0,0,0                      ;  25
26549 45588     0,0,0,0                      ;  26
26550 45596     0,0,0,0                      ;  27
26551 45604     0,0,0,0                      ;  28
26552 45612     a300,0,0,0                   ;  29  2ed cpu
26553 45620     a300,0,0,0                   ;  30  3ed cpu
26554 45628     a300,0,0,0                   ;  31  4th cpu
26555 45636     0,0,0,0                      ;  32
26556 45644     0,0,0,0                      ;  33
26557 45652     0,0,0,0                      ;  34
26558 45660     0,0,0,0                      ;  35
26559 45668     0,0,0,0                      ;  36
26560 45676     0,0,0,0                      ;  37
26561 45684     0,0,0,0                      ;  38
26562 45692     0,0,0,0                      ;  39
26563 45700     g29+a500,g29+a228,a198,22    ;  40  ioc no.2 (dcm801)
26564 45708  n.m.
26564 45708                  monitor controller table included

26565 45708  f17:                   ; top   of controller table
26566 45708  
26566 45708  
26566 45708  
26566 45708  a114=a114+a88+2, a114=a114+(:a114 a. 1:)
26567 45708  a116=a116+a88+2, a116=a116+(:a116 a. 1:)
26568 45708  
26568 45708  a127=(:f2-f1:)>1        ; number of peripheral processes
26569 45708  
26569 45708  ; area processes:
26570 45708    f7=k, h7=f7-a349
26571 45708  ; internal processes:
26572 45708    f8=f7 + a1*a2, h8=f8+4
26573 45708  ; drum chains:
26574 45708    f11=f8 + a3*a4, h9=f11+a88+2
26575 45708  ; disc chains:
26576 45708    f12=f11 + a113*a114, h10=f12+a88+2
26577 45708  ; message buffers:
26578 45708    f9=f12 + a115*a116, f10=f9 + a5*a6 - 2
26579 45708  
26579 45708  ; monitor entries used globally:
26580 45708    b29 = h8  ; first internal process
26581 45708    b33 = d119; remove writeprotection
26582 45708    b35 = d5  ; remove
26583 45708    b36 = d6  ; link
26584 45708    b37 = d123; remove user
26585 45708    b39 = d125; insert reserver
26586 45708    b40 = d73 ; max base - (1,1)
26587 45708    b44 = d5  ; remove(elem)
26588 45708    b45 = d72 ; max base
26589 45708    b46 = d126; insert user
26590 45708    b47 = d102; check user
26591 45708    b48 = d76 ; test users and reserver
26592 45708  c.(:a399>22a.1:)-1
26593 45708    b160= f0  ; first of name table
26594 45708  z.
26595 45708  
26595 45708  b.i1                    ; begin
26596 45708  w.i0: rl. w2  i1.       ; make room:
26597 45710        jl      x3+0      ;   autoloader(chaintable end + 2);
26598 45712    i1: f10+2             ; after loading:
26599 45714        jl.     i0.       ;   goto make room;
26600 45716  e.                      ; end
26601 45716  i.
26602 45716    h25=k - b127 + 2
26603 45716  e.    ; end of process description segment
26604 45716  
26604 45716    k = b29-4 + a3 * a4 + a5 * a6 + a113*a114 + a115*a116
26605 100056  ; comment: k = absolute top address of monitor.
26606 100056  \f


26606 100056  
26606 100056  
26606 100056  ; segment 5: initialize monitor
26607 100056  ; this segment initializes monitor table, process descriptions,
26608 100056  ; and buffers within the monitor as follows:
26609 100056  ; monitor table:
26610 100056  ;      initialized as defined on page 6
26611 100056  ; area process descriptions:
26612 100056  ;      description address is placed in name table
26613 100056  ;      description is initialized to zero
26614 100056  ;      kind is set to 4
26615 100056  ; internal process descriptions:
26616 100056  ;      description address is placed in name table
26617 100056  ;      description is initialized to zero
26618 100056  ;      identification bit is set to 1<n
26619 100056  ;      next and last event are set to next event
26620 100056  ; message and console buffers:
26621 100056  ;      buffer is initialized to zero
26622 100056  ;      buffer is linked to pool
26623 100056  ; after return to the autoloader, the segment is removed.
26624 100056  
26624 100056  s.k=k, g30              ; begin
26625 100056  w.b127=k, g30, k=k-2
26626 100056  w.g1: rs. w3  g8.       ; start:
26627 100058  
26627 100058  ; get number of storage bytes
26628 100058       gg  w1     b92    ;    w1 := core size;
26629 100060       rs  w1     b12    ;    save core size in monitor table
26630 100062       gg  w3     b100   ;    pu kind offset := 
26631 100064       al  w1     2      ;    if cpu kind = mpu then
26632 100066       se  w3     60     ;    2
26633 100068       sn  w3     65     ;    else
26634 100070       sz                ;    not mpu offset;
26635 100072       al  w1     a8     ;
26636 100074       rs  w1     b9     ;
26637 100076  
26637 100076  ; initialize other parts of monitor table:
26638 100076       al. w3     g10.   ;
26639 100078  g16: dl  w2  x3+2      ;
26640 100080       al  w3  x3+4      ;
26641 100082       rs  w2  x1        ;
26642 100084       se  w1     0      ;
26643 100086       jl.        g16.   ;
26644 100088  
26644 100088       rl  w2  b4        ; name table:
26645 100090  g0:  rl  w0 (x2+a10)   ;
26646 100092       rl  w3  x2     ; w3:=proc
26647 100094       sn  w0  86        ;
26648 100096       jl.     g7.       ;
26649 100098       se  w0  88        ;   if kind(proc)=fparec,trm then
26650 100100       jl.     g2.       ;     initiate first,top own area;
26651 100102  g7:  dl. w1  g13.      ;
26652 100104       ws  w0  6         ;
26653 100106       ws  w1  6         ;
26654 100108       ds  w1  x3+a221   ;
26655 100110       rl. w0     g18. ; insert s as user
26656 100112       rs  w0  x3+a402 ;
26657 100114       jl.        g17. ; goto next proc
26658 100116  g2:  sn  w0     62   ; if kind := disc or
26659 100118       jl.        g15. ; if kind := main or
26660 100120       sn  w0     80   ; if kind := subhost
26661 100122       jl.        g15. ;
26662 100124       sn  w0     20   ; if kind = idamain or
26663 100126       jl.        g15. ;
26664 100128       sn  w0     26   ;    kind = ifpmain 
26665 100130       jl.        g15. ;   
26666 100132       se  w0     82   ; then 
26667 100134       jl.        g17. ;
26668 100136  g15: rl. w1     g18. ; begin
26669 100138       se  w0     26     ;
26670 100140       sn  w0     82   ; insert s as user
26671 100142       lo. w1     g9.  ; if kind=ifpmain or kind = subhost then
26672 100144       rs  w1  x3+a402 ; insert procfunc as user ; end ;
26673 100146  g17:                 ; next proc :
26674 100146       sn  w0     q68    ; if dlc or ioc
26675 100148       jl.        g20.   ;    device then
26676 100150       sn  w0     q20    ;
26677 100152       jl.        g20.   ;
26678 100154       se  w0     q26    ;
26679 100156       jl.        g19.   ;
26680 100158  g20: al  w0  x2        ;   insert device number
26681 100160       ws  w0     b4     ;
26682 100162       ls  w0    -1      ;
26683 100164       rs  w0  x3+a59    ;
26684 100166       al  w1  x3+a81    ;   insert
26685 100168       al  w0  x1        ;   queue heads
26686 100170       ds  w1  x3+a81+2  ;
26687 100172       al  w1  x3+a54    ;
26688 100174       al  w0  x1        ;
26689 100176       ds  w1  x3+a55    ;
26690 100178  g19:
26691 100178       al  w2  x2+2      ;
26692 100180       se  w2 (b5)       ;
26693 100182       jl.     g0.       ;
26694 100184  
26694 100184        al  w0  0         ;
26695 100186        rl  w2 (b5)       ;
26696 100188        al  w2  x2+a349   ;
26697 100190    g3: rs  w0  x2        ;
26698 100192        al  w2  x2+2      ;   for addr:= name table(first area)
26699 100194        sh  w2 (b8+6)     ;   step 2 until console pool end
26700 100196        jl.     g3.       ;   do word(addr):= 0;
26701 100198        rl  w2  b5        ;   entry:= first area;
26702 100200        rl  w3  x2+0      ;   proc:= name table(entry);
26703 100202        al  w0  4         ; area process:
26704 100204    g4: rs  w3  x2+0      ;   name table(entry):= proc;
26705 100206        rs  w0  x3+0      ;   kind(proc):= 4;
26706 100208        al  w2  x2+2      ;   entry:= entry + 2;
26707 100210        al  w3  x3+a2     ;   proc:= proc + area proc size;
26708 100212        se  w2 (b6)       ;   if entry <> first internal
26709 100214        jl.     g4.       ;   then goto area process;
26710 100216        rl. w0  g9.       ;   id bit:= 1 shift 23;
26711 100218        rl  w3  x2        ;    proc:=name table(entry);
26712 100220                          ; internal process:
26713 100220        al  w0  a402      ;    halfword:= first;
26714 100222        bz. w1     g9.    ;    id-bit:=2.1000 0000 0000
26715 100224  g5:   rs  w3  x2        ;    name table(entry):=proc;
26716 100226        hs  w0  x3+a14    ;    id-bit(proc):=id-bit;
26717 100228        hs  w1  x3+a14+1  ;    halfword(proc):=halfword;
26718 100230        ls  w1  -1        ;    id-bit:=id-bit shift (-1);
26719 100232        se  w1  0         ;    if id-bit.halfword<>0 then
26720 100234        jl.     g14.      ;    goto g14
26721 100236        ba. w0  1         ;    else halfword:=next halfword;
26722 100238        bz. w1     g9.    ;    id-bit:=2.1000 0000 0000
26723 100240                          ;    set queue:
26724 100240  g14:  al  w3  x3+a15    ;    next(event q(proc) ):=
26725 100242        rs  w3  x3        ;    last(event q(proc) ):=
26726 100244        rs  w3  x3+2      ;    event q(proc);
26727 100246        al  w3  x3+a4-a15 ;    proc:=next proc;
26728 100248        al  w2  x2+2      ;
26729 100250        se  w2 (b7)       ;    if if entry<> name table end then
26730 100252        jl.     g5.       ;    goto internal process;
26731 100254        al  w1  a46       ; claims rel addr:=first claim
26732 100256        al  w0  0         ;
26733 100258  c.   (:a113-1:)
26734 100258        rl  w2  b22       ;   entry:= first drum chain
26735 100258        rl  w3  x2        ; chain:= nametable(entry)
26736 100258    g11:rs  w3  x2        ; nametable(entry):=chain
26737 100258        rs  w0  x3-a88+16 ; state(chain):= free
26738 100258        rs  w1  x3-a88-2  ; claims rel addr(chain):=claims rel addr
26739 100258        al  w2  x2+2      ; entry:=entry+2
26740 100258        am      a88+2     ;
26741 100258        al  w3  x3+a114-a88-2; chain:=chain+drumchain size
26742 100258       al  w1  x1+a110*4+4; bs_claims rel addr:=bs_claims rel addr +(max key+1)*4 
26743 100258        se  w2 (b23)      ; if entry<>first disc chain
26744 100258        jl.     g11.      ; then goto drum chain
26745 100258  z.
26746 100258  c.   (:a115-1:)
26747 100258        rl  w2  b23       ;   entry:= first disc chain
26748 100260        rl  w3  x2        ;
26749 100262    g12:rs  w3  x2        ;
26750 100264        rs  w0  x3-a88+16 ;
26751 100266        rs  w1  x3-a88-2  ;
26752 100268        al  w2  x2+2      ;
26753 100270        am      a88+2     ;
26754 100272        al  w3  x3+a116-a88-2;chain:=chain+discchain size
26755 100274       al  w1  x1+a110*4+4; bs_claims rel addr:=bs_claims rel addr +(max key+1)*4
26756 100276        se  w2 (b24)      ; if entry<>chain end
26757 100278        jl.     g12.      ; then goto disc chain
26758 100280  z.
26759 100280        al  w1  b8        ;
26760 100282        rl  w2  b8+4      ;
26761 100284       al  w2  x2+a7     ;   <* adjust for the negative part of the message *>
26762 100286    g6: jl  w3  b36       ;   for buf:= first buf(mess pool)
26763 100288        wa  w2  b8+8      ;   step buf size(mess pool)
26764 100290        sh  w2 (b8+6)     ;   until last buf(mess pool)
26765 100292        jl.     g6.       ;   do link (mess pool, buf);
26766 100294  c.(:a399>22a.1:)-1
26767 100294        rl  w0     b12    ;   high core address.last :=
26768 100294        sh  w0     -1     ;   if montop > 8MHW then
26769 100294        rs  w0     b28    ;     8MHW else montop
26770 100294        rl  w3     b3     ;     high core address.first:=name table start
26771 100294        rs  w3     b28-2  ;
26772 100294  z.
26773 100294        al. w2  g1.       ;
26774 100296        jl.    (g8.)      ;   autoloader(start);
26775 100298  
26775 100298  g8:  0
26776 100300  g9:  1<23
26777 100302  g18:  1<22              ; s user bit
26778 100304       f19               ;
26779 100306  g13: f20               ;
26780 100308  
26780 100308  ; monitor table initialization:
26781 100308  ;
26782 100308  ;    address contents
26783 100308  
26783 100308  g10:
26784 100308       b0     , b53 - b16         ;
26785 100312       b2     , f5+a16            ;
26786 100316       b2+2   , f5+a16            ;
26787 100320       b3     , f0                ;
26788 100324       b4     , f1                ;
26789 100328       b5     , f2                ;
26790 100332       b6     , f3                ;
26791 100336       b7     , f4                ;
26792 100340       b8+4   , f9                ;
26793 100344       b8+6   , f10               ;
26794 100348       b21    , b29+2*a4          ;
26795 100352       b22    , f13               ;
26796 100356       b23    , f14               ;
26797 100360       b24    , f15               ;
26798 100364       b30    , f18
26799 100368       b65    , f16               ;
26800 100372       b38    , f23               ;
26801 100376       b59    , f21               ;
26802 100380       b67    , f16               ;
26803 100384       b68    , f17               ;
26804 100388       b72    , b53               ;
26805 100392       b73    , b54               ;
26806 100396  b79    , f25               ;
26807 100400       b101   , b89               ;
26808 100404       b102   , a66               ;
26809 100408  
26809 100408  ; insert in monitor table copies:
26810 100408       b128+0 , f0                ;
26811 100412       b128+2 , f1                ;
26812 100416       b128+4 , f2                ;
26813 100420       b128+6 , f3                ;
26814 100424       b128+8 , f4                ;
26815 100428       b128+10, f9                ;
26816 100432       b128+12, f10               ;
26817 100436       b128+14, f13               ;
26818 100440       b128+16, f14               ;
26819 100444       b128+18, f15               ;
26820 100448       b128+22, b86               ;
26821 100452  b128+26, f21               ;
26822 100456  b128+28, f25               ;
26823 100460  b128+30, b80               ;
26824 100464       
26824 100464       0 ; end of table
26825 100466  
26825 100466       jl.        g1.             ; after loading: goto start
26826 100468  
26826 100468    g30=k-b127 + 2 
26827 100468  k=g1
26828 100056  ;comment: k = absolute first address of initialize monitor
26829 100056  i.
26830 100056  e.   ; end of initialize monitor segment
26831 100056  
26831 100056  e.   ; end of monitor block with c, d, e,and f names
26832 100056  \f


26832 100056  
26832 100056  m.
26832 100056                  monprocfnc1 - monitor process functions, part 1 17.0 beta

26833 100056  ;88.05.24    08.40  kak  change of cpa and address base included
26834 100056  ;89 05 23 09.15 kak remove area changed: main address not cleared
26835 100056  ;                                        no result inserted in buffs used by the areaprocess
26836 100056  ;                   a new procedure: find idle area     introducted
26837 100056  ;89 05 25 08.05 kak -  -     -     : clean area processs     -
26838 100056  ;89 11 21 15 24 kak an error in find idle area corrected
26839 100056  
26839 100056  b.i30 w.
26840 100056  i0=89 05 25, i1=15 21 00
26841 100056  
26841 100056  ; if newtime (i0,i1) > oldtime (a133,a134) then oldtime:=newtime;
26842 100056  c.i0-a133
26843 100056    c.i0-a133-1, a133=i0, a134=i1, z.
26844 100056    c.i1-a134-1,          a134=i1, z.
26845 100056  z.
26846 100056  
26846 100056  i10=i0, i20=i1
26847 100056  
26847 100056  i15=i10/100000 , i10=i10-i15*100000 , i25=i20/100000 , i20=i20-i25*100000 
26848 100056  i14=i10/10000  , i10=i10-i14*10000  , i24=i20/10000  , i20=i20-i24*10000 
26849 100056  i13=i10/1000   , i10=i10-i13*1000   , i23=i20/1000   , i20=i20-i23*1000
26850 100056  i12=i10/100    , i10=i10-i12*100    , i22=i20/100    , i20=i20-i22*100
26851 100056  i11=i10/10     , i10=i10-i11*10     , i21=i20/10     , i20=i20-i21*10
26852 100056  
26852 100056  i2:  <:                              date  :>
26853 100080       (:i15+48:)<16+(:i14+48:)<8+46
26854 100082       (:i13+48:)<16+(:i12+48:)<8+46
26855 100084       (:i11+48:)<16+(:i10+48:)<8+32
26856 100086  
26856 100086       (:i25+48:)<16+(:i24+48:)<8+46
26857 100088       (:i23+48:)<16+(:i22+48:)<8+46
26858 100090       (:i21+48:)<16+(:i20+48:)<8+ 0
26859 100092  
26859 100092  i3:  al. w0  i2.       ; write date:
26860 100094       rs  w0  x2+0      ;   first free:=start(text);
26861 100096       al  w2  0         ;
26862 100098       jl      x3        ;   return to slang(status ok);
26863 100100  
26863 100100       jl.     i3.       ;
26864 100102  e.
26865 100102  j.
26865 100056                                date  89.05.25 15.21.00

26866 100056  
26866 100056  ; rc date
26867 100056  
26867 100056  ; rc 4000 systems tape, segment 6:  process functions.
26868 100056  ;   leif svalgaard / jørn jensen
26869 100056  ;   catalog administration; creation, removal, and
26870 100056  ;   start and stop of processes.
26871 100056  
26871 100056  ; the code includes certain test options selected by bits in the identifier
26872 100056  ;   a92 as follows:
26873 100056  ;   test call included:   a92 = a92 o. 1<19
26874 100056  ;   monitor test output:  a92 = a92 o. 1<20
26875 100056  ;   print w, type w:      a92 = a92 o. 1<21
26876 100056  
26876 100056  
26876 100056  s.   c10, d50, e99, f100, i70, j21, l150, m280, n50, p65, r7, t40, v40
26877 100056  
26877 100056  
26877 100056  c.(:a399>23a.1:)-1
26878 100056  h.
26879 100056  0,r.(:(:(:(:k+2047:)/2048:)*2048:) - k:); (first address:=(first address+2047)//2048)*2048;
26880 100056  w.
26881 100056  m.                    1. address
26882 100056  z.
26883 100056  
26883 100056  b60:                           ; start of proc func
26884 100056  w.b127=k, j21, k=k-2
26885 100056  
26885 100056  ; use of slang names:
26886 100056  ;   a:   monitor constants, declared and defined before proc func
26887 100056  ;   b:   monitor absolute entry addresses,  -       -     -   -
26888 100056  ;   c:   global full word constants
26889 100056  ;   d:   global variables, start addresses for records
26890 100056  ;   e:   procedures, mostly called with w3 as return register
26891 100056  ;   f:   constant names, relative addresses in records
26892 100056  ;   g:   local labels in procedures and actions
26893 100056  ;   i:   process functions (actions)
26894 100056  ;   j:   global points in central administration, error exits
26895 100056  ;
26896 100056  ; note: in the comments to the code the notation  x.b  denotes a reference to the
26897 100056  ;   variable  x  in the record  b.
26898 100056  
26898 100056  ; definition of catalog parameters:
26899 100056  f0  =   a88        ; size of one catalog entry:      34  bytes
26900 100056  f9  =   512 - 2    ; catalog buffer size - 2  :     510  bytes
26901 100056  f10 =   f9/f0      ; number of entries per segment:  15
26902 100056  
26902 100056  
26902 100056  ;definition of results from check users and reserver
26903 100056  
26903 100056  f20 = 2.000001      ; internal is user
26904 100056  f21 = 2.000010      ; internal is reserver
26905 100056  f22 = 2.000100      ; other users
26906 100056  f23 = 2.001000      ; another internal is reserver
26907 100056  f24 = 2.010000      ; internal has writeprotected
26908 100056  f25 = 2.100000      ; other(s) has writeprotected
26909 100056  
26909 100056  
26909 100056  ; definition of proc func communications parameters
26910 100056  
26910 100056  f14 =   3            ; operation  read
26911 100056  f15 =   5            ; operation write
26912 100056  f16 =  48            ; minimum value of digit in identifier
26913 100056  f17 =  57            ; maximum   -   -    -    -     -
26914 100056  f18 =  97            ; minimum   -   -  letter -     -
26915 100056  f19 = 125            ; maximum   -   -    -    -     -
26916 100056  f37 =   0            ; kind:  internal process
26917 100056  f38 =   4            ; kind:  area process
26918 100056  
26918 100056  ; definition of bits and values of process states
26919 100056  
26919 100056  f40 =  1<2           ; repeat bit,  in proc state
26920 100056  f41 =  1<3           ; no stop bit, in proc state
26921 100056  f42 =  1<4           ; parent bit,  in proc state
26922 100056  f43 =  1<5           ; stopped bit, in proc state
26923 100056  f44 =  1<6           ; out of q bit,in proc state
26924 100056  f45 =  1<7           ; waiting bit, in proc state
26925 100056  
26925 100056  ; process state values
26926 100056  
26926 100056  f46 = a95            ; running
26927 100056  f47 = a99            ; waiting start by parent
26928 100056  f48 = a97            ; waiting stop by parent
26929 100056  f49 = a100           ; waiting start by ancestor
26930 100056  f50 = a98            ; waiting stop by ancestor
26931 100056  
26931 100056  ; note: the above a-names are defined before proc func loading.
26932 100056  ;      running:                   out of q, no stop
26933 100056  ;      waiting start by parent    stopped, parent, no stop
26934 100056  ;      waiting stop by parent     stopped, parent
26935 100056  ;      waiting start by ancestor  stopped, no stop
26936 100056  ;      waiting stop by ancestor   stopped
26937 100056  ;      waiting events             repeat
26938 100056  ;      waiting for proc func      repeat, out of q 
26939 100056  ;
26940 100056  
26940 100056  ; definition of function keys
26941 100056  
26941 100056  f71 =  1<10  ; bit 1 : aux catalog handling
26942 100056  f72 =  1<9   ; bit 2 : main catalog handling
26943 100056  f74 =  1<7   ; bit 4 : create peripheral process
26944 100056  f75 =  1<6   ; bit 5 : remove peripheral process
26945 100056  f76 =  1<5   ; bit 6 : aux entry handling
26946 100056  f77 =  1<4   ; bit 7 : set clock
26947 100056  
26947 100056  ; definition of itc-process states and mt-document states
26948 100056  
26948 100056  f80 =  0             ; free
26949 100056  f81 =  1             ; during connect
26950 100056  f82 =  2             ; connected
26951 100056  f83 =  3             ; during disconnect
26952 100056  f84 =  4             ; intervention
26953 100056  
26953 100056  f87 =  0             ; identified document mounted
26954 100056  f88 =  2             ; unidentified document mounted
26955 100056  f89 =  1             ; no document mounted
26956 100056  
26956 100056  ; definition of logical disc types
26957 100056  
26957 100056  f90 =  2.00001       ; logical disc - without catalog
26958 100056  f91 =  2.00011       ; logical disc - with rc8000 bs catalog
26959 100056  
26959 100056  
26959 100056  ; definition of chain states
26960 100056  
26960 100056  t0  =  1<0           ; idle
26961 100056  t1  =  1<1           ; after prepare
26962 100056  t2  =  1<2           ; during insert
26963 100056  t3  =  1<3           ; ready
26964 100056  t4  =  1<4           ; during delete
26965 100056  t5  =  1<5           ; during check
26966 100056  t6  =  1<6           ; during aux entry manipulation
26967 100056  
26967 100056  t20 =  t0            ; allowed for prepare bs
26968 100056  t21 =  t1+t2         ; allowed for insert entry
26969 100056                       ;             insert bs
26970 100056                       ;             connect main catalog
26971 100056  t22 =  t3            ; allowed for normal use
26972 100056  t23 =  t1+t2+t3+t4+t5+t6; allowed for delete bs
26973 100056  t24 =  t4            ; allowed for delete entries
26974 100056  t26 =  t1+t5         ; allowed for check aux catalog
26975 100056  t28 =  t1+t2+t6      ; allowed for create aux entry
26976 100056  t29 =  t1+t2+t3+t4+t5+t6; allowed for set bs-claims
26977 100056  t30 =  t1+t2+t3+t6   ; allowed for create area process
26978 100056  
26978 100056  
26978 100056  ; format of catalog entry
26979 100056  ; the formats of entries in main catalog and auxiliary catalogs are the
26980 100056  ; same, except for a field on 4 words that
26981 100056  ;  - in main catalog    contains document name, and
26982 100056  ;  - in aux catalogs    contains
26983 100056  ;        word0: entry last change (of entry), shortclock
26984 100056  ;        word1: write access counter
26985 100056  ;        word2: read access counter
26986 100056  ;        word3: dummy
26987 100056  
26987 100056  f4  =  0   ; byte    ; <first slice>
26988 100056  f3  =  1   ; byte    ; <namekey> * 8 + <perm key>
26989 100056  f1  =  2   ; word    ; <lower base of entry>
26990 100056  f2  =  4   ; word    ; <upper base of entry>
26991 100056  f5  =  6   ; name    ; <entry name>
26992 100056  f7  =  14  ; word    ; <size of entry>
26993 100056  f11 =  16  ; name    ; main: <document name>
26994 100056  f11 =  f11   ; word    ; aux:  <last change>
26995 100056  f12 =  f11+2 ; double  ;       <write access counter>,<read access counter>
26996 100056  f13 =  f12+4 ; word    ;       <last used>
26997 100056  
26997 100056  f0  =  a88           ; size of catalog entry
26998 100056  f6  =  14            ; start of tail
26999 100056  f8  =  f0-f6         ; size of tail
27000 100056  f51 = -8             ; mask for extracting all but perm-key
27001 100056  
27001 100056  
27001 100056  ; format of chainhead
27002 100056  
27002 100056  f60 =  -2 - f0       ; <claims rel address in internal process>
27003 100056  f54 =  f4 - f0       ; <first slice of aux catalog>
27004 100056  f53 =  f3 - f0       ; <chain kind> * 8 + <perm key>
27005 100056  f55 =  f5 - f0       ; <name of aux catalog>
27006 100056  f56 =  f6 - f0       ;   (start of tail)
27007 100056  f57 =  f7 - f0       ; <size of aux catalog>
27008 100056  f61 =  f11- f0       ; <document name>
27009 100056  f62 =  f56+10 ; word ; <name table address of disc process>
27010 100056  f64 =  f56+12 ; word ; <slice length>
27011 100056  f66 =  f56+14 ; byte ; <last slice in chaintable>
27012 100056  f67 =  f56+15 ; byte ; <number of namekeys>
27013 100056  f68 =  f56+16 ; byte ; <chain state>
27014 100056  f69 =  f56+17 ; byte ; (not used)
27015 100056  f70 =  f56+18 ; word ; <name table address of aux catalog area process>
27016 100056                       ; (used as segment number under include-exclude auxcat)
27017 100056  
27017 100056  ; each chaintable has a heading as the above given, which has the same
27018 100056  ;   basic format as a normal catalog entry.
27019 100056  ; it describes the aux catalog on the device.
27020 100056  ; after the heading follows the chain-area, consisting of one byte for
27021 100056  ;   each slice.
27022 100056  
27022 100056  
27022 100056  
27022 100056  ; record for main catalog pseudo chainhead
27023 100056  ; (format as a normal chainhead)
27024 100056  d9 = k - f54         ; base of pseudo chainhead:
27025 100056       0, r. f0>1      ;
27026 100090  
27026 100090  
27026 100090  
27026 100090  ; description of current catalog
27027 100090  
27027 100090  c0:  0               ; size of current catalog
27028 100092  c1:  0               ; number of namekeys in current catalog
27029 100094  d7:  0, r.4          ; name of current catalog
27030 100102       0               ; (name table address of current catalog area process)
27031 100104  
27031 100104  
27031 100104  
27031 100104  ; description of catalog message
27032 100104  
27032 100104  d8:                  ; cat message:
27033 100104  f30 = k - d8, f14<12 ;   operation (initially read)
27034 100106  f32 = k - d8, d0     ;   first address of catalog buffer
27035 100108  f34 = k - d8, d18    ;   last  address of catalog buffer
27036 100110  f36 = k - d8, -1     ;   current cat segment  (initially not existing)
27037 100112  
27037 100112  
27037 100112  ; common work variables:
27038 100112       0               ;-2   work
27039 100114  d12: 0               ;     return
27040 100116  
27040 100116  
27040 100116  
27040 100116  ; procedure set auxcat
27041 100116  ; call:  jl. w3  e0.
27042 100116  ;
27043 100116  ; procedure set maincat
27044 100116  ; call:  jl. w3  e1.
27045 100116  ;
27046 100116  ;   the use of the current catalog is terminated, and the
27047 100116  ;     new catalog is selected as curcat
27048 100116  ;
27049 100116  ; error return: result 2, in case of io-errors
27050 100116  ; return: all regs undef
27051 100116  
27051 100116  b. g10, h10 w.
27052 100116  
27052 100116  e0:                    ; set auxcat:
27053 100116       rl. w1     (h2.)    ;    catchain := curdoc;
27054 100118       jl.        g1.    ;      else
27055 100120  e1:                    ; set maincat:
27056 100120       al. w1     d9.    ;    catchain := pseudo chain for main catalog;
27057 100122  
27057 100122  g1:  sn. w1    (c2.)   ;    if catchain = curcat then
27058 100124       jl      x3        ;      return;
27059 100126  
27059 100126       rs. w3     h0.    ;    save(return);
27060 100128  
27060 100128  ; notice: be very cautious not to change curcat until all transfers are
27061 100128  ;         terminated
27062 100128  
27062 100128       rs. w1     h1.    ;    save (catchain);
27063 100130  
27063 100130       jl. w3     e7.    ;    terminate update;
27064 100132  ; (if io-errors the curcat is not changed yet)
27065 100132  
27065 100132       rl. w1     h1.    ;    w1 := new cur cat;
27066 100134       rl  w0  x1+f57    ;    move:  catsize
27067 100136       rs. w0     c0.    ;
27068 100138       zl  w0  x1+f67    ;           no. of namekeys
27069 100140       rs. w0     c1.    ;
27070 100142       al  w0    -1      ;           dummy segment number
27071 100144       rs. w0     d8.+f36;             (i.e. simulate irrell buffer contents)
27072 100146       rl  w0  x1+f70    ;           name table address of catalog area process
27073 100148       rx. w0     d7.+8  ;
27074 100150  
27074 100150       al  w2  x1+f55    ;           catalog name;
27075 100152  
27075 100152       rx. w1     c2.    ;    curcat := new cur cat;
27076 100154       rs  w0  x1+f70    ;    save old name table address in old curcat;
27077 100156  
27077 100156       al. w1     d7.    ;
27078 100158       rl. w3     h0.    ;
27079 100160       jl.        e32.   ;    return;
27080 100162  
27080 100162  c2:  d9                ; curcat chainhead address (initially: pseudochainhead)
27081 100164  
27081 100164  h0:  0                 ; return
27082 100166  h1:  0                 ; new curcat
27083 100168   h2: d4
27084 100170  
27084 100170  e.                     ;
27085 100170  
27085 100170  
27085 100170  
27085 100170  ; procedure dump chaintable
27086 100170  ;   writes the chaintable of current document back on the device
27087 100170  ;
27088 100170  ; call:  jl. w3  e2.
27089 100170  ; error return: result 2, in case of io-errors
27090 100170  ; return: all regs undef
27091 100170  
27091 100170  b. h10 w.
27092 100170  
27092 100170  e2:                    ; dump chain table:
27093 100170       rs. w3     d12.   ;    save(return);
27094 100172       rl. w3     (l4.)  ;    w3 := curdoc;
27095 100174       al  w0  x3-f0     ;    first addr := start of head.curdoc;
27096 100176       bz  w1  x3+f66    ;
27097 100178       wa  w1     6      ;    last addr := start of head.curdoc
27098 100180       al  w1  x1+511    ;      + last slice.curdoc + 511; (i.e. round up)
27099 100182       ds. w1     h2.    ;
27100 100184  
27100 100184       al. w1     h0.    ;
27101 100186       al  w3  x3+f61    ;    send message(document, output message);
27102 100188       jd         1<11+16;
27103 100190       al. w1     d16.   ;    wait answer;
27104 100192       jd         1<11+18;
27105 100194       rl. w3    (l4.)   ;    if curdoc.state = during delete then
27106 100196       zl  w3  x3+f68    ;    return;
27107 100198       sn  w3     t4     ;    <ignore error return when called from delete bs>
27108 100200       jl.       (d12.)  ;
27109 100202  
27109 100202       rl  w1  x1        ;
27110 100204       sn  w0     1      ;    if result <> ok
27111 100206       se  w1     0      ;    or status <> 0 then
27112 100208       jl.        j2.    ;      goto result 2;
27113 100210  
27113 100210       jl.       (d12.)  ;    return;
27114 100212  
27114 100212  h0:  f15 < 12          ; output message:
27115 100214       0                 ;  first address
27116 100216  h2:  0                 ;  last address
27117 100218       0                 ;  segment number (always zero)
27118 100220  
27118 100220  e.                     ;
27119 100220  
27119 100220  
27119 100220  
27119 100220  ; procedure compute namekey and segment number
27120 100220  ;   sets segment number.work:= hash function(name.work) 
27121 100220  ;    and namekey.work := segment mod no. of namekeys ;
27122 100220  ;
27123 100220  ;
27124 100220  ;   the hash function delivers a number ranging from 0 to number of segments
27125 100220  ;    in the catalog and is used to speed up the search for a name in the catalog.
27126 100220  ;   when an entry is created , the segment number and the namekey is computed ,
27127 100220  ;    and the entry is  inserted in the first free entry on "segment number" or
27128 100220  ;    the following segments.
27129 100220  ;    (the successor to the last segment is segment 0 ).
27130 100220  ;
27131 100220  ;    the search for an entry continues until segment=segment no. + no. of namekeys - 1.
27132 100220  ;
27133 100220  ;
27134 100220  ;
27135 100220  ; call:  jl. w3  e3.
27136 100220  ; return:  w2 = namekey.work < 3 + key.work
27137 100220  ;          other regs undef
27138 100220  
27138 100220  e3:                    ; compute segment no.
27139 100220       dl. w2     v13.   ;    double := name(0), name(2)
27140 100222       aa. w2     v14.   ;            + name(4), name(6);
27141 100224       wa  w2     2      ;    word := double(0) + double(2);
27142 100226       ba  w2     4      ;    word := word + word // 4096;
27143 100228       al  w1     0      ;
27144 100230       wd. w2     c0.    ;    segment := word mod catsize;
27145 100232       rs. w1     d28.   ;    segment no.work := segment
27146 100234       al  w2  x1        ; 
27147 100236       al  w1     0      ;
27148 100238       wd. w2     c1.    ;    namekey.work := segment mod no. of namekeys
27149 100240       ls  w1     3      ;
27150 100242       al  w2    -f51-1  ;
27151 100244       la. w2     v3.    ;    
27152 100246       wa  w2     2      ;
27153 100248       hs. w2     v3.    ;
27154 100250       jl      x3        ;    return;
27155 100252  
27155 100252  
27155 100252  
27155 100252  ; the following complex of io-procedures all have a common
27156 100252  ;   return information:
27157 100252  ; return: w0 = namekey of next segment
27158 100252  ;         w1 = segment number
27159 100252  ;         w2 = absolute address of start of buffer
27160 100252  ;         w3 = undef
27161 100252  ;         cur cat segment defined
27162 100252  ; error return: result 2, in case of io-errors
27163 100252  
27163 100252  
27163 100252  
27163 100252  ; "namekey of next segment" is used by the calling procedure to check wheter
27164 100252  ; the next segment is relevant , as entries only can be saved and retreived
27165 100252  ; from segments between segment no.work and the next segment 
27166 100252  ; with namekey = namekey.work
27167 100252  ;
27168 100252  
27168 100252  
27168 100252  ; procedure get key segment
27169 100252  ;   ensures that the segment given by namekey.work is present
27170 100252  ;     in the buffer
27171 100252  ;
27172 100252  ; call:  jl. w3  e4.
27173 100252  ;
27174 100252  ;
27175 100252  ; procedure get cat segment
27176 100252  ;   ensures that the segment given as parameter is present
27177 100252  ;
27178 100252  ; call:  al  w2  <segment number>
27179 100252  ;        jl. w3  e5.
27180 100252  ;
27181 100252  ;
27182 100252  ; procedure get next segment
27183 100252  ;   gets the next (cyclically numberred) segment into the buffer
27184 100252  ;
27185 100252  ; call:  jl. w3  e6.
27186 100252  ;
27187 100252  ;
27188 100252  ; procedure terminate update
27189 100252  ;   the current catalog segment is written back, in case of changes
27190 100252  ;
27191 100252  ; call:  jl. w3  e7.
27192 100252  
27192 100252  b. g10 w.
27193 100252  
27193 100252  e4:                    ; get key segment:
27194 100252       rl. w2     d28.   ; segment := segment no.work
27195 100254  e5:                    ; get cat segment:
27196 100254                         ; (w2 = segment)
27197 100254       se. w2    (d8.+f36);   if segment <> current segment then
27198 100256       jl.        g1.    ;      goto get segment;
27199 100258  
27199 100258  g0:                    ; exit:
27200 100258       al  w1  x2        ;    w1 := segment;
27201 100260       al  w0     0      ;     w0:=next key
27202 100262       wd. w1     c1.    ;     
27203 100264       ea. w0     +1     ;     if next key := no of keys then
27204 100266       sl. w0    (c1.)   ;     next key := 0
27205 100268       al  w0     0      ;
27206 100270       al  w1  x2        ;     restore segment
27207 100272       rl. w2     d8.+f32;    w2 := abs first of buffer;
27208 100274       jl      x3        ;    return;
27209 100276  
27209 100276  e6:                    ; get next segment:
27210 100276       am         1-0    ;    incr := 1;
27211 100278  e7:                    ; terminate update:
27212 100278       al  w2     0      ;    incr := 0;
27213 100280       wa. w2     d8.+f36;    segment := current segment + incr;
27214 100282  
27214 100282       sl. w2    (c0.)   ;    if segment outside catalog then
27215 100284       al  w2     0      ;      segment := 0;
27216 100286  
27216 100286  g1:                    ; get segment:
27217 100286                         ; (w2 = segment, w3 = return)
27218 100286       ds. w3     d12.   ;    save(segment, return);
27219 100288       bz. w0     d8.+f30;
27220 100290       se  w0     f15    ;    if catoperation <> output then
27221 100292       jl.        g4.    ;      goto test input nescessary;
27222 100294  g2:                    ; after output:
27223 100294       al. w3     d7.    ;    w3 := catalog name address;
27224 100296  
27224 100296       bz. w0     d8.+f30;    if catoperation = write then
27225 100298       sn  w0     f15    ;
27226 100300       jd         1<11+8 ;      reserve process(catalog); (i.e. after update)
27227 100302  
27227 100302       al. w1     d8.    ;
27228 100304       jd         1<11+16;    send message(catalog, catmessage);
27229 100306  
27229 100306       al. w1     d16.   ;
27230 100308       jd         1<11+18;    wait answer;
27231 100310       zl. w2  d8.+f30     ;
27232 100312       sn  w2      f15     ;
27233 100314       jd          1<11+10 ;
27234 100316       al  w2      f14     ;
27235 100318       hs. w2  d8.+f30     ;
27236 100320  
27236 100320       al  w2    -1      ;    (prepare for io-errors)
27237 100322       sn  w0     1      ;    if result <> ok
27238 100324       sz  w2 (x1)       ;    or status <> 0 then
27239 100326       jl.        g5.    ;      goto catalog io-error;
27240 100328  
27240 100328  ; a transfer has now been completed.
27241 100328  ; if after update the transfer was an output, terminating the earlier
27242 100328  ;   segment. in this case the new segment must be brougth into the buffer
27243 100328  
27243 100328       dl. w3     d12.   ;    restore(segment, return);
27244 100330  
27244 100330  g4:                    ; test input nescessary:
27245 100330       rx. w2     d8.+f36;    current segment := segment;
27246 100332       se. w2    (d8.+f36);   if current segment <> segment then
27247 100334       jl.        g2.    ;      goto after write;
27248 100336  
27248 100336       jl.        g0.    ;    goto exit;
27249 100338  
27249 100338  g5:                    ; catalog io-error:
27250 100338       rs. w2     d8.+f36;    current segment := -1;
27251 100340                         ;    (i.e. undefined contents of catalog buffer)
27252 100340       jl.        j2.    ;    goto result 2;
27253 100342  
27253 100342  e.                     ;
27254 100342  
27254 100342  
27254 100342  
27254 100342  ; the following set of procedures are intended for updating
27255 100342  ; and utilizing the information given in each catalog segment:
27256 100342  ;   each segment contains a number, <entry count>, stating the
27257 100342  ;   number of entries with a namekey corresponding to the
27258 100342  ;   segment-number
27259 100342  ; notice:
27260 100342  ;         *********************************************************
27261 100342  ;         *                                                       *
27262 100342  ;         * in case of break-down during a multi-segment updating *
27263 100342  ;         *   the entry count may be one (or more) too large,     *
27264 100342  ;         *             but never too small                       *
27265 100342  ;         *                                                       *
27266 100342  ;         * i.e. it is actually a maximum number of entries       *
27267 100342  ;         *                                                       *
27268 100342  ;         * it will be reset at the first catalog search with     *
27269 100342  ;         *      that particular namekey                          *
27270 100342  ;         *                                                       *
27271 100342  ;         *********************************************************
27272 100342  
27272 100342  b. g30, h10 w.
27273 100342  
27273 100342  ; procedure prepare update and change entry count
27274 100342  ; call:  al  w0  <change of entry count>
27275 100342  ;        al  w2  <start of catalog buffer>
27276 100342  ;        jl. w3  e8.
27277 100342  ; return: all regs undef
27278 100342  ;
27279 100342  ;   the corresponding entry count is updated
27280 100342  ;   and the segment is flagged for being written back
27281 100342  
27281 100342  e8:                    ; change entry count and prepare update:
27282 100342       wa  w0  x2+f9     ;    entry count.buffer :=
27283 100344       rs  w0  x2+f9     ;      entry count.buffer + change;
27284 100346  
27284 100346  ; procedure prepare update
27285 100346  ; call:  jl. w3  e9.
27286 100346  ; return: all regs undef
27287 100346  ;
27288 100346  ;   the current catalog segment is flagged for being written back
27289 100346  ;   at next catalog transfer
27290 100346  
27290 100346  e9:                    ; prepare update:
27291 100346       al  w0     f15    ;    catoperation := write;
27292 100348       hs. w0     d8.+f30;
27293 100350       jl      x3        ;    return;
27294 100352  
27294 100352  
27294 100352  ; procedure search free entry
27295 100352  ;   a new entry is to be created. the entry is given in work.
27296 100352  ;   entry count(namekey.work) is increased, and a free entry is searched
27297 100352  ;     for.
27298 100352  ;   if no room, then entry count is decreased again, and error return
27299 100352  ;
27300 100352  ;
27301 100352  ; call:  jl. w3  e10.
27302 100352  ;        jl.     no room
27303 100352  ;        jl.     ok
27304 100352  ; error return: result 2, in case of io-error
27305 100352  ; return: cur entry (and segment defined)
27306 100352  
27306 100352  e10:                   ; search free entry:
27307 100352       rs. w3     h1.    ;    save(return);
27308 100354       jl. w3     e4.    ;    get key segment;
27309 100356       rs. w0     h5.    ; save next key
27310 100358       rs. w1     h0.    ;    save(segment number);
27311 100360       al  w0     1      ;
27312 100362       jl. w3     e8.    ;    increase(entry count) and prepare update;
27313 100364  
27313 100364  g1:                    ; next segment:
27314 100364       al  w0    -1      ;    w0 := free pattern;
27315 100366       al  w3  x2+f9     ;    w3 := top of last entry;
27316 100368  g2:                    ; next entry:
27317 100368                         ; (w0 = free pattern, w2 = entry, w3 =  top)
27318 100368       sn  w0 (x2)       ;    if first word of entry <> free pattern then
27319 100370       jl.        g5.    ;      begin
27320 100372       al  w2  x2+f0     ;      entry := entry + entrysize;
27321 100374       se  w2  x3        ;      if more entries on same segment then 
27322 100376       jl.        g2.    ;        goto next entry; 
27323 100378  
27323 100378  
27323 100378       zl. w2     v3.    ;      if key.work = next key then
27324 100380       ls  w2     -3     ;       decrease entry count
27325 100382       sn. w2     (h5.)  ;      else
27326 100384       jl.        g10.   ;      get next segment
27327 100386       jl. w3     e6.    ;
27328 100388       rs. w0     h5.    ;      save next key
27329 100390       jl.        g1.    ;
27330 100392  
27330 100392  
27330 100392  g5:                    ;      end;
27331 100392       ds. w2     d3.    ;    save(cur entry segment, cur entry);
27332 100394       am.       (h1.)   ;
27333 100396       jl        +2      ;    goto ok-return;
27334 100398  
27334 100398  
27334 100398  
27334 100398  ; procedure get cur entry segment
27335 100398  ;   ensures that the catalog buffer contains the appropriate segment
27336 100398  ;     and that cur entry address is relevant in this buffer
27337 100398  ;
27338 100398  ; call: jl. w3  e11.
27339 100398  ; error return: result 2, in case of io-error
27340 100398  ; return: cur entry segment is in catbuffer
27341 100398  ;         registers as get catalog segment
27342 100398  
27342 100398  e11:                   ; get cur entry segment:
27343 100398       rl. w2     d29.   ;    segment  := cur entry segment;
27344 100400       jl.        e5.    ;    goto get catalog segment;
27345 100402  
27345 100402  
27345 100402  
27345 100402  ; procedure set cur entry
27346 100402  ;   moves the entry in work to the catalog segment, given by cur entry
27347 100402  ;
27348 100402  ; call: jl. w3  e12.
27349 100402  ; error return: result 2, in case of io-error
27350 100402  ; return: all regs undef
27351 100402  
27351 100402  e12:                   ; set cur entry:
27352 100402       rs. w3     h1.    ;    save(return);
27353 100404       jl. w3     e11.   ;    get cur entry segment;
27354 100406       jl. w3     e9.    ;    prepare update;
27355 100408  
27355 100408       rl. w1     d3.    ;    w1 := cur entry;
27356 100410       al. w2     d1.    ;    w2 := work;
27357 100412       jl. w3     e33.   ;    move work to cur entry;
27358 100414  
27358 100414       jl.       (h1.)   ;
27359 100416  
27359 100416  
27359 100416  
27359 100416  ; procedure delete cur entry
27360 100416  ;   remove the entry given by cur entry, by setting the first word
27361 100416  ;     of the entry to -1
27362 100416  ;   entry count(namekey.work) is decreased
27363 100416  ;
27364 100416  ; call: jl. w3  e13.
27365 100416  ; error return: result 2, in case of io-error
27366 100416  ; return: all regs undef
27367 100416  
27367 100416  e13:                   ; delete cur entry:
27368 100416       rs. w3     h1.    ;    save(return);
27369 100418       jl. w3     e11.   ;    get cur entry segment;
27370 100420  
27370 100420       al  w0    -1      ;
27371 100422       rs. w0    (d3.)   ;    first word(cur entry) := -1
27372 100424       jl. w3     e9.    ;    prepare update;
27373 100426                         ;    (notice: if the entry is not on the key segment
27374 100426                         ;             two segments must be updated)
27375 100426  g10: jl. w3     e4.    ;    get key segment;
27376 100428  
27376 100428                         ; decrease entry count:
27377 100428       al  w0    -1      ;
27378 100430  g15:                   ; update and return:
27379 100430       jl. w3     e8.    ;    change entry count and prepare update;
27380 100432       jl.       (h1.)   ;    return;
27381 100434  
27381 100434  
27381 100434  
27381 100434  ; procedure for all key entries do
27382 100434  ;
27383 100434  ;   delivers all entries, one at a time, with the namekey given
27384 100434  ;
27385 100434  ; call: al  w2  <segment>
27386 100434  ;       jl. w3  e14.
27387 100434  ;       jl.     no more
27388 100434  ;       (maybe save w2)
27389 100434  ;       <action for found entry>
27390 100434  ;       (restore w2, if destroyed)
27391 100434  ;       jl      x3
27392 100434  ;
27393 100434  ; error return: result 2, in case of io-errors
27394 100434  ;
27395 100434  ; return:  link+0: no more entries (all regs undef)
27396 100434  ;          link+2: w0w1 = undef, w2 = entry, w3 = continue search
27397 100434  ;                  (when continuing w2 must remain unchanged)
27398 100434  
27398 100434  e14:                   ; for all key entries do:
27399 100434       ds. w3     h1.    ;    save(segment, return);
27400 100436       jl. w3     e5.    ;    get cat segment;
27401 100438       rs. w0     h5.    ;    save next key ; key :=next key
27402 100440       sn  w0      0     ;    if  key = 0 then
27403 100442       rl. w0     c1.    ;     key := no. of keys.catalog
27404 100444       bs. w0      1     ;    current key :=  key-1
27405 100446       rs. w0     h4.    ;    save current key
27406 100448       al  w3  x2+f9     ;    w3 := top of last entry;
27407 100450       rs. w3     h3.    ;
27408 100452  
27408 100452       rl  w3  x2+f9     ;    remaining := entry count.key segment;
27409 100454       al  w2  x2-f0     ;    (decrease(entry) ... code trick)
27410 100456  
27410 100456  g21:                   ; test remaining:
27411 100456       sn  w3     0      ;    if remaining = 0 then
27412 100458       jl.       (h1.)   ;      return;
27413 100460       rs. w3     h2.    ;
27414 100462  
27414 100462  g22:                   ; next entry:
27415 100462       al  w2  x2+f0     ;    increase(entry);
27416 100464       sn. w2    (h3.)   ;    if out of buffer then
27417 100466       jl.        g24.   ;      goto next segment;
27418 100468  
27418 100468  g23:                   ; test entry:
27419 100468       rl  w3  x2        ;
27420 100470       se  w3    -1      ;    if entry exists then
27421 100472       bz  w3  x2+f3     ;      key := key.entry;
27422 100474       as  w3    -3      ;    (otherwise key = not possible)
27423 100476       se. w3    (h4.)   ;    if key <> saved key then
27424 100478       jl.        g22.   ;      goto next entry;
27425 100480  
27425 100480       rl. w3     h1.    ;
27426 100482       jl  w3  x3+2      ;    call(found action); (w2 = entry)
27427 100484  
27427 100484       rl. w3     h2.    ;
27428 100486       al  w3  x3-1      ;    decrease(remaining entries);
27429 100488       jl.        g21.   ;    goto test remaining;
27430 100490  
27430 100490  g24:                   ; next segment:
27431 100490       rl. w0     h5.    ;    if next key = key then
27432 100492       sn. w0    (h4.)   ;    
27433 100494       jl.       g25.    ;    goto adjust entry count
27434 100496       jl. w3     e6.    ;    else
27435 100498       rs. w0     h5.    ;    get next segment
27436 100500       al  w3  x2+f9     ;    save next key
27437 100502       rs. w3     h3.    ;    and addres of last entry.segment
27438 100504       jl.       g23.    ;
27439 100506  
27439 100506  g25:                   ; adjust entry count
27440 100506       rl. w2     h0.    ;
27441 100508       jl. w3     e5.    ;  get entry segment
27442 100510  
27442 100510       ac. w0    (h2.)   ;    decrease entry count by remaining entries
27443 100512       jl.        g15.   ;      and return;
27444 100514  
27444 100514  h0:  0                 ; saved segment
27445 100516  h1:  0                 ; saved return
27446 100518  h2:  0                 ; remaining entries
27447 100520  h3:  0                 ; top address of last entry on segment
27448 100522  h4:  0                 ; key.segment
27449 100524  h5:  0                 ; next key
27450 100526  
27450 100526  e.                     ;
27451 100526  
27451 100526  
27451 100526  
27451 100526  ; procedure compute document address
27452 100526  ;
27453 100526  ;   selects either the maincat document or the document
27454 100526  ;     specified in first slice.work
27455 100526  ;
27456 100526  ; call:  jl. w3  e15.
27457 100526  ; return:  w2 = doc address, other regs undef
27458 100526  
27458 100526  e15:                   ; compute document address for non-area entries:
27459 100526       rl  w2     b25    ;    (prepare for maincat-entry)
27460 100528       bz. w1     v4.    ;    if first slice.work = 0 then
27461 100530       sn  w1     0      ;      w2 := maincat document
27462 100532       jl      x3        ;      and return;
27463 100534  
27463 100534       am        (b22)   ;    use the last 11 bits of first slice
27464 100536       rl  w2  x1-2048   ;      to select the document;
27465 100538       jl      x3        ;    return;
27466 100540  
27466 100540  ; procedure first proc (proc addr,new state);
27467 100540  ;   finds the process given by name.work and checks that it is a child
27468 100540  ;   of the sender.
27469 100540  ;   initializes  end chain delta  and  children bits  and returns disabled
27470 100540  ;   with w3 = proc addr  and new state = wait stop by parent.
27471 100540  ; call:               jl. w3   e17.
27472 100540  ; return:             disabled with
27473 100540  ;                     w1 = sender
27474 100540  ;                     w2 = new state
27475 100540  ;                     w3 = proc addr
27476 100540  ;                     w0   changed
27477 100540  ; error:              not child: error 3;
27478 100540  e17: rs. w3   d12.      ; first proc: save return;
27479 100542       jl. w3     e47.   ;    search best process in nametable;
27480 100544         b6              ;
27481 100546         b7              ;
27482 100548       jl.        e26.   ;+6:   not found:  goto test found;
27483 100550       al  w3  x2        ;    proc := proc found;
27484 100552  
27484 100552       rl. w1   (l2.)          ;   if parent.proc addr <> sender
27485 100554       se  w1 (x3+a34)         ;   then enabled goto error 3;
27486 100556       jl.      j3.            ;
27487 100558  
27487 100558       al  w2   0              ;   end chain:= children bits:= 0;
27488 100560       rs. w2    d21.          ;   delta := 0;
27489 100562       rs. w2   (l15.)         ;   w3:= proc addr;
27490 100564  b. i1 w.
27491 100564       rs. w3     d14.   ;
27492 100566       al  w2     a402   ; start of bit array
27493 100568       al  w0     0      ;
27494 100570  i0:  rs. w0  x2+d13.   ; childrensbits:=0
27495 100572       al  w2  x2+2      ;
27496 100574       se  w2  a402+a403 ;
27497 100576       jl.        i0.    ;
27498 100578  e.
27499 100578       al  w2   f48            ;   w2:= new state:= wait stop by parent;
27500 100580       jl.     (d12.)          ; disabled return;
27501 100582  
27501 100582  e26: jl. w3   e24.           ; test found: test format;
27502 100584       jl.      j3.            ;   goto error 3;
27503 100586  
27503 100586  ; procedure chain and add children;
27504 100586  ;   connects proc addr to the the chain through wait addresses which
27505 100586  ;   ends in end chain and exits via add children
27506 100586  ; call:        jl. w3   e18.
27507 100586  ; return:      w2: delta (stopcount - children)
27508 100586  
27508 100586  b.   g2                           ; begin
27509 100586  w.                                ;
27510 100586  e18: dl. w2   (l15.)              ; chain and add children:
27511 100588       rs  w2  x1+a40               ;   wait addr.proc addr:= end chain;
27512 100590       rs. w1   (l15.)              ;   end chain:= proc addr;
27513 100592  
27513 100592  ; procedure add children;
27514 100592  ;   searches through all internal processes and adds to children bits
27515 100592  ;   the identification bit for all processes with parent = proc addr;
27516 100592  ; call:        jl. w3   e19.
27517 100592  ; return:      w2: delta (stopcount - children)
27518 100592  e19: rs. w3   d12.        ; add children:  save return;
27519 100594       rl. w1     d14.     ; 
27520 100596       zl  w2  x1+a12      ; delta := delta + stopcount;
27521 100598       wa. w2     d21.     ;
27522 100600       rs. w2     d21.     ;
27523 100602       rl w3   b6          ; w3:=addr(first proc in nametable);
27524 100604  g0:  rl w2 x3            ; for w3 through nametable do
27525 100606       rl. w1   d14.       ; w1:=proc addr;
27526 100608       se  w1 (x2+a34)     ;  if parent.nametable(w3)=
27527 100610       jl.        g1.      ;     procaddr then
27528 100612       el  w1  x2+a14      ;    include identbit.nametable(w3)
27529 100614       bz. w0  x1+d13.     ;        nametable(w3));
27530 100616       lo  w0  x2+a14      ;
27531 100618       hs. w0  x1+d13.     ;
27532 100620       rl. w2     d21.     ;
27533 100622       al  w2  x2-1        ;     delta := delta - children;
27534 100624       rs. w2     d21.     ;
27535 100626  g1:  al  w3  x3+2        ;
27536 100628       se  w3    (b7)      ;
27537 100630       jl.        g0.      ;
27538 100632       rl. w2     d21.     ;
27539 100634       jl.       (d12.)    ;  return;
27540 100636  
27540 100636  e.                                ; end chain/add children;
27541 100636  
27541 100636  ; procedure next proc (result: proc addr, new state);
27542 100636  ;   finds proc addr corresponding to one of the bits in children bits,
27543 100636  ;   removes the corresponding bit in children bits, and returns disabled
27544 100636  ;   with new state = wait stop by ancestor and proc addr defined.
27545 100636  ; call:           jl. w3   e20.
27546 100636  ; return:         w2 = new state
27547 100636  ;                 w3 = proc addr
27548 100636  ;                 w0,w1 changed.
27549 100636  ; return 2:       no more children
27550 100636  
27550 100636  b.   g5                    ; begin
27551 100636  w.                         ; next proc:
27552 100636  e20: rs. w3  d12.         ;   save(link) ;
27553 100638       al  w3    -11        ;
27554 100640       al  w1    a402       ; w1:=first halfword.bit array
27555 100642  g0:  zl. w0  x1+d13.      ; get array(w1)
27556 100644       sn  w0       0       ; if no users then
27557 100646       jl.        g3.       ; goto next halfword
27558 100648       ns  w0      1        ; (first internal : -11 second : -12 ...)
27559 100650       es  w3      1        ; w3:= -11 +no of shifts
27560 100652       ls  w3      1        ; +12*halfword no(bitarray)
27561 100654       am         (b6)      ; name table index:=w3*2
27562 100656       rl  w3    x3         ; w3:=proc
27563 100658       zl. w0  x1+d13.      ; remove children it from bit array
27564 100660       lx  w0   x3+a14      ; 
27565 100662       hs. w0  x1+d13.      ; 
27566 100664       al  w2  f50          ; new state:=wait stop by ancestor
27567 100666       rs. w3    d14.       ;
27568 100668       jl.      (d12.)      ;
27569 100670  g3:  al  w1  x1+1         ; next halfword(bitarray)
27570 100672       al  w3  x3+12        ; w3:=w3+no of internals pr halfword
27571 100674       se  w1  a402+a403    ; if index > last index then
27572 100676       jl.       g0.        ; return : no more children
27573 100678       rl. w3    d12.       ;
27574 100680       jl      x3+2         ;
27575 100682  
27575 100682  e.                               ; end next proc;
27576 100682  
27576 100682  
27576 100682  
27576 100682  ; procedure create next wrk-name
27577 100682  ;   supplies a wrk-name in name.work
27578 100682  ;
27579 100682  ;   a wrk-name has the format:  wrk<6 octal digits>
27580 100682  ;
27581 100682  ; call:  jl. w3  e23.
27582 100682  ;
27583 100682  ; return: name.work defined
27584 100682  ;         all regs undef
27585 100682  
27585 100682  b. g10, h10 w.
27586 100682  
27586 100682  e23:                   ; test name:
27587 100682       dl. w1     h0.    ;    increase(last wrkname) octal;
27588 100684       aa. w1     h3.    ;
27589 100686       lo. w0     h1.    ;    (notice: a carry from one character is
27590 100688       la. w0     h2.    ;             propagated to next char and so on,
27591 100690       lo. w1     h1.    ;             by means of the special mask)
27592 100692       la. w1     h2.    ;
27593 100694       ds. w1     h0.    ;
27594 100696  
27594 100696       al. w1     v5.    ;    move wrk-name
27595 100698       jl. w2     e32.   ;      to name.work;
27596 100700  h0=k+4 ; wrk-digits    ;
27597 100700       <:wrk000000:>,0   ; last wrk-name
27598 100708  
27598 100708  h1:  <:000:>           ; mask to convert to digits
27599 100710  h2:  <:777:>           ; mask to eliminate superflouos carries
27600 100712       200<16+200<8+200  ; double-mask to increase octally
27601 100714  h3:  200<16+200<8+200+1;    (= all ones - <:888888:> + 1)
27602 100716  
27602 100716  e.                     ;
27603 100716  
27603 100716  
27603 100716  
27603 100716  ; procedure test format
27604 100716  ;
27605 100716  ;   test whether the format of name.work corresponds to
27606 100716  ;     a legal identifier.
27607 100716  ;   a legal name consists of a small letter followed by at most
27608 100716  ;     10 small letters or digits, filled up with null-chars
27609 100716  ;     until 4 words.
27610 100716  ;   f16 <= value of digit        <= f17    (initially: digits 0-9)
27611 100716  ;   f18 <= value of small letter <= f19    (initially: letters a-aa)
27612 100716  ;
27613 100716  ; call:  jl. w3  e24.
27614 100716  ; error return: result 6, if nameformat illegal
27615 100716  ; return: nameformat ok
27616 100716  ;         all regs undef
27617 100716  
27617 100716  b. g10 w.
27618 100716  
27618 100716  e24:                   ; test format:
27619 100716       rs. w3     d12.   ;    save(return);
27620 100718       al. w2     v5.    ;    name pointer := addr of name.work;
27621 100720  
27621 100720       bz  w0  x2        ; test start of name:
27622 100722       sl  w0     f18<4  ;    if first char of name < minimum letter then
27623 100724       jl.        g3.    ;      goto result 6;
27624 100726       jl.        j6.    ;    goto get word;
27625 100728  
27625 100728  g1:                    ; test next char:
27626 100728                         ;  w0 = partial word   ( <> 0 )
27627 100728                         ;       (i.e. contains at least one character,
27628 100728                         ;             which must be left justified)
27629 100728                         ;  w1 = current word
27630 100728                         ;  w2 = name pointer:  even == before null-char
27631 100728                         ;                      odd  == after  null-char
27632 100728                         ;  w3 = 1
27633 100728       so  w2     2.1    ;    if before null-char then
27634 100730       ld  w0     8      ;      char := next char from partial word + 1 shift 8;
27635 100732                         ;    (partial word := partial word shift 8);
27636 100732                         ;    (i.e. if after null-char then illegal name)
27637 100732       sh  w3     f17+1<8;
27638 100734       al  w3  x3+f18-f16;    if neither letter nor digit then
27639 100736       sl  w3     f18+1<8;
27640 100738       sl  w3     f19+1+1<8;
27641 100740       jl.        j6.    ;      goto result 6; i.e. illegal name
27642 100742  
27642 100742  g2:                    ; test rest of partial word:
27643 100742       al  w3     1      ;    (prepare for next char and for making nameptr odd)
27644 100744       se  w0     0      ;    if partial word <> 0 then
27645 100746       jl.        g1.    ;      goto test next char;
27646 100748  
27646 100748       sz  w1     255    ;    if last char in current word = null then
27647 100750       sz  w2     2.1    ;      after null-char := true;
27648 100752       lo  w2     6      ;    (i.e. make name pointer odd)
27649 100754  
27649 100754       al  w2  x2+2      ;    increase(name pointer);
27650 100756  
27650 100756  g3:                    ; get word:
27651 100756       rl  w1  x2        ;    current word := name (name pointer);
27652 100758       al  w0  x1        ;    partial word := current word;
27653 100760       sh. w2     v15.   ;    if name pointer < last addr of name.word then
27654 100762       jl.        g2.    ;      goto test rest of partial word;
27655 100764  
27655 100764       sz  w2     2.1    ;    if after null-char then
27656 100766       jl.       (d12.)  ;      return;
27657 100768       jl.        j6.    ;    goto result 6; (i.e. more than 11 chars)
27658 100770  
27658 100770  e.                     ;
27659 100770  
27659 100770  
27659 100770  ; procedure remove area (intproc,areaproc);
27660 100770  ; intproc is removed as user and as reserver of area proc.
27661 100770  ; call:   w1= intproc,   w2=area proc
27662 100770  ;         disabled call with link in w3
27663 100770  
27663 100770  b.g30,h7 w.              ; begin
27664 100770                           ; remove area:
27665 100770  
27665 100770  h0:  0                   ; save w1: init proc
27666 100772  h1:  0                   ; save w2: area
27667 100774  h2:  0                   ; save w3: link
27668 100776  h3:  0                   ; result from check user-reserver
27669 100778       0                   ; write access counter
27670 100780  h6:  0                   ; read access counter
27671 100782       0                   ; lower base.proc
27672 100784  h7:  0                   ; upper base.proc
27673 100786  e25: rs. w3  h2.         ; save return
27674 100788       jl. w3  e64.        ;
27675 100790       rs. w3  h3.         ;
27676 100792       so  w3  f20         ; if proc not user  then
27677 100794       jl.     (h2.)       ; enable return;
27678 100796       jl. w3  e56.        ; exclude proc as user(and reserver)
27679 100798       rl. w3  h3.         ; if proc has writeprotected then
27680 100800       sz  w3  f24         ;
27681 100802       jl. w3  e53.        ;    remove writeprotect(proc, area);
27682 100804       al  w3  1           ;
27683 100806       ba  w3  x1+a20      ; increase area claim
27684 100808       hs  w3  x1+a20      ;
27685 100810       rl. w0  h3.         ; if other users then
27686 100812       sz  w0  f22         ; 
27687 100814       jl.     (h2.)       ; enable return
27688 100816       al  w0  0           ;
27689 100818       sn  w0 (x2+a411)    ;   w0=0 used below....
27690 100820       se  w0 (x2+a412)    ;   if access counters<>0,0 then
27691 100822       jl.     g1.         ;     name(0).area:=0;
27692 100824       jl. w3  e67.        ;     clean area process;
27693 100826       jl.     (h2.)       ; enable return
27694 100828  ; save statistical information in auxiliary catalog.
27695 100828  g1:  ds. w2  h0.+2       ;   save init proc, link;
27696 100830       dl  w1  x2+a49      ;  
27697 100832       ds. w1  v2.         ;   base.work:=base.proc
27698 100834       ds. w1  h7.         ;   save base.proc
27699 100836       dl  w1  x2+a62+2    ;   move docname.area to docname.work
27700 100838       ds. w1  v30.        ;  
27701 100840       dl  w1  x2+a62+6    ;  
27702 100842       ds. w1  v31.        ;  
27703 100844       dl  w1  x2+a11+2    ;   move name.area to name.work
27704 100846       ds. w1  v13.        ;  
27705 100848       dl  w1  x2+a11+6    ;  
27706 100850       ds. w1  v14.        ;  
27707 100852       jl. w3     e67.     ;   clean area process
27708 100854       rl. w1  h0.         ;   w1:= initproc
27709 100856       dl  w0  x2+a412     ;
27710 100858       ds. w0  h6.         ;   access counters:=access counters.area;
27711 100860       jl. w3  e45.        ;   enable, find chain(docname.work)
27712 100862               v11         ;  
27713 100864       jl.     g2.         ;   NOT FOUND:  result 3
27714 100866  
27714 100866       rs. w2  d4.        ; curdoc:= chain;
27715 100868       jl. w3  e0.         ;   set aux cat
27716 100870       jl. w3  e46.        ;   search best entry
27717 100872       jl.     g2.         ;   NOT FOUND: enable return
27718 100874       sn. w0 (h7.-2)      ;   if base.entry<> base.proc 
27719 100876       se. w1 (h7.)        ;   then enable return
27720 100878       jl.     g2.         ;   (area describes a temp entry on curdoc)
27721 100880       dl  w1  b13+2       ;
27722 100882       ld  w1  5           ;
27723 100884       dl. w2  h6.         ;
27724 100886       se  w1  0           ;   if write access counter<>0 then
27725 100888       rs. w0  v11.        ;     last change.work:=short clock;
27726 100890       sn  w1  0           ;   if write access counter<>0 or
27727 100892       se  w2  0           ;   if read access counter<>0 then
27728 100894       rs. w0  v8.         ;     last used.work := short clock
27729 100896       wa. w1  v12.        ;
27730 100898       wa. w2  v32.        ;
27731 100900       ds. w2  v32.        ;   update access counters;
27732 100902       jl. w3  e12.        ;   set curr entry;
27733 100904  g2:  jl. w3  e1.         ; maincat: set main catalog;
27734 100906  
27734 100906  
27734 100906       rl. w1  h0.         ;   w1:=init proc;
27735 100908       jl.    (h2.)        ; exit: enable, return;
27736 100910  e.                       ;
27737 100910  
27737 100910  
27737 100910  
27737 100910  ; the following complex of procedures take care of moves
27738 100910  ;   in general the call must be like this:
27739 100910  ; call:  al  w0  <bytes to move>   (must be even)
27740 100910  ;        al. w1  <to-address>
27741 100910  ;        al. w2  <from-address>
27742 100910  ;        jl. w3  move
27743 100910  ; return: all regs undef
27744 100910  ;
27745 100910  ; procedure move entry
27746 100910  ; procedure move name
27747 100910  ; procedure move
27748 100910  ;
27749 100910  
27749 100910  b. g10, h10 w.
27750 100910  
27750 100910  e33: am         f0-8   ; move entry: bytes = size of catalog entry
27751 100912  e32: al  w0     8      ; move name:  bytes = size of name
27752 100914  e31:                   ; move:
27753 100914       rs. w3     h0.    ;    save(return);
27754 100916       gg  w3     b100   ;    if mp-cpu then
27755 100918       sh  w3     55     ;    begin
27756 100920       jl.        g0.    ;
27757 100922       mh  w2    (0)     ;      move halfwords(size, destination, source);
27758 100924       jl.       (h0.)   ;      return;
27759 100926                         ;    end;
27760 100926  
27760 100926  g0:  ac  w3    (0)     ;    remaining := - bytes;
27761 100928       sz  w3     1<1    ;    if odd number of words to move then
27762 100930       jl.        g5.    ;      goto move single word;
27763 100932  
27763 100932  g1:                    ; move double words:
27764 100932       rs. w3     h1.    ;    save(remaining);
27765 100934       sl  w3     h5     ;    if remaining does no exceed size of move-table
27766 100936       jl.     x3+h4.    ;      then switch out through table;
27767 100938                         ;    (otherwise move a whole portion)
27768 100938  h3:                    ; start of move-table:
27769 100938       dl  w0  x2+30     ;
27770 100940       ds  w0  x1+30     ;
27771 100942       dl  w0  x2+26     ;
27772 100944       ds  w0  x1+26     ;
27773 100946       dl  w0  x2+22     ;
27774 100948       ds  w0  x1+22     ;
27775 100950       dl  w0  x2+18     ;
27776 100952       ds  w0  x1+18     ;
27777 100954       dl  w0  x2+14     ;
27778 100956       ds  w0  x1+14     ;
27779 100958       dl  w0  x2+10     ;
27780 100960       ds  w0  x1+10     ;
27781 100962       dl  w0  x2+6      ;
27782 100964       ds  w0  x1+6      ;
27783 100966       dl  w0  x2+2      ;
27784 100968       ds  w0  x1+2      ;
27785 100970  h4:                    ; top of move-table:
27786 100970  h5 = h3 - h4           ; size of move-table (notice: negative)
27787 100970  
27787 100970       al  w1  x1-h5     ;    increase(to-address);
27788 100972       al  w2  x2-h5     ;    increase(from-address);
27789 100974       rl. w3     h1.    ;    restore(remaining);
27790 100976       al  w3  x3-h5     ;    decrease(remaining);  (remember: negative)
27791 100978       sh  w3    -1      ;    if not all moved yet then
27792 100980       jl.        g1.    ;      goto move double words;
27793 100982  
27793 100982       jl.       (h0.)   ;    return;
27794 100984  
27794 100984  g5:                    ; move single word:
27795 100984       rl  w0  x2+0      ;
27796 100986       rs  w0  x1+0      ;
27797 100988       al  w1  x1+2      ;    increase(to-address);
27798 100990       al  w2  x2+2      ;    increase(from-address);
27799 100992       al  w3  x3+2      ;    decrease(remaining);  (remember: negative)
27800 100994       jl.        g1.    ;    goto move double words;
27801 100996  
27801 100996  h0:  0                 ; saved return
27802 100998  h1:  0                 ; remaining bytes (negative, multiplum of 4 bytes)
27803 101000  e.                     ;
27804 101000  
27804 101000  ; procedure find idle area  or pseudo;
27805 101000  ;
27806 101000  ; reg     call            return
27807 101000  ; w0                        0
27808 101000  ; w1                        unchanged
27809 101000  ; w2                        proc
27810 101000  ; w3      link              proc
27811 101000  ;
27812 101000  b. h5,g5 w.
27813 101000  e40: rs. w3     h3.    ; begin
27814 101002       al  w0     0      ;
27815 101004       rl  w2     b5     ;
27816 101006       al  w2  x2-2      ;
27817 101008  g0:  al  w2  x2+2      ;   repeat
27818 101010       sn  w2     (b6)   ;     if end_of_name_table.area then
27819 101012       jl.        j1.    ;        result 1;
27820 101014       rl  w3  x2        ;     proc:=next;
27821 101016       sn  w0  (x3+a11)  ;     test idle;
27822 101018       se  w0  (x3+a50)  ;
27823 101020       jl.        g0.    ;   until proc is idle;
27824 101022                         ;
27825 101022       rs. w2     d11.   ; found: set name table entry;
27826 101024       rl  w2  x2        ;
27827 101026       jl.        (h3.)  ;
27828 101028  h3:  0                 ; saved return;
27829 101030  e.
27830 101030  
27830 101030  
27830 101030  ; procedure compare names
27831 101030  ;
27832 101030  ;   the names at name.work and name.param are compared
27833 101030  ;
27834 101030  ; call: w2 = chain addr, w3 = link
27835 101030  ; exit: w0w1 = undef, w2w3 = unchanged
27836 101030  ;
27837 101030  ; return: link+0: not same name
27838 101030  ;         link+2: the names are equal
27839 101030  
27839 101030  e41:                   ; compare names:
27840 101030       dl. w1     v13.   ;
27841 101032       sn  w0 (x2+f55+0) ;    if first part of name.work <>
27842 101034       se  w1 (x2+f55+2) ;       first part of name.chain then
27843 101036       jl      x3        ;      return not same;
27844 101038  
27844 101038       dl. w1     v14.   ;    if second part of name.work <>
27845 101040       sn  w0 (x2+f55+4) ;
27846 101042       se  w1 (x2+f55+6) ;       second part of name.chain then
27847 101044       jl      x3        ;      return not same;
27848 101046  
27848 101046       jl      x3+2      ;    return same;
27849 101048  
27849 101048  
27849 101048  
27849 101048  ; procedure for all named entries in cat do
27850 101048  ;
27851 101048  ;   the namekey.work is computed, and the current catalog is searched for
27852 101048  ;     entries with name = name.work.
27853 101048  ;   for each such entry the found-action is called
27854 101048  ;
27855 101048  ; call:  jl. w3  e42.
27856 101048  ;        jl.     no more
27857 101048  ;        <action for found entry>
27858 101048  ;           w0w1 = base.entry, w2 = entry
27859 101048  ;        (maybe save w2)
27860 101048  ;        ...
27861 101048  ;        (maybe restore w2, if changed)
27862 101048  ;        jl      x3
27863 101048  ;
27864 101048  ; error return: result 2, in case of io-error
27865 101048  ;
27866 101048  ; return: link+0: no more entries (all regs undef)
27867 101048  ;         link+2: w0w1 = base.entry, w2 = entry, w3 = continue search
27868 101048  
27868 101048  b. h0 w.
27869 101048  
27869 101048  e42:                   ; for all named entries in cat do:
27870 101048       rs. w3     h0.    ;
27871 101050       jl. w3     e3.    ;    compute namekey.work;
27872 101052       rl. w2    d28.    ;    segment := segment.work
27873 101054  
27873 101054       jl. w3     e14.   ;    for all key entries do
27874 101056       jl.       (h0.)   ;+2:   no more: goto no-more action;
27875 101058  
27875 101058  ; for each entry the name must be tested:
27876 101058       dl. w1     v13.   ;
27877 101060       sn  w0 (x2+f5+0)  ;
27878 101062       se  w1 (x2+f5+2)  ;    if name.entry <> name.work then
27879 101064       jl      x3        ;      return;
27880 101066  
27880 101066       dl. w1     v14.   ;
27881 101068       sn  w0 (x2+f5+4)  ;
27882 101070       se  w1 (x2+f5+6)  ;
27883 101072       jl      x3        ;
27884 101074  
27884 101074  ; the name.entry was correct, now exit to check the base.entry
27885 101074       dl  w1  x2+f2     ;    w0w1 := base.entry;
27886 101076       am.       (h0.)   ;
27887 101078       jl        +2      ;    call found-action and return;
27888 101080  
27888 101080  h0:  0                 ; saved return;
27889 101082  
27889 101082  e.                     ;
27890 101082  
27890 101082  
27890 101082  
27890 101082  ; procedure for all named procs in part of nametable do
27891 101082  ;
27892 101082  ;   the specified part of nametable is scanned for processes with
27893 101082  ;     name.proc = name.work
27894 101082  ;   for each process the found-action is called
27895 101082  ;
27896 101082  ; call:  jl. w3  e43.
27897 101082  ;          <first>    ; e.g. b5 (=first area process in nametable)
27898 101082  ;          <top>      ; e.g. b6 (=top   area process in nametable)
27899 101082  ;        jl.     no more
27900 101082  ;        <action for found process>
27901 101082  ;           w2 = nametable address
27902 101082  ;        (maybe save w2)
27903 101082  ;        ...
27904 101082  ;        (maybe restore w2)
27905 101082  ;        jl      x3
27906 101082  ;
27907 101082  ; return: link+4: no more processes (all regs undef)
27908 101082  ;         link+6: w0w1 = base.process, w2 = nametable address, w3 = continue
27909 101082  
27909 101082  b. g10, h10 w.
27910 101082  
27910 101082  e43:                   ; for all processes in part of nametable do:
27911 101082       rl  w2 (x3+0)     ;    get first nametable address;
27912 101084       rl  w0 (x3+2)     ;    get top   nametable address;
27913 101086       al  w3  x3+6      ;
27914 101088       ds. w0     h1.    ;    save(found-action address, top nametable address);
27915 101090  
27915 101090       al  w2  x2-2      ;
27916 101092  g1:                    ; next process:
27917 101092       dl. w1     v13.   ;
27918 101094  g2:                    ;
27919 101094       al  w2  x2+2      ;    increase(nametable address);
27920 101096       sn. w2    (h1.)   ;    if nametable address = top name table address then
27921 101098       jl.        g10.   ;      goto no-more action;
27922 101100  
27922 101100       rl  w3  x2+0      ;    proc := word(nametable address);
27923 101102  
27923 101102       sn  w0 (x3+a11+0) ;
27924 101104       se  w1 (x3+a11+2) ;    if name.proc <> name.work then
27925 101106       jl.        g2.    ;      goto next process;
27926 101108  
27926 101108       dl. w1     v14.   ;
27927 101110       sn  w0 (x3+a11+4) ;
27928 101112       se  w1 (x3+a11+6) ;
27929 101114       jl.        g1.    ;
27930 101116  
27930 101116  ; the process-name was correct, now exit to check the base.process
27931 101116       dl  w1  x3+a49    ;    w0w1 := base.process;
27932 101118       al. w3     g1.    ;    return := next process;
27933 101120       jl.       (h0.)   ;    call found-action;
27934 101122  
27934 101122  g10: am.       (h0.)   ; no-more action:
27935 101124       jl        -2      ;    goto no-more;
27936 101126  
27936 101126  h0:  0                 ; return to found-action
27937 101128  h1:  0                 ; top name table address
27938 101130  
27938 101130  e.                     ;
27939 101130  
27939 101130  
27939 101130  
27939 101130  ; procedure find idle process in part of nametable
27940 101130  ;
27941 101130  ;   the specified part of nametable is scanned until an idle process is found
27942 101130  ;   (notice: it must exist)
27943 101130  ;
27944 101130  ; call:  jl. w3  e44.
27945 101130  ;        <first>     ; e.g. b5 (= first area process in name table)
27946 101130  ;
27947 101130  ; return: cur proc nametable address is defined
27948 101130  ;         w0 = 0, w1 = unchanged, w2 = proc, w3 = undef
27949 101130  
27949 101130  b. g10 w.
27950 101130  
27950 101130  e44:                   ; find idle process in part of nametable:
27951 101130       al  w0     0      ;
27952 101132       rl  w2 (x3)       ;    nametable address := param;
27953 101134       se  w2    (b6)    ;    (if internal processes then skip procfunc itself)
27954 101136       al  w2  x2-2      ;
27955 101138  g1:                    ; next process:
27956 101138       al  w2  x2+2      ;    increase(nametable address);
27957 101140       am     (x2)       ;    if name.process(nametable address) <> 0 then
27958 101142       se  w0   (+a11)   ;
27959 101144       jl.        g1.    ;      goto next process;
27960 101146  
27960 101146       rs. w2     d11.   ;    save(cur proc nametable addr);
27961 101148       rl  w2  x2        ;    w2 := proc;
27962 101150       jl      x3+2      ;    return;
27963 101152  
27963 101152  e.                     ;
27964 101152  
27964 101152  
27964 101152  
27964 101152  ; procedure find chain
27965 101152  ;
27966 101152  ;   searches the chaintables in order to find a chainhead with
27967 101152  ;     docname.chain = name
27968 101152  ;
27969 101152  ; call:  jl. w3  e45.
27970 101152  ;        <name address>
27971 101152  ;
27972 101152  ; error return:  result 6, if name(0) = 0
27973 101152  ;
27974 101152  ; return: link+2: chain not found   (all regs undef)
27975 101152  ;         link+4: chain found
27976 101152  ;                   w2 = chain
27977 101152  ;                   other regs undef
27978 101152  
27978 101152  b. g10, h10 w.
27979 101152  
27979 101152  e45:                   ; find chain:
27980 101152       rl  w1  x3        ;    w1 := start of name;
27981 101154       al  w1  x1+2      ;
27982 101156       al  w2  x1+4      ;
27983 101158       ds. w2     h2.    ;    save (first double, last double);
27984 101160  
27984 101160       al  w3  x3+2      ;
27985 101162       rs. w3     h0.    ;    save (error return address);
27986 101164  
27986 101164       rl  w3     b22    ;    entry := first drumchain in name table;
27987 101166       al  w3  x3-2      ;
27988 101168  
27988 101168  g1:                    ; next chain:
27989 101168       dl. w1    (h2.)   ;    w0w1 := last double word of name;
27990 101170  g2:                    ;
27991 101170       al  w3  x3+2      ;    increase (entry);
27992 101172       sn  w3    (b24)   ;    if all chains tested then
27993 101174       jl.       (h0.)   ;      error return;
27994 101176  
27994 101176       rl  w2  x3        ;    chain := name table(entry);
27995 101178       sn  w0 (x2+f61+4) ;
27996 101180       se  w1 (x2+f61+6) ;    if name.chain <> name then
27997 101182       jl.        g2.    ;      goto next chain;
27998 101184  
27998 101184       dl. w1    (h1.)   ;
27999 101186       sn  w0 (x2+f61+0) ;
28000 101188       se  w1 (x2+f61+2) ;
28001 101190       jl.        g1.    ;
28002 101192  
28002 101192  ; a chain was found, with docname.chain = name
28003 101192  ; check that the chain is not empty
28004 101192  
28004 101192       sn  w0     0      ;    if name(0) = 0 then
28005 101194       jl.        j6.    ;      result 6;  i.e. nameformat illegal;
28006 101196  
28006 101196       am.       (h0.)   ;
28007 101198       jl        +2      ;    return ok;
28008 101200  
28008 101200  h0:  0                 ; return
28009 101202  h1:  0                 ; address of first double word of name
28010 101204  h2:  0                 ; address of last  double word of name
28011 101206  
28011 101206  e.                     ;
28012 101206  
28012 101206  
28012 101206  
28012 101206  ; procedure search best entry in catalog
28013 101206  ;
28014 101206  ;   searches the current catalog for an entry with name.entry = name.work
28015 101206  ;     and with the narrowest interval containing base.work
28016 101206  ;   the entry is moved to work
28017 101206  ;
28018 101206  ; call:  jl. w3  e46.
28019 101206  ;        jl.     not found
28020 101206  ;        jl.     found
28021 101206  ;
28022 101206  ; error return: result 2, in case of io-error
28023 101206  ;               result 6, in case of nameformat illegal
28024 101206  ;
28025 101206  ; return: link+0: no entry with name.entry = name.work was found
28026 101206  ;                   with an interval containing base.work
28027 101206  ;                 (all regs undef)
28028 101206  ;         link+2: an entry was found:
28029 101206  ;                   w0w1 = base.entry
28030 101206  ;                   cur entry (and -segment) is defined
28031 101206  ;                   entry is moved to work
28032 101206  ;                 (all regs undef)
28033 101206  
28033 101206  b. g20, h10 w.
28034 101206  
28034 101206  e46:                   ; search best entry in catalog:
28035 101206       rs. w3     h0.    ;    save(return);
28036 101208  
28036 101208       dl  w1     b40    ;    best base := system base;
28037 101210       ds. w1     h2.    ;
28038 101212       al  w0     0      ;    cur entry := 0;
28039 101214       rs. w0     d3.    ;
28040 101216  
28040 101216       jl. w3     e42.   ;    for all named entries in catalog do
28041 101218       jl.        g5.    ;+2:   no more: goto test any found;
28042 101220  
28042 101220  ; w0w1 = base.entry, w2 = entry, w3 = continue search
28043 101220       sh. w0    (v1.)   ;    if base.entry does not contain base.work
28044 101222       sh. w0    (h1.)   ;    or base.entry is not better than best base then
28045 101224       jl      x3        ;      continue search;
28046 101226  
28046 101226       sl. w1    (v2.)   ;
28047 101228       sl. w1    (h2.)   ;
28048 101230       jl      x3        ;
28049 101232  
28049 101232  ; a better entry was found: save new base as best base
28050 101232       bs. w0     1      ;    (code trick)
28051 101234       al  w1  x1+1      ;    (code trick)
28052 101236       ds. w1     h2.    ;    best base := base.entry;
28053 101238  
28053 101238  ; procedure save position
28054 101238  ;
28055 101238  ; call:  w2 = entry
28056 101238  ;        jl. w3  e48.
28057 101238  ; exit:  w2,w3 = unchanged
28058 101238  
28058 101238  e48:                    ; save position:
28059 101238       rl. w1     d8.+f36;    cur entry segment := current segment;
28060 101240       ds. w2     d3.    ;    cur entry := entry;
28061 101242       jl      x3        ;    return;;
28062 101244  
28062 101244  g5:                    ; test any found:
28063 101244       rl. w2     d3.    ;    if cur entry = 0 then
28064 101246       sn  w2     0      ;      goto test format;
28065 101248       jl.        g10.   ;    (i.e. no entries was found, maybe illegal name)
28066 101250  
28066 101250       jl. w3     e11.   ;    get current entry segment;
28067 101252       al. w1     d1.    ;
28068 101254       rl. w2     d3.    ;
28069 101256       jl. w3     e33.   ;    move entry to work;
28070 101258  
28070 101258       dl. w1     v2.    ;    w0w1 := base.work;
28071 101260       am.       (h0.)   ;    ok return;
28072 101262       jl        +2      ;
28073 101264  
28073 101264  g10:                   ; test format:
28074 101264       jl. w3     e24.   ;    test format;
28075 101266       jl.       (h0.)   ;    not-found return;
28076 101268  
28076 101268  h0:  0                 ; saved return
28077 101270  h1:  0                 ; lower best interval - 1
28078 101272  h2:  0                 ; upper best interval + 1
28079 101274  
28079 101274  
28079 101274  
28079 101274  
28079 101274  ; procedure search best process in nametable
28080 101274  ;
28081 101274  ;   searches the nametable for a process with name.process = name.work
28082 101274  ;     and with the narrowest interval containing base.work
28083 101274  ;
28084 101274  ; call:  jl. w3  e47.
28085 101274  ;          <first>    ; e.g. b5 (=first area process in nametable)
28086 101274  ;          <top>      ; e.g. b6 (=top   area process in nametable)
28087 101274  ;        jl.     not found
28088 101274  ;        jl.     found
28089 101274  ;
28090 101274  ; return: link+4: no process with name.process = name.work was found
28091 101274  ;                 (all regs undef)
28092 101274  ;         link+6: a process was found:
28093 101274  ;                   cur process nametable address is defined
28094 101274  ;                   w0w1 = base.process, w2 = process
28095 101274  ;                 (other regs undef)
28096 101274  
28096 101274  
28096 101274  e47:                   ; search best process in nametable:
28097 101274       rs. w3     h0.    ;    save(return);
28098 101276  
28098 101276       dl  w1  x3+2      ;    get search limits;
28099 101278       ds. w1     h5.    ;
28100 101280  
28100 101280       dl  w1     b40    ;    best base := system base;
28101 101282       ds. w1     h2.    ;
28102 101284       al  w0     0      ;    cur proc nametable address := 0;
28103 101286       rs. w0     d11.   ;
28104 101288  
28104 101288       jl. w3     e43.   ;    for all named processes in part of nametable do
28105 101290         0 ; e.g. b3     ; (start limit)
28106 101292  h5:    0 ; e.g. b7     ; (top limit)
28107 101294       jl.        g20.   ;+6:   no more: goto test any found;
28108 101296  
28108 101296  ; w0w1 = base.process, w2 = nametable address, w3 = continue address
28109 101296       sh. w0    (v1.)   ;    if base.process does not contain base.work
28110 101298       sh. w0    (h1.)   ;    or base.process in not better than best base then
28111 101300       jl      x3        ;      continue search;
28112 101302  
28112 101302       sl. w1    (v2.)   ;
28113 101304       sl. w1    (h2.)   ;
28114 101306       jl      x3        ;
28115 101308  
28115 101308  ; a better process was found, save new base and nametable address
28116 101308       bs. w0     1      ;    (code trick)
28117 101310       al  w1  x1+1      ;    (code trick)
28118 101312       ds. w1     h2.    ;    best base := base.process;
28119 101314  
28119 101314       rs. w2     d11.   ;    cur process nametable address := nametable address
28120 101316       jl      x3        ;    continue search;
28121 101318  
28121 101318  g20:                   ; test any found:
28122 101318       rl. w2     d11.   ;
28123 101320       rl. w3     h0.    ;
28124 101322       sn  w2     0      ;    if cur proc nametable address = 0 then
28125 101324       jl      x3+4      ;      not-found return;
28126 101326  
28126 101326       rl  w2  x2        ;    proc := nametable (name table address);
28127 101328       dl  w1  x2+a49    ;    w0w1 := base.proc;
28128 101330       jl      x3+6      ;    ok-return;
28129 101332  
28129 101332  e.                     ;
28130 101332  
28130 101332  
28130 101332  ; insert statinf.
28131 101332  ; this procedure moves the contents of the statarea of
28132 101332  ; the work area to the current entry (docname area).
28133 101332  ;
28134 101332  ; call:  jl. w3  e49.
28135 101332  ;
28136 101332  ; return: all registers destroyed
28137 101332  
28137 101332  e49: rl. w1  d3.       ; insert statinf;
28138 101334       al  w1  x1+f11    ;
28139 101336       al. w2  d30.      ;
28140 101338       jl.     e32.      ;   goto move name;
28141 101340  
28141 101340  
28141 101340  ; get statinf.
28142 101340  ; this procedure moves the contents of the statarea in current entry
28143 101340  ; to the work area.
28144 101340  ;
28145 101340  ; call:  jl. w3  e50.
28146 101340  ;
28147 101340  ; return:  all registers destroyed
28148 101340  
28148 101340  e50: al. w1  d30.      ; get statinf:
28149 101342       rl. w2  d3.       ;
28150 101344       al  w2  x2+f11    ;
28151 101346       jl.     e32.      ;   goto move name;
28152 101348  
28152 101348  ; lock and call monitor subprocedures.
28153 101348  ; note: when called the used tabel-element will contain the return address,
28154 101348  ;       but at return, the original content of the element is restored.
28155 101348  
28155 101348  b.  i4  h.
28156 101348                         ; monitor call table: <subprocedure address>,<tabel index>
28157 101348  i0:  b33,  k-i0-1      ;    remove writeprotect
28158 101350       b35,  k-i0-1      ;    remove element
28159 101352       b36,  k-i0-1      ;    link   element
28160 101354       b37,  k-i0-1      ;    remove user
28161 101356       b39,  k-i0-1      ;    insert reserver
28162 101358       b46,  k-i0-1      ;    insert user
28163 101360       b48,  k-i0-1      ;    check  user and reserver
28164 101362  w.                     ; table end;
28165 101362  i1:  0                 ; monitor entry
28166 101364  i2:  0                 ; tabel index
28167 101366  i3:  0                 ; saved w3 from monitor call
28168 101368                         ;
28169 101368  e64: am         2      ;    check user and reserver
28170 101370  e58: am         2      ;    insert user
28171 101372  e57: am         2      ;    insert reserver
28172 101374  e56: am         2      ;    remove user
28173 101376  e55: am         2      ;    link element
28174 101378  e54: am         2      ;    remove element
28175 101380  e53:                   ;    remove writeprotect
28176 101380       rx. w3     i0.    ; begin
28177 101382       rs. w3     i1.    ;   monitor entry, index := monitor call(subroutine);
28178 101384       hs. w3     i2.+1  ;   tabel index := monitor call;
28179 101386       jl. w3     e65.   ;   lock monitor;
28180 101388       zl. w3     i1.    ;
28181 101390       jl  w3  x3        ;   call monitor subprocedure(monitor entry);
28182 101392       rs. w3     i3.    ;   save w3
28183 101394       jl. w3     e66.   ;   unlock monitor;
28184 101396       rl. w3     i1.    ;   monitor call(tabel index):= monitor entry, index;
28185 101398       am.       (i2.)   ;
28186 101400       rx. w3     i0.    ;
28187 101402       rx. w3     i3.    ;   restore w3 , save return
28188 101404       jl.       (i3.)   ;   return
28189 101406                         ; end;
28190 101406                         ;
28191 101406  ;
28192 101406  ; lock and check user
28193 101406  ;
28194 101406  e59:                   ; lock and check user
28195 101406       rs. w3     i4.    ; begin
28196 101408       jl. w3     e65.   ;   lock monitor;
28197 101410       jl  w3     b47    ;   call check user;
28198 101412       am        -2      ;   +0: not user
28199 101414       al  w3     0      ;   +2: user
28200 101416       wa. w3     i4.    ;
28201 101418       al  w3  x3+2      ;   return addr := return addr + result;
28202 101420       jl.        e66.   ;   unlock monitor and return;
28203 101422                         ;
28204 101422  i4:  0                 ;
28205 101424  e.                     ; end;
28206 101424  
28206 101424  
28206 101424  
28206 101424  
28206 101424  
28206 101424  ; the following set of procedures handles the conversion of
28207 101424  ;   logical sender-addresses (in case of rc8000)
28208 101424  ;
28209 101424  ; they all have a common call- and return-sequence:
28210 101424  ;
28211 101424  ; call:  jl. w2  e<number>
28212 101424  ; return: w2 = abs address
28213 101424  ;         w0, w1, w3 unchanged
28214 101424  
28214 101424  b. g10, h10 w.
28215 101424  
28215 101424  e60:                   ; get w1-abs:
28216 101424       rs. w2     h0.    ;
28217 101426       al  w2     a29    ;    w2 := rel of save w1;
28218 101428       jl.        g0.    ;    goto get abs;
28219 101430  
28219 101430  e61:                   ; get w2-abs:
28220 101430       rs. w2     h0.    ;
28221 101432       al  w2     a30    ;    w2 := rel of save w2;
28222 101434       jl.        g0.    ;    goto get abs;
28223 101436  
28223 101436  e62:                   ; get w3-abs:
28224 101436       rs. w2     h0.    ;
28225 101438       al  w2     a31    ;    w2 := rel of save w3;
28226 101440  
28226 101440  g0:                    ; get abs:
28227 101440       am.       (d2.)   ;
28228 101442       rl  w2  x2        ;    w2 := saved wreg.sender (logical address);
28229 101444  
28229 101444  g1:                    ; convert to abs:
28230 101444  c. 8000                ;    if rc8000 then
28231 101444       am.       (d2.)   ;
28232 101446       wa  w2    +a182   ;      w2 := logical address + base.sender;
28233 101448  z.                     ;
28234 101448       jl.       (h0.)   ;    return;
28235 101450  
28235 101450  h0:  0                 ; saved return
28236 101452  
28236 101452  
28236 101452  ; procedure get abs address
28237 101452  ;
28238 101452  ; call:  al  w2  <logical addr>
28239 101452  ;        jl. w3  e63.
28240 101452  ;
28241 101452  ; return: w2 = abs address
28242 101452  ;         w0, w1, w3 unchanged
28243 101452  
28243 101452  e63:                   ; get abs address
28244 101452       rs. w3     h0.    ;
28245 101454       jl.        g1.    ;    goto convert to abs;
28246 101456  
28246 101456  e.                     ;
28247 101456  
28247 101456  
28247 101456  ; lock monitor
28248 101456  ; if mpu the monitor lock is locked else the interrupt disable limit is selected
28249 101456  ;
28250 101456  
28250 101456  b.  h1  w.
28251 101456                         ; lock monitor
28252 101456  e65:                   ; begin
28253 101456       am        (b9)    ;
28254 101458  h0=k                   ;   if mpu then
28255 101458       jl.        0      ;   lock(monitor lock);
28256 101460       lk         b51    ;
28257 101462  c.(:h0+a8-k-1:)        ;
28258 101462       am         0      ;
28259 101462  r.(:h0+a8+2-k:)>1      ;   fill up;
28260 101462  z.                     ;
28261 101462       jd      x3        ;   return disabled;
28262 101464  e.                     ; end;
28263 101464  
28263 101464  ; unlock monitor
28264 101464  ; if mpu the monitor is released else the interrupt enable limit is selected
28265 101464  
28265 101464  b.  h1  w.
28266 101464                         ; unlock monitor
28267 101464  e66:                   ; begin
28268 101464       am        (b9)    ;
28269 101466  h0=k                   ;   if mpu then
28270 101466       jl.        0      ;   unlock(monitor lock);
28271 101468       ul         b51    ;
28272 101470  c.(:h0+a8-k-1:)        ;
28273 101470       am         0      ;
28274 101470  r.(:h0+a8+2-k:)>1      ;   fill up;
28275 101470  z.                     ;
28276 101470       je      x3        ;   return enabled;
28277 101472  e.                     ; end;
28278 101472  
28278 101472  
28278 101472  ; procedure clean area process(proc);
28279 101472  ; reg    call       return
28280 101472  ; w0                  0
28281 101472  ; w1                unchanged
28282 101472  ; w2     proc           -
28283 101472  ; w3     link       number of oustanding buffers
28284 101472  ;
28285 101472  b. h3  w.
28286 101472  e67: rs. w3     h3.    ; save return
28287 101474       al  w0     0      ;
28288 101476       rs  w0  x2+a11    ; name(0).area:=0;
28289 101478       zl  w3  x2+a57    ;
28290 101480       sn  w3     0      ; if number of outstanding buffers=0 then
28291 101482       rs  w0  x2+a50    ; clear main;
28292 101484       jl.        (h3.)  ;
28293 101486  h3:  0                 ; saved return;
28294 101488  e.
28295 101488  
28295 101488  
28295 101488  
28295 101488  ; the following set of procedures take care of all moves between
28296 101488  ;   sender-process and procfunc.
28297 101488  ;
28298 101488  ; they all have a common call- and return-sequence:
28299 101488  ;
28300 101488  ; call:  jl. w3  e<number>
28301 101488  ; return: all regs undef
28302 101488  
28302 101488  b. h10 w.
28303 101488  
28303 101488  ;    size       procfunc addres
28304 101488  
28304 101488  h1:  8   ,      v5     ; name.work
28305 101492  h2:  8   ,      v11    ; docname.work
28306 101496  h3:  f8  ,      v6     ; tail.work
28307 101500  h4:                    ; (chainhead)
28308 101500  h5:  f0  ,      d1     ; entry.work
28309 101504  h6:  12  ,      v6     ; registers to tail.work
28310 101508  h7:  18  ,      v6     ; internal params to tail.work
28311 101512  h8:  10  ,      v5     ; name + nametable addr
28312 101516  h9:  4*a110+4 , d16    ; bs-claims to bs-params
28313 101520  
28313 101520  ; moves from senders w1-area:
28314 101520  e76: am         h7-h9  ; internal params to tail.work:
28315 101522  e75: am         h9-h6  ; bs-claims to bs-params:
28316 101524  e74: am         h6-h5  ; registers to tail.work:
28317 101526  e73: am         h5-h3  ; complete entry to work:
28318 101528  e72: am         h3-h2  ; tail to tail.work:
28319 101530  e71: am         h2-h1  ; name to docname.work:
28320 101532  e70: dl. w1     h1.+2  ; name to name.work:
28321 101534       jl. w2     e60.   ;    w2 := abs address of w1-area;
28322 101536       jl.        e31.   ;    goto move;
28323 101538  
28323 101538  ; moves to senders w1-area:
28324 101538  e82: am         h1-h5  ; name.work to name:
28325 101540  e81: am         h5-h3  ; work to complete entry:
28326 101542  e80: dl. w1     h3.+2  ; tail.work to tail:
28327 101544  e83:                   ; bs-claims.cur.proc to sender area
28328 101544       jl. w2     e60.   ;    w2 := abs address of w1-area;
28329 101546       rx  w2     2      ;    exchange ..to.. and ..from..;
28330 101548       jl.        e31.   ;    goto move;
28331 101550  
28331 101550  ; moves from senders w2-area:
28332 101550  e85: dl. w1     h2.+2  ; name to docname.work:
28333 101552       jl. w2     e61.   ;    w2 := abs address of w2-area;
28334 101554       jl.        e31.   ;    goto move;
28335 101556  
28335 101556  ; moves from senders w3-area:
28336 101556  e92: am         h4-h2  ; chainhead to work:
28337 101558  e91: am         h2-h1  ; name to docname.work:
28338 101560  e90: dl. w1     h1.+2  ; name to name.work:
28339 101562       jl. w2     e62.   ;    w2 := abs address of w3-area;
28340 101564       jl.        e31.   ;    goto move;
28341 101566  
28341 101566  ; moves to senders w3-area:
28342 101566  e96: am         h8-h1  ; name and nametable addr to name etc.:
28343 101568  e95: dl. w1     h1.+2  ; name.work to name:
28344 101570       jl. w2     e62.   ;    w2 := abs address of w3-area;
28345 101572       rx  w2     2      ;    exchange ..to.. and ..from..;
28346 101574       jl.        e31.   ;    goto move;
28347 101576  
28347 101576  e.                     ;
28348 101576  
28348 101576  
28348 101576  
28348 101576  ; the following set of procedures handles the interpretation
28349 101576  ;   of the function-tables.
28350 101576  ;
28351 101576  ; most of the entries leave w0 and w2 unchanged
28352 101576  
28352 101576  b. g20, h10 w.
28353 101576  
28353 101576  h0 = 1                 ; size of instructions (in bytes)
28354 101576  
28354 101576  h1:  0                 ; current instruction pointer
28355 101578                         ;    (points at instruction being interpreted)
28356 101578  h2:  0                 ; first free in stack
28357 101580  h3:  0, r.3            ; stack
28358 101586  
28358 101586  c.(:a92>22a.1:)-1
28359 101586  m.                test buffer pointers (first, last, next)
28360 101586  h4:  d49               ; first of test buffer
28361 101586  h5:  d50               ; top   of test buffer
28362 101586  h6:  d49               ; current  test address
28363 101586  z.
28364 101586  
28364 101586  
28364 101586  n2:  am         h0     ; skip 2 instructions:
28365 101588  n1:  am         h0     ; skip 1 instruction:
28366 101590  n0:  al  w3     h0     ; next instruction:
28367 101592  g0:  wa. w3     h1.    ;    w3 := abs addr of next instruction byte;
28368 101594  g1:  rs. w3     h1.    ;    save (cur instruction ptr);
28369 101596  
28369 101596  ; test start:
28370 101596  c.(:a92>22a.1:)-1
28371 101596       rs. w3    (h6.)   ;    save (cur instr ptr) in test buffer;
28372 101596       rl. w3     h6.    ;
28373 101596       al  w3  x3+2      ;    increase (test buffer ptr);
28374 101596       sl. w3    (h5.)   ;    (unless outside buffer);
28375 101596       rl. w3     h4.    ;
28376 101596       rs. w3     h6.    ;
28377 101596       rl. w3     h1.    ;    (restore (cur instr ptr) )
28378 101596  z.
28379 101596  ; test end
28380 101596  
28380 101596       bz  w3  x3        ;    w3 := instruction byte (positive integer);
28381 101598  ; when the function is entered, w0, w1 and w2 are unchanged from last
28382 101598  ;   function call.
28383 101598  ; w3 = return to next instruction
28384 101598       jl. w3  x3+n50.   ;    goto function (w3);
28385 101600       jl.        n0.    ;    (if it was a procedure then goto next instruction)
28386 101602  
28386 101602  n6:  am         h0     ; goto-action 2:  goto second param;
28387 101604  n5:  al  w3     h0     ; goto-action 1:  goto first param;
28388 101606       wa. w3     h1.    ;    w3 := abs address of param byte;
28389 101608       ba  w3  x3        ;    w3 := abs addr of next instruction;
28390 101610       jl.        g1.    ;    goto save cur instruction address;
28391 101612  
28391 101612  ; procedure next param
28392 101612  ;
28393 101612  ; call: jl. w3  n10.
28394 101612  ; return: w0 = next param (signed integer)
28395 101612  
28395 101612  n10: al  w0     h0     ; next param:
28396 101614       wa. w0     h1.    ;    w0 := abs addr of param byte;
28397 101616       rs. w0     h1.    ;    save (cur instruction ptr);
28398 101618       bl  w0    (0)     ;    w0 := param (cur instr ptr);
28399 101620       jl      x3        ;    return;
28400 101622  
28400 101622  
28400 101622  ; procedure call table program
28401 101622  ;
28402 101622  ; call: al  w3  <abs address of start of program>
28403 101622  ;       jl.     n20.
28404 101622  
28404 101622  n20: rl. w1     h1.    ; call table program:
28405 101624       rs. w1    (h2.)   ;    stack (cur instr ptr);
28406 101626       rl. w1     h2.    ;
28407 101628       al  w1  x1+2      ;    increase (stack ptr);
28408 101630  g10: rs. w1     h2.    ;
28409 101632       jl.        g1.    ;    goto save abs instr ptr;
28410 101634  
28410 101634  n33: am         n5-n1  ; return to program and goto:
28411 101636  n31: am         n1-n0  ; return to program and skip:
28412 101638  n30: al. w3     n0.    ; return to program:
28413 101640       rl. w1     h2.    ;
28414 101642       al  w1  x1-2      ;    decrease (stack ptr);
28415 101644       rs. w1     h2.    ;
28416 101646       rl  w1  x1        ;    unstack (cur instr ptr);
28417 101648       rs. w1     h1.    ;
28418 101650       jl      x3        ;    goto next or skip or goto-action;
28419 101652  
28419 101652  
28419 101652  ; subroutine call following program and return later to function
28420 101652  ;
28421 101652  ; call: jl. w3  n25.
28422 101652  
28422 101652  n25: rl. w1     h2.    ; call from function:
28423 101654       rs  w3  x1        ;    stack (return to function);
28424 101656       rl. w3     h1.    ;
28425 101658       rs  w3  x1+2      ;    stack (cur instr ptr);
28426 101660       al  w1  x1+4      ;    increase (stack ptr);
28427 101662       al  w3  x3+h0+h0  ;    w3 := abs addr of second byte;
28428 101664       jl.        g10.   ;    goto save stackptr and cur instr ptr;
28429 101666  
28429 101666  n35: rl. w1     h2.    ; return from program to function:
28430 101668       al  w1  x1-4      ;
28431 101670       rs. w1     h2.    ;    decrease (stack ptr);
28432 101672       rl  w3  x1+2      ;    unstack (cur instr ptr);
28433 101674       rs. w3     h1.    ;
28434 101676       jl     (x1)       ;    return to unstack (function);
28435 101678  
28435 101678  
28435 101678  
28435 101678  n50:                   ; base of interpretation addresses:
28436 101678  
28436 101678  
28436 101678  
28436 101678  ; start interpretation
28437 101678  ;
28438 101678  ;   the previous procfunc call is answerred and the next is awaited
28439 101678  ;   the differrent pointers are initialized
28440 101678  
28440 101678  j7:  am         7-6    ; result 7:
28441 101680  j6:  am         6-5    ; result 6:
28442 101682  j5:  am         5-4    ; result 5:
28443 101684  j4:  am         4-3    ; result 4:
28444 101686  j3:  am         3-2    ; result 3:
28445 101688  j2:  am         2-1    ; result 2:
28446 101690  j1:  am         1-0    ; result 1:
28447 101692  j0:  al  w0     0      ; result 0:
28448 101694       jl. w3     e66.    ; unlock(monitor)
28449 101696       rl. w1     d2.    ;    w1 := sender;
28450 101698       rs  w0  x1+a28    ;    w0.sender := result;
28451 101700       jl. w3     e1.    ;    set maincat;
28452 101702       jl. w3     e7.    ;    terminate update;
28453 101704  
28453 101704  j10: jd         1<11+2 ; waiting instruction:
28454 101706       rl  w1     (b6)   ;    w1 := procfunc;
28455 101708       rl  w1  x1+a15    ;    sender := next (messq (procfunc) ) - a16;
28456 101710       al  w1  x1-a16    ;
28457 101712       rs. w1     d2.    ;    save (sender);
28458 101714  
28458 101714       rl  w3  x1+a176   ;    w3 := monitor call number;
28459 101716       ws. w3     h9.    ;    ( = word (ic.sender - 2) - jd 1<11+40 )
28460 101718  
28460 101718  ; w1 = sender
28461 101718  ; w3 = monitor call number
28462 101718  
28462 101718       al. w2     h3.    ;
28463 101720       rs. w2     h2.    ;    stack ptr := start of stack;
28464 101722       ls  w3    -1      ;
28465 101724       wa. w3     h10.   ;    cur instruction ptr := start table (monitor call);
28466 101726       ba  w3  x3        ;
28467 101728       jl.        g1.    ;    goto next instruction;
28468 101730  h9:  40                ; first procfunc monitor call
28469 101732  h10: n49               ; start of table
28470 101734  
28470 101734  
28470 101734  ; redefinition of d-names
28471 101734  
28471 101734  l2 : d2
28472 101736  l4 : d4
28473 101738  l14: d14
28474 101740  l15: d15
28475 101742  
28475 101742  e.                     ;
28476 101742  \f


28476 101742  m.
28476 101742                  monprocfnc2 - monitor process functions, part 2 17.0 beta

28477 101742  
28477 101742  ; se editor tab line (use ts og dk ?? til tr)
28478 101742  ;    !   !   !  !      ! ! ! ! ! ! ! ! ! ! ! ! !       !         !      !
28479 101742  ;                      REVISION HISTORY 
28480 101742  ;      DATE     
28481 101742  ;    88.03.21   14.1   revision history started
28482 101742  ;                      remove process: dont clear name if ida/ifp mainprocess
28483 101742  ;                      stop the monitor in case of internal break
28484 101742  ;    88.04.22   15.0   q21 changed to q20
28485 101742  ;                      io check at buffer.state
28486 101742  ;88.05.24   08.55  kak change of cpa and address base included
28487 101742  ;88.09.02   15.05  kak create entry changed: if docname(1)=0,1,2 or 3 the sender claim is tested
28488 101742  ;                      from perm kye 0 to perm key docname(1)
28489 101742  ;89 03 26 10.24 kak   an error in prepare bs corrected: area claim.sender decreased
28490 101742  ;89 05 25 14.56 kak   at create area and pseudo process a new procedure is called: find idle area
28491 101742  ;91 01 30 14.40 kak  an error in remove pseudo process corrected: relativ addressing  removed in an instruction
28492 101742  
28492 101742  b.i30 w.
28493 101742  i0=89 05 26, i1=12 12 00
28494 101742  
28494 101742  ; if newtime (i0,i1) > oldtime (a133,a134) then oldtime:=newtime;
28495 101742  c.i0-a133
28496 101742    c.i0-a133-1, a133=i0, a134=i1, z.
28497 101742    c.i1-a134-1,          a134=i1, z.
28498 101742  z.
28499 101742  
28499 101742  i10=i0, i20=i1
28500 101742  
28500 101742  i15=i10/100000 , i10=i10-i15*100000 , i25=i20/100000 , i20=i20-i25*100000 
28501 101742  i14=i10/10000  , i10=i10-i14*10000  , i24=i20/10000  , i20=i20-i24*10000 
28502 101742  i13=i10/1000   , i10=i10-i13*1000   , i23=i20/1000   , i20=i20-i23*1000
28503 101742  i12=i10/100    , i10=i10-i12*100    , i22=i20/100    , i20=i20-i22*100
28504 101742  i11=i10/10     , i10=i10-i11*10     , i21=i20/10     , i20=i20-i21*10
28505 101742  
28505 101742  i2:  <:                              date  :>
28506 101766       (:i15+48:)<16+(:i14+48:)<8+46
28507 101768       (:i13+48:)<16+(:i12+48:)<8+46
28508 101770       (:i11+48:)<16+(:i10+48:)<8+32
28509 101772  
28509 101772       (:i25+48:)<16+(:i24+48:)<8+46
28510 101774       (:i23+48:)<16+(:i22+48:)<8+46
28511 101776       (:i21+48:)<16+(:i20+48:)<8+ 0
28512 101778  
28512 101778  i3:  al. w0  i2.       ; write date:
28513 101780       rs  w0  x2+0      ;   first free:=start(text);
28514 101782       al  w2  0         ;
28515 101784       jl      x3        ;   return to slang(status ok);
28516 101786  
28516 101786       jl.     i3.       ;
28517 101788  e.
28518 101788  j.
28518 101742                                date  89.05.26 12.12.00

28519 101742  
28519 101742  
28519 101742  ; btj 1977.06.07
28520 101742  
28520 101742  
28520 101742  ; check maincat
28521 101742  ;   tests the existence of a main catalog
28522 101742  ;
28523 101742  ; call:  m0, <no maincat addr>
28524 101742  ; exit:  w2 = unchanged
28525 101742  ; error exits: goto-action
28526 101742  
28526 101742  m0:                    ; check maincat:
28527 101742       rl  w0     b25    ;
28528 101744       se  w0     0      ;    if maincat docaddr <> 0 then
28529 101746       jl.        n1.    ;      skip
28530 101748       jl.        n5.    ;    else goto next param;
28531 101750  
28531 101750  
28531 101750  
28531 101750  ; check main catalog not on document
28532 101750  ;
28533 101750  ; call: m1
28534 101750  ; error exits: result 6, if maincat on document
28535 101750  
28535 101750  m1:                    ; check maincat not on document:
28536 101750       rl. w0     d4.    ;
28537 101752       se  w0    (b25)   ;    if curdoc <> maincat docaddr then
28538 101754       jl.        n0.    ;      next instruction;
28539 101756       jl.        j6.    ;    goto result 6;
28540 101758  j6=k-2
28541 101758  
28541 101758  
28541 101758  
28541 101758  ; clear maincat
28542 101758  ;
28543 101758  ; call: m2
28544 101758  
28544 101758  m2:                    ; clear maincat:
28545 101758       al  w0     0      ;
28546 101760       rs  w0     b25    ;    maincat docaddr := 0;
28547 101762       jl.        n0.    ;    next instruction;
28548 101764  
28548 101764  
28548 101764  ; if main-catalog entry then goto <addr>
28549 101764  ;
28550 101764  ; call: m3, <maincatalog entry addr>
28551 101764  ; error return: goto-action 1, if main catalog entry
28552 101764  
28552 101764  m3:                    ; test maincat entry:
28553 101764       rl  w2     b25    ;
28554 101766       se. w2    (d4.)   ;    if curdoc <> maincat docaddr then
28555 101768       jl.        n1.    ;      skip;
28556 101770  
28556 101770       al. w2     d9.    ;    w2 := maincat pseudo chain;
28557 101772  
28557 101772       jl. w3     e41.   ;    compare names (name.work, name.pseudochain);
28558 101774       jl.        n1.    ;+2:   not same:  skip;
28559 101776  
28559 101776       bl. w0     v4.    ;    if first slice.work <>
28560 101778       bs  w0  x2+f54    ;       first slice.pseudochain then
28561 101780       se  w0     0      ;
28562 101782       jl.        n1.    ;      skip;
28563 101784  
28563 101784       dl. w1     v2.    ;    if base.work <>
28564 101786       sn  w0 (x2+f1-f0) ;
28565 101788       se  w1 (x2+f2-f0) ;       base.pseudochain then
28566 101790       jl.        n1.    ;      skip;
28567 101792  
28567 101792       jl.        n5.    ;    goto <main catalog entry>;
28568 101794  
28568 101794  
28568 101794  
28568 101794  ; the two following routines terminate the use of the current catalog,
28569 101794  ;   and selects the new catalog.
28570 101794  ; the catalog may either be an auxilliary catalog or the main catalog.
28571 101794  
28571 101794  ; set auxcat
28572 101794  ;
28573 101794  ; call: m4
28574 101794  ; error return: result 2, in case of catalog io-error
28575 101794  
28575 101794  m4:                    ; set auxcat:
28576 101794       jl.        e0.    ;    set auxcat and return;
28577 101796  
28577 101796  ; set maincat
28578 101796  ;
28579 101796  ; call: m5
28580 101796  ; error return: result 2, in case of catalog io-error
28581 101796  
28581 101796  m5:                    ; set maincat:
28582 101796       jl.        e1.    ;    set maincat and return;
28583 101798  
28583 101798  
28583 101798  
28583 101798  ; dump chaintable
28584 101798  ;
28585 101798  ;   the chaintable of curdoc is written back on the device
28586 101798  ;
28587 101798  ; call:  m6
28588 101798  ; error return: result 2, in case of io-error
28589 101798  
28589 101798  m6:                    ; dump chaintable:
28590 101798       jl.        e2.    ;    dump chaintable and return;
28591 101800     e2 = k-2            ; stepping stone
28592 101800  
28592 101800  
28592 101800  ; lock (monitorlock)/ disable interrupt
28593 101800  ; call: m7
28594 101800  ; return: monitor locked/ interrupt disabled
28595 101800  ;
28596 101800  
28596 101800  m7:  jl. w3     e65.    ; lock monitor/disable interrupt
28597 101802       jl.        n0.     ; return
28598 101804  
28598 101804  
28598 101804  
28598 101804  
28598 101804  
28598 101804  
28598 101804  
28598 101804  ; check function mask
28599 101804  ;   tests that the internal process is allowed to execute the current
28600 101804  ;     monitor call
28601 101804  ;
28602 101804  ; call: w1 = sender
28603 101804  ;       m8, <function bit>
28604 101804  ; error exits: result 1, if function bit is not in function mask.internal
28605 101804  
28605 101804  m8:                    ; check function mask:
28606 101804       jl. w3     n10.   ;    w0 := bit := next param;
28607 101806       bl  w3  x1+a22    ;    mask := function mask.sender;
28608 101808       so  w3    (0)     ;    if bit not contained in mask then
28609 101810       jl.        j1.    ;     goto result 1;
28610 101812       jl.        n0.    ;    next instruction;
28611 101814  
28611 101814  
28611 101814  
28611 101814  ; check privileges
28612 101814  ;
28613 101814  ;   checks that the sender is allowed to manipulate with the catalog-system
28614 101814  ;     on the current bs-device:
28615 101814  ;          1. the sender must be user of the device
28616 101814  ;
28617 101814  ; call: w2 = chain
28618 101814  ;       m9
28619 101814  ; error exits: result 4, if not user
28620 101814  
28620 101814  m9:                    ; check privs:
28621 101814       rl. w1     d2.    ;    w1 := sender;
28622 101816       rl  w2 (x2+f62)   ;    w2 := bs-process (= nametable.nametab addr.chain)
28623 101818       jl. w3     e59.   ; check user
28624 101820       jl.         j4.   ;+0 not user : result 4
28625 101822       jl.         n0.   ;+2 user : next instruction
28626 101824  
28626 101824  
28626 101824  
28626 101824  ; search best entry
28627 101824  ;
28628 101824  ; call: m10, <not found addr>
28629 101824  ; error exits: result 2, if catalog io-error
28630 101824  ;              result 6, if name format illegal
28631 101824  ;              goto-action 1,  if not found
28632 101824  
28632 101824  m10:                   ; search best entry:
28633 101824       jl. w3     e46.   ;    search best entry in catalog;
28634 101826       jl.        n5.    ;+2:   not found: goto
28635 101828       jl.        n1.    ;    skip
28636 101830  
28636 101830  
28636 101830  
28636 101830  ; search best entry and test modification allowed
28637 101830  ;
28638 101830  ;   the best catalog entry is found. if an areaprocess exists for that
28639 101830  ;     entry, it will be tested that no other process is user (or reserver)
28640 101830  ;     as specified in parameter
28641 101830  ;
28642 101830  ; call: m11, <no user/no reserver>
28643 101830  ;            (no user = f22, no reserver = f23)
28644 101830  ; error exits: result 2, if catalog io-error
28645 101830  ;              result 3, if not found
28646 101830  ;              result 4, if base.entry is outside maxbase.sender
28647 101830  ;              result 5, if modification not allowed
28648 101830  ;              result 6, if nameformat illegal
28649 101830  
28649 101830  m11:                   ; search best entry and test modif allowed:
28650 101830       jl. w3     e46.   ;    search best entry;
28651 101832       jl.        j3.    ;+2:   not found: goto result 3;
28652 101834  
28652 101834  ; w0w1 := base.entry
28653 101834       rl. w3     d2.    ;
28654 101836       dl  w3  x3+a44    ;    w2w3 := maxbase.sender;
28655 101838       sl  w0  x2        ;    if base.entry outside maxbase.sender then
28656 101840       sl  w1  x3+1      ;
28657 101842       jl.        j4.    ;      goto result 4;
28658 101844  
28658 101844       al  w0     0      ;    cur proc nametable addr := 0;
28659 101846       rs. w0     d11.   ;    (i.e. no areaprocess found)
28660 101848  
28660 101848       jl. w3     e43.   ;    for all area processes with same name do
28661 101850         b5              ;
28662 101852         b6              ;
28663 101854       jl.        n1.    ;+6:   no more: skip
28664 101856  
28664 101856  ; w0w1 = base.proc, w2 = nametable address of area process, w3 = continue
28665 101856       sn. w0    (v1.)   ;    if base.proc <> base.work then
28666 101858       se. w1    (v2.)   ;
28667 101860       jl      x3        ;      continue search;
28668 101862  
28668 101862  ; an area process is found with exact the same base as base.work
28669 101862       rs. w2     d11.   ;    cur proc nametable addr := nametable addr;
28670 101864       rl  w2  x2        ;
28671 101866       rl. w1     d2.    ;  w1:=intproc;
28672 101868       jl. w3     e64.   ; test users and reserver
28673 101870       al  w2  x3        ; save result
28674 101872       jl. w3     n10.   ;  w0:=2.100    test other users
28675 101874                         ;      2.1100   test other reservers;
28676 101874       so  w2    (0)     ;  if no other users-reservers then
28677 101876       jl.        n0.    ;        next instruction;  (notice: param is skipped)
28678 101878  
28678 101878  ; the area process was protected by another internal process
28679 101878       jl.        j5.    ;    goto result 5;
28680 101880  
28680 101880  ; unlock(monitor)/enable interrupt
28681 101880  ;
28682 101880  m12:                   ;
28683 101880       jl. w3     e66.   ; 
28684 101882       jl.        n0.    ;
28685 101884  
28685 101884  
28685 101884  
28685 101884  ; test name format
28686 101884  ;
28687 101884  ;   the format of name.work is tested
28688 101884  ;
28689 101884  ; call: m13
28690 101884  ; error exits: result 6, if name format illegal
28691 101884  
28691 101884  m13:                   ; test name format:
28692 101884       jl.        e24.   ;    goto test name format;
28693 101886  e24 = k-2              ; stepping stone
28694 101886  
28694 101886  
28694 101886  
28694 101886  ; compute namekey
28695 101886  ;
28696 101886  ;   namekey.work is computed and set, according to name.work
28697 101886  ;
28698 101886  ; call: m14
28699 101886  
28699 101886  m14:                   ; compute namekey:
28700 101886       jl.        e3.    ;    compute namekey and return;
28701 101888       jl. e1.,  e1 = k-2
28702 101890  
28702 101890  
28702 101890  
28702 101890  ; test new system name (maybe wrk-name)
28703 101890  ;
28704 101890  ;   the chaintables and the whole nametable and the current catalog
28705 101890  ;     are scanned in order to check, that (base.work,name.work) does
28706 101890  ;     not coincide with the already existing names.
28707 101890  ;
28708 101890  ;   (the reason for searching the chaintables too is, that a name,
28709 101890  ;     once reserved as a document-name, is protected against misuse
28710 101890  ;     in case of intervention on a disc (in which case the process-name
28711 101890  ;     is cleared). the name may only be reused by exactly the same
28712 101890  ;     process or it may be released by means of ..delete bs.. etc.
28713 101890  ;   this means that procfunc does not have to check with the catalog
28714 101890  ;     when ..create peripheral process.. is used to restore the name
28715 101890  ;       of the disc-process )
28716 101890  ;
28717 101890  ;   if name(0).work = 0 then a wrk-name is generated, which is
28718 101890  ;     completely unique (i.e. independant of base), and the wrk-name
28719 101890  ;     is moved to name.work.
28720 101890  ;
28721 101890  ; call: m15, <overlap addr>, <exact addr>
28722 101890  ; error exits: result 2, if catalog io-error
28723 101890  ;              result 6, if nameformat illegal
28724 101890  ;              goto-action 1, if overlap
28725 101890  ;              goto-action 2, if exact (base, name) exists
28726 101890  
28726 101890  ; generate wrk-name
28727 101890  ;
28728 101890  ;   a wrk-name is generated, which is completely unique (i.e.
28729 101890  ;     independant of base),
28730 101890  ;     and the wrk-name is moved to name.work
28731 101890  ;
28732 101890  ; call: m16, <irrell>, <irrell>
28733 101890  ; error exits: result 2, if catalog error
28734 101890  
28734 101890  ; test new system name (wrk-name not allowed)
28735 101890  ;
28736 101890  ;   function as ..test new system name, wrkname allowed.. except that
28737 101890  ;     wrk-name is not allowed
28738 101890  ;
28739 101890  ; call: m17, <overlap addr>, <exact addr>
28740 101890  ; error exits: as test new system name
28741 101890  
28741 101890  b. g30 w.
28742 101890  
28742 101890  m15:                   ; test new system name, wrk-name allowed:
28743 101890       rl. w0     v5.    ;    create wrkname := name(0).work = 0;
28744 101892       sn  w0     0      ;
28745 101894  m16:                   ; generate wrk-name:
28746 101894       am        -1      ;    create wrkname := true;
28747 101896  m17:                   ; test new system name , wrk-name not allowed:
28748 101896       al  w0     0      ;    create wrkname := false;
28749 101898       rs. w0     d17.   ;
28750 101900  ; d17 =  0 : create wrkname == false
28751 101900  ; d17 = -1 : create wrkname == true
28752 101900  
28752 101900       se  w0    -1      ;    if not create wrk-name then
28753 101902       am         e24-e23;      test name format
28754 101904                         ;    else
28755 101904  g0:                    ; next wrk-name:
28756 101904       jl. w3     e23.   ;      create next wrkname;
28757 101906                         ;      (i.e. maybe generate the next wrk-name)
28758 101906  
28758 101906       jl. w3     e45.   ;    find chain (name.work);
28759 101908         v5              ;
28760 101910       jl.        g1.    ;+4:  not found:  goto test in nametable;
28761 101912                         ;+6:  found:
28762 101912       dl  w1     b45    ;    base := catalog interval;
28763 101914       jl. w3     g20.   ;    test overlap;
28764 101916  
28764 101916  g1:                    ; test in nametable:
28765 101916       jl. w3     e43.   ;    for all procs in nametable do
28766 101918         b3              ;
28767 101920         b7              ;
28768 101922       jl.        g8.    ;+6:   no more: goto test main catalog;
28769 101924       jl.        g20.   ;    goto test overlap and continue;
28770 101926  
28770 101926  g8:                    ; test main catalog:
28771 101926       rl  w0     b25    ;
28772 101928       se  w0     0      ;    if main catalog exists then
28773 101930       jl.        g10.   ;      goto test in current catalog;
28774 101932       jl.        n2.    ;    skip 2;
28775 101934  
28775 101934  
28775 101934  
28775 101934  ; test new catalog name
28776 101934  ;
28777 101934  ;   the current catalog is scanned in order to test that
28778 101934  ;     (base.work, name.work) do not coincide with any entries
28779 101934  ;
28780 101934  ; call: m18, <overlap addr>, <exact addr>
28781 101934  ; error exits: as ..test new system name..
28782 101934  ; notice:    cur entry position is defined at <exact> return
28783 101934  
28783 101934  m18:                   ; test new catalog name:
28784 101934       jl. w3     e24.   ;    test format;
28785 101936       al  w0     0      ;    create wrkname := false;
28786 101938       rs. w0     d17.   ;
28787 101940  g10:                   ; test in current catalog:
28788 101940       jl. w3     e42.   ;    for all named entries in catalog do
28789 101942       jl.        n2.    ;+2:   no more: skip 2 (notice params not skipped yet)
28790 101944  
28790 101944  ; subprocedure test overlap
28791 101944  ;   if wrkname generated then goto test in nametable
28792 101944  ;   if overlap then goto first param addr
28793 101944  ;   if base = base.work then goto second param addr
28794 101944  ;
28795 101944  ; entry: w0w1 = base.entry(or proc), (maybe w2 = entry), w3 = link
28796 101944  ; exit:  all regs unchanged
28797 101944  
28797 101944  g20:                   ; test overlap:
28798 101944       sz. w3    (d17.)  ;    if create wrkname then
28799 101946       jl.        g0.    ;      goto next wrk-name;
28800 101948  
28800 101948       sh. w0    (v1.)   ;    if lower base > lower.work then
28801 101950       jl.        g21.   ;      begin
28802 101952       sh. w0    (v2.)   ;      if lower base > upper.work
28803 101954       sh. w1    (v2.)   ;      or upper base <= upper.work then
28804 101956       jl      x3        ;        return;  i.e. inside base.work or above
28805 101958       jl.        n5.    ;      goto overlap-addr; i.e embraces upper.work
28806 101960  g21:                   ;      end;
28807 101960       sl. w1    (v2.)   ;    if upper base < upper.work then
28808 101962       jl.        g22.   ;      begin
28809 101964       sl. w1    (v1.)   ;      if upper base < lower.work
28810 101966       sl. w0    (v1.)   ;      or lower base >= lower.work then
28811 101968       jl      x3        ;        return;  i.e. inside base.work or below
28812 101970       jl.        n5.    ;      goto overlap-addr; i.e. embraces lower.work
28813 101972  g22:                   ;      end;
28814 101972       sn. w0    (v1.)   ;    if base <> base.work then
28815 101974       se. w1    (v2.)   ;
28816 101976       jl      x3        ;      return;  i.e. contains base.work
28817 101978       jl. w3     e48.   ;    save position;
28818 101980       jl.        n6.    ;    goto exact-addr;
28819 101982  
28819 101982  d17: 0                 ; create wrk-name:  0 == false, all ones == true
28820 101984  
28820 101984  e.                     ;
28821 101984  
28821 101984  
28821 101984  ; test chain error
28822 101984  ;
28823 101984  ;   tests that the previous call of ..copy chain.. did not
28824 101984  ;     give any overlap-errors etc
28825 101984  ;
28826 101984  ; call: m19
28827 101984  ; error exits: result 5, if any errors
28828 101984  
28828 101984  b. g20, h10 w.
28829 101984  
28829 101984  m19:                   ; test chain error:
28830 101984       rl. w0     h3.    ;
28831 101986       sn  w0     0      ;    if any errors = 0 then
28832 101988       jl.        n0.    ;      next instruction;
28833 101990       jl.        j5.    ;    goto result 5;
28834 101992  
28834 101992  
28834 101992  
28834 101992  ; copy chaintable chain
28835 101992  ;
28836 101992  ; call: m20
28837 101992  ; error exits: result 5, if chain is too short
28838 101992  ; return: w2 = slices
28839 101992  
28839 101992  m20:                   ; copy chaintable chain:
28840 101992       bz. w1     v26.   ;    w1 := last slice number;
28841 101994       al  w1  x1+f0+1+511;   bytes := last slice + 1 + size of chainhead + round
28842 101996       ls  w1    -9      ;    w1 := number of segments used for chaintable;
28843 101998  
28843 101998       al. w3      d6.   ;    w3 := addr of first slice information;
28844 102000  
28844 102000       jl. w2     g10.   ;    copy chain(w1, w3);
28845 102002       jl.        n0.    ;+2:   chain ok:        next instruction
28846 102004       jl.        n0.    ;+4:   chain too long:  next instruction
28847 102006       jl.        j5.    ;+6:   chain too short: result 5
28848 102008  
28848 102008  
28848 102008  
28848 102008  ; copy chain and cut down
28849 102008  ;
28850 102008  ; call: m21
28851 102008  ; return: w2 = slices
28852 102008  
28852 102008  m21:                   ; copy chain and cut down:
28853 102008       rl. w1     v7.    ;    w1 := size.work;
28854 102010       al. w3     v4.    ;    w3 := addr of first slice information;
28855 102012  
28855 102012       jl. w2     g10.   ;    copy chain;
28856 102014       jl.        n0.    ;+2:   chain ok:        next instruction
28857 102016       jl.        n0.    ;+4:   chain too long:  next instruction
28858 102018                         ;+6:   chain too short:
28859 102018  
28859 102018  ; w0 = 0
28860 102018  ; w1 = remaining number of slices without chains
28861 102018  ; w2 = irrellevant
28862 102018  ; w3 = irrellevant
28863 102018  
28863 102018       rl. w3     d4.    ;    w3 := curdoc;
28864 102020       wm  w1  x3+f64    ;    segments := - slices * slicelength
28865 102022       ac  w1  x1        ;
28866 102024       wa. w1     v7.    ;                + size.work;
28867 102026       wd  w1  x3+f64    ;    slices := segments / slicelength (rounded);
28868 102028       se  w0     0      ;
28869 102030       al  w1  x1+1      ;
28870 102032       al  w2  x1        ;    w2 := slices;
28871 102034       wm  w1  x3+f64    ;
28872 102036       rs. w1     v7.    ;    size.work := slices * slicelength;
28873 102038  
28873 102038       jl.        n0.    ;    next instruction;
28874 102040  
28874 102040  
28874 102040  
28874 102040  ; subprocedure copy chain
28875 102040  ;
28876 102040  ;   copies a chain from senders area into the curdoc chaintable.
28877 102040  ;   all the new chain-elements in curdoc chaintable must be in
28878 102040  ;     state = free.
28879 102040  ;   the chain is copied until:
28880 102040  ;         1. a chain addresses outside the chaintable
28881 102040  ;     or  2. the areasize is reached
28882 102040  ;     or  3. the chain is terminated
28883 102040  ;     whichever occurs first.
28884 102040  ;   all new chain-elements are counted (unless already used).
28885 102040  ;   in case of chain overlap the copying will proceed, but will not
28886 102040  ;     destroy the chains already copied.
28887 102040  ;
28888 102040  ;   if the areasize is negative, it is a filedecriptor. in this case
28889 102040  ;     no chain is copied (of course), but first slice.work is set to
28890 102040  ;     doc-ident.
28891 102040  ;
28892 102040  ; call:  w1 = areasize, w2 = link, w3 = addr of first slice information
28893 102040  ; return: link+0: chain matches areasize :  w2 = slices
28894 102040  ;         link+2: chain too long         :  w2 = slices used
28895 102040  ;         link+4: chain too short        :  w0 = 0, w1 = slices not used
28896 102040  
28896 102040  g10:                   ; copy chain:
28897 102040       rs. w2     h0.    ;    save(return);
28898 102042  
28898 102042       al  w0     0      ;   (w0 := 0;)
28899 102044       rs. w0     h3.    ;    any errors := false;
28900 102046  
28900 102046       sl  w1     1      ;    if areasize > 0 then
28901 102048       jl.        g12.   ;      goto area;
28902 102050  
28902 102050  ; the areasize is either zero or negative, prepare first slice := 0
28903 102050       al  w2     0      ;    first slice := 0;
28904 102052       hs  w2  x3        ;   (w2 = number of slices := 0;)
28905 102054       sn  w1     0      ;    if areasize = 0 then
28906 102056       jl.       (h0.)   ;      next instruction;
28907 102058       jl.        m91.   ;    goto compute docnumber;
28908 102060  
28908 102060  g12:                   ; area:
28909 102060       jl. w2     e62.   ;    w2 := abs addr (w3.sender);
28910 102062       rs. w2     h1.    ;    sender chain := abs addr of save w3.sender
28911 102064  
28911 102064       rl. w2     d4.    ;    w2 := curdoc;
28912 102066  ; w0 = 0
28913 102066       wd  w1  x2+f64    ;
28914 102068       se  w0     0      ;    w1 := slices to use := areasize / slicelength;
28915 102070                         ;          (rounded)
28916 102070       al  w1  x1+1      ;
28917 102072       rs. w1     h2.    ;
28918 102074  
28918 102074       bz  w2  x2+f66    ;    w2 := last slicenumber of chaintable;
28919 102076       bz  w3  x3        ;    w3 := first slice number;
28920 102078  
28920 102078  g13:                   ; next slice:
28921 102078  ; w1 = remaining slices to copy
28922 102078  ; w2 = last slicenumber of slicetable
28923 102078  ; w3 = current slicenumber
28924 102078       sl  w3     0      ;    if slicenumber outside
28925 102080       sl  w3  x2+1      ;      chaintable then
28926 102082       jl.        g16.   ;        goto chain outside limits;
28927 102084  
28927 102084       am.       (d4.)   ;    if corresponding slice in chaintable
28928 102086       bl  w0  x3        ;      is not free then
28929 102088       sn  w0    -2048   ;
28930 102090       jl.        g14.   ;      begin
28931 102092       rs. w2     h3.    ;      any errors := true;
28932 102094       am.       (h1.)   ;      w0 := slicelink;
28933 102096       bl  w0  x3+f0     ;
28934 102098       jl.        g15.   ;      end
28935 102100  g14:                   ;    else
28936 102100       am.       (h1.)   ;
28937 102102       bl  w0  x3+f0     ;      move chain element from user area
28938 102104       am.       (d4.)   ;      to curdoc chain;
28939 102106       hs  w0  x3        ;
28940 102108  g15:                   ;
28941 102108       wa  w3     0      ;    slicenumber := next(slicenumber);
28942 102110       al  w1  x1-1      ;    decrease(remaining slices);
28943 102112       sn  w1     0      ;    if remaining slices = 0 then
28944 102114       jl.        g17.   ;      goto chain ok or too long;
28945 102116       se  w0     0      ;    if not end of chain then
28946 102118       jl.        g13.   ;      goto next slice;
28947 102120  ; the chain was too short
28948 102120       am.       (h0.)   ;
28949 102122       jl        +4      ;    return short-exit;  (independant of errors)
28950 102124  
28950 102124  g16:                   ; chain outside limits:
28951 102124       rs. w3     h3.    ;    any errors := true;
28952 102126       al  w1     0      ;
28953 102128  
28953 102128  g17:                   ; chain ok or too long:
28954 102128  ; w0 = contents of last slice
28955 102128  ; w1 = 0
28956 102128  ; w2 = irrellevant
28957 102128  ; w3 = next slicenumber 
28958 102128       rl. w2     h2.    ;    w2 := slices used;
28959 102130       se  w0     0      ;    if end of chain
28960 102132       se. w1    (h3.)   ;    or any errors then
28961 102134       jl.       (h0.)   ;      then return ok;
28962 102136  
28962 102136       ws  w3     0      ;    w3 := last slicenumber;
28963 102138       am.       (d4.)   ;
28964 102140       hs  w1  x3        ;    slicelink(last slicenumber).curdoc := end of chain
28965 102142       am.       (h0.)   ;
28966 102144       jl        +2      ;    return chain too long;
28967 102146  
28967 102146  h0:  0                 ; saved return
28968 102148  h1:  0                 ; saved chainhead address in sender area
28969 102150  h2:  0                 ; slices used
28970 102152  h3:  0                 ; any errors ( 0 == false, else true )
28971 102154  
28971 102154  e.                     ;
28972 102154  
28972 102154  
28972 102154  
28972 102154  ; compute slices to claim
28973 102154  ;
28974 102154  ;   the current slice-chain of entry.work is scanned, thus counting the
28975 102154  ;     number of slices it used to occupy.
28976 102154  ;   this number is compared to the new size.work:
28977 102154  ;
28978 102154  ;           if new number of slices < counted number then
28979 102154  ;               save address of last slicelink to use
28980 102154  ;
28981 102154  ;           if new number of slices > counted number then
28982 102154  ;               save address of last used slicelink
28983 102154  ;
28984 102154  ; call: m22, <compute new slices>
28985 102154  ; return:  w2 = slices
28986 102154  ;          variables are defined for later call of: adjust chain
28987 102154  
28987 102154  b. g20, h10 w.
28988 102154  
28988 102154  m22:                   ; compute slices to claim:
28989 102154       jl. w3     n10.   ;    w0 := next param;
28990 102156  
28990 102156       rl. w2     v7.    ;
28991 102158       sh  w2    -1      ;    if size.work < 0 then
28992 102160       jl.        g4.    ;      goto non-area;
28993 102162  
28993 102162       so  w0     2.10   ;    if not compute new slices then
28994 102164       al  w2     0      ;      size := 0;
28995 102166  
28995 102166       rl. w3     d4.    ;    w3 := curdoc;
28996 102168       al  w1     0      ;
28997 102170       wd  w2  x3+f64    ;    w2 := slices to use :=
28998 102172       se  w1     0      ;          size / slicelength (rounded);
28999 102174       al  w2  x2+1      ;
29000 102176  
29000 102176       al. w0     v4.    ;    (prepare new area or no slices)
29001 102178       bz. w1     v4.    ;    w1 := first slice.work;
29002 102180       wa  w1  6         ;    w1 := abs addr of first slice;
29003 102182       rs. w1     h4.    ;    minslice := first slice;
29004 102184       sn  w1  x3        ;    if old size = 0 then
29005 102186       jl.        g2.    ;      goto after count;
29006 102188  ; notice: an area may not start in slice 0
29007 102188  
29007 102188  
29007 102188  g1:                    ; count next:
29008 102188  ; w0 = abs addr of last slice link (either first slice.work  or  curr slice)
29009 102188  ; w1 = abs addr of next slice link
29010 102188  ; w2 = slices to use
29011 102188       al  w2  x2-1      ;    decrease(remaining slices to use);
29012 102190       sn  w2    -1      ;    if area must be cut down then
29013 102192       ds. w1     h1.    ;      save(curr slice addr, next slice addr);
29014 102194  
29014 102194       al  w0  x1        ;    curr slice := next slice;
29015 102196       ba  w1  x1        ;    next slice := next(next slice);
29016 102198  
29016 102198       sh. w1    (h4.)   ;    if next slice <= minslice then
29017 102200       rs. w1     h4.    ;      minslice := next slice;
29018 102202  
29018 102202       se  w0  x1        ;    if current slice is not the last one then
29019 102204       jl.        g1.    ;      goto count next;
29020 102206  
29020 102206  g2:                    ; after count:
29021 102206  
29021 102206  ; w0 = abs addr of current slice
29022 102206  ; w1 = abs addr of next slice  (if area exhausted then curr=next)
29023 102206  ; w2 = slice change
29024 102206  
29024 102206       rs. w2     h2.    ;    save(slice change);
29025 102208       sl  w2     0      ;    if new size = old size  or  area must be extended
29026 102210       ds. w1     h1.    ;      then save(current slice, next slice);
29027 102212  
29027 102212       jl.        n0.    ;    next instruction;
29028 102214  
29028 102214  g4:                    ; non-area:
29029 102214       al  w2     0      ;    slice change := 0;
29030 102216       jl.        g2.    ;    goto after count;
29031 102218  
29031 102218  h0:  0                 ; abs addr of current slice
29032 102220  h1:  0                 ; abs addr of next slice
29033 102222  h2:  0                 ; slice change
29034 102224  h3:  0                 ; abs address of last slice in chaintable
29035 102226  h4:  0                 ; abs addr of min slice
29036 102228  
29036 102228  m.
29036 102228               procfunc variables

29037 102228  ; common variables:
29038 102228  d16: 0, r.8           ; answer area
29039 102244  c. 4 * (:a110+1:)+d16.-1;   and
29040 102244       0, r. 2*(:a110+1:)+d16.>1;  claim change array  (set bs claims)
29041 102244  z.                    ;
29042 102244  d4:  0                ; curdoc:  address of current document (chaintable)
29043 102246  d5:  d9               ; maincat pseudochain
29044 102248  d6:  0                ; first slice of chaintable chain.(must always be zero)
29045 102250   ; description of current entry
29046 102250  d29:      0           ; -2 curr entry segment number
29047 102252  d3:       0           ;    curr entry address in catalog
29048 102254  d28:      0           ;  segment no.entry.work
29049 102256  
29049 102256  
29049 102256  ; record work:
29050 102256  ; (format as a catalog entry)
29051 102256  
29051 102256  d1:   0,r.f0>1        ; work
29052 102290  d30:  0, r.4          ; stat area.work
29053 102298  
29053 102298  
29053 102298  ;                       format of chainhead     format of catalog entry
29054 102298  
29054 102298  v1 = d1 + f1          ; lower base of catalog    lower base of entry
29055 102298  v2 = d1 + f2          ; upper base of catalog    upper base of entry
29056 102298  v3 = d1 + f3          ; chainkink*8 + permkey    namekey*8 + permkey
29057 102298  v4 = d1 + f4          ; first slice of auxcat    first slice
29058 102298  v5 = d1 + f5          ; name of auxcat           entry name
29059 102298  v6 = d1 + f6          ;                          start of tail
29060 102298  v7 = d1 + f7          ; size of auxcat           size of entry
29061 102298                        ;                      nonarea-    area- entry
29062 102298  
29062 102298  v11= d1 + f11         ; document name          name      last changed
29063 102298  v12= d1 + f12         ; name table addr of               write access counter
29064 102298                        ; auxcat area process              
29065 102298  v8 = d1 + f13         ;                                  read access counter
29066 102298  v13= d1 + f5 + 2      ;                                  last used
29067 102298  v14= d1 + f5 + 6      ;
29068 102298  v15= d1 + f5 + 7      ;
29069 102298  v26= d1 + f66 +  f0   ; last slice in chaintable
29070 102298  v27= d1 + f67 +  f0   ; no of keys    
29071 102298  v30= d1 + f11 +  2    ;
29072 102298  v31= d1 + f11 +  6    ;
29073 102298  v32= d1 + f12 +  2    ;
29074 102298  
29074 102298  
29074 102298  ; stepping stones
29075 102298       jl. e5.,  e5 = k-2
29076 102300  
29076 102300  d2:  0                 ; sender:  process description address of sender
29077 102302  d11: 0                 ; cur proc name table address
29078 102304  d13=k-a402             ; relative start of user bit array
29079 102304                         ; (simulates the format of an external process)
29080 102304       0,r.a401          ; children bits
29081 102306  d14: 0                 ; address of a process description
29082 102308  d15: 0                 ; end chain
29083 102310  d21: 0                 ; delta: stopcount - number of children
29084 102312  
29084 102312  
29084 102312  ; stepping stones
29085 102312       jl. e7.,  e7 = k-2
29086 102314       jl. e8.,  e8 = k-2
29087 102316       jl. e9.,  e9 = k-2
29088 102318       jl. e10., e10=k-2
29089 102320       jl. e12., e12= k-2
29090 102322       jl. e50., e50= k-2
29091 102324       jl. e40., e40= k-2
29092 102326       jl. e67., e67= k-2
29093 102328       jl. j6. , j6= k-2
29094 102330  jl.    j4. ,  j4 = k-2
29095 102332  
29095 102332  
29095 102332  
29095 102332  
29095 102332  
29095 102332  ; adjust chain to size
29096 102332  ;
29097 102332  ;   the chain of entry.work is extended or cut down, as
29098 102332  ;     decided by the previous function
29099 102332  ;
29100 102332  ;   if the area must be extended, it will preferably be extended
29101 102332  ;     with slices adjacent to the last slice, otherwise preferably
29102 102332  ;     as a contiguous area.
29103 102332  ;
29104 102332  ; call: (m22 must have been called prior to this function)
29105 102332  ;       m23
29106 102332  
29106 102332  m23:                   ; adjust chain:
29107 102332       rl. w3     d4.    ;    w3 := curdoc;
29108 102334       bz  w0  x3+f66    ;    last slice := last slice number.curdoc;
29109 102336       wa  w0     6      ;    abs last slice addr := last slice + curdoc;
29110 102338       rs. w0     h3.    ;
29111 102340  
29111 102340       dl. w2     h2.    ;    w1 := abs addr of next slice;
29112 102342                         ;    w2 := remaining := slice change;
29113 102342       sn  w2     0      ;    if slice change = 0 then
29114 102344       jl.        n0.    ;      next instruction;
29115 102346  
29115 102346  g5:                    ; next portion:
29116 102346       sl  w2     1      ;    if remaining >= 1 then
29117 102348       jl.        g8.    ;      goto extend area;
29118 102350  
29118 102350  ; chain is now ok or too long
29119 102350  ; w1 = abs addr of next slice, i.e. first slice to release
29120 102350  ; w2 = remaining
29121 102350  ; h0 = abs addr of last slice link, i.e. end of chain
29122 102350  
29122 102350       sn  w2     0      ;    if remaining = 0 then
29123 102352       jl.        g7.    ;      goto set end of chain;
29124 102354  
29124 102354  ; the old chain was longer than is has to be now, so release the
29125 102354  ;   superflouos chain-elements
29126 102354       al  w0    -2048   ;    w0 := free element;
29127 102356  g6:  al  w3  x1        ;
29128 102358       ba  w1  x1        ;    release rest of chain
29129 102360       hs  w0  x3        ;
29130 102362       se  w1  x3        ;      until end of chain;
29131 102364       jl.        g6.    ;
29132 102366  
29132 102366  g7:                    ; set end of chain:
29133 102366       al  w0     0      ;
29134 102368       hs. w0    (h0.)   ;    last link := end of chain;
29135 102370       jl.        n0.    ;    next instruction;
29136 102372  
29136 102372  g8:                    ; extend area:
29137 102372  
29137 102372  ; the area was too short
29138 102372  ;   try to extend the area with adjacent slices
29139 102372  ; w1 = abs addr of last used slice
29140 102372  ; w2 = remaining
29141 102372  
29141 102372       sn. w1    (d4.)   ;    if old size = 0 then
29142 102374       jl.        g9.    ;      goto new area;
29143 102376  
29143 102376       sn. w1    (h3.)   ;    if abs addr of last used slice =
29144 102378       jl.        g15.   ;      addr of last slice in chaintable then
29145 102380                         ;      goto get a slice;
29146 102380       bl  w0  x1+1      ;
29147 102382       se  w0    -2048   ;    if adjacent slice is occupied then
29148 102384       jl.        g15.   ;      goto get a slice;
29149 102386  
29149 102386  ; the slice was free and may therefore be used for extending the area
29150 102386       al  w0     1      ;    slice link(last used slice) := 1;
29151 102388       hs  w0  x1        ;
29152 102390       al  w1  x1+1      ;    increase(addr of last used slice);
29153 102392  g17:                   ; occupy byte:
29154 102392  ; w1 = new slice
29155 102392  ; w2 = remaining
29156 102392       al  w0     0      ;
29157 102394       hs  w0  x1        ;    slicechain (new slice) := 0; i.e. end of chain;
29158 102396       rs. w1     h4.    ;    min slice := new slice;
29159 102398       rs. w1     h0.    ;    addr of curr slice := addr of last used slice;
29160 102400       al  w2  x2-1      ;    decrease(remaining);
29161 102402       jl.        g5.    ;    goto next portion;
29162 102404  ; notice that end of chain will be set later
29163 102404  
29163 102404  
29163 102404  g9:                    ; new area:
29164 102404  ; try to find a contigouos hole that fits the remaining number
29165 102404  ;   of slices
29166 102404  
29166 102404       rl. w1     d4.    ;    slice := first slice of chaintable;
29167 102406  ; notice: the first slice of chaintable will never be allocated
29168 102406  
29168 102406  g10:                   ; get start of free area:
29169 102406       al  w2  x1+1      ;    w2 := free := next slice;
29170 102408       al  w3     0      ;    w3 := free size := 0;
29171 102410  g11:                   ; test next slice:
29172 102410       sl. w1    (h3.)   ;    if slice = last slice of chaintable then
29173 102412       jl.        g13.   ;      goto take first free;
29174 102414       al  w1  x1+1      ;    increase(slice);
29175 102416       bl  w0  x1        ;
29176 102418       se  w0    -2048   ;    if slice <> free then
29177 102420       jl.        g10.   ;      goto get start of free area;
29178 102422       al  w3  x3+1      ;    increase(free size);
29179 102424       se. w3    (h2.)   ;    if free size < remaining then
29180 102426       jl.        g11.   ;      goto test next slice;
29181 102428  
29181 102428  ; a hole of the sufficient size is found
29182 102428  
29182 102428  g12:                   ; connect slice to area:
29183 102428  ; w2 = abs addr of start of new slice
29184 102428  ; h0 = abs addr of last slice link  (maybe = first slice.work)
29185 102428  ; h1 = abs addr of previous slice   (maybe = chaintable start)
29186 102428       al  w1  x2        ;    curr slice := new slice;
29187 102430       ws. w2     h1.    ;    slicelink := addr of new slice - addr of previous;
29188 102432       hs. w2    (h0.)   ;    link(last slice) := slicelink;
29189 102434       rl. w2     h2.    ;    remaining := remaining - 1;
29190 102436       jl.        g17.   ;    goto occupy byte;
29191 102438  
29191 102438  g15:                   ; get a slice:
29192 102438  ; w1 = abs addr of last used slice
29193 102438  ; w2 = remaining
29194 102438  
29194 102438       ds. w2     h2.    ;    save (last used, remaining);
29195 102440  
29195 102440  ; it was not possible to get a contigouos area.
29196 102440  ; therefor just take the first free slice, and try once more
29197 102440  ; w1 = abs addr of last slice in chaintable
29198 102440  g13:                   ; take first free:
29199 102440       rl. w2     h4.    ;    free := minslice;
29200 102442  g14:                   ; test next:
29201 102442       sl. w2    (h3.)   ;    if free is the last slice of chaintable then
29202 102444       jl.        g16.   ;      goto test from first of chaintable;
29203 102446       al  w2  x2+1      ;    increase (free);
29204 102448       bl  w0  x2        ;
29205 102450       se  w0    -2048   ;    if slice(free) is not free then
29206 102452       jl.        g14.   ;      goto test next;
29207 102454       jl.        g12.   ;    goto connect slice to area;
29208 102456  
29208 102456  ; it was not possible to find a slice between minslice and
29209 102456  ;   last of chaintable.
29210 102456  ; now try between first and last of chaintable
29211 102456  g16:                   ; test from first of chaintable:
29212 102456       rl. w2     d4.    ;
29213 102458       rx. w2     h4.    ;    minslice := first of chaintable;
29214 102460       se. w2    (h4.)   ;    if not already tried from first of chaintable then
29215 102462       jl.        g13.   ;      goto take first free;
29216 102464  
29216 102464  ; it was not even possible to find a single slice in the chaintable
29217 102464       jl.        j7.    ;    alarm;
29218 102466  
29218 102466  
29218 102466  
29218 102466  ; if area extended then <function>
29219 102466  ;
29220 102466  ; call: (m23 must have been called prior to this function)
29221 102466  ;       m24, <instruction>
29222 102466  ; error return: skip action, if area was not extended
29223 102466  
29223 102466  m24:                   ; if area extended then:
29224 102466       rl. w0     h2.    ;    w0 := slice change;
29225 102468       sh  w0     0      ;    if slice change <= 0 then
29226 102470       jl.        n1.    ;      skip
29227 102472       jl.        n0.    ;    else next instruction;
29228 102474  
29228 102474  e.                     ;
29229 102474  
29229 102474  
29229 102474  ; stepping stones:
29230 102474  jl. e14. , e14 = k-2
29231 102476  jl. e15. , e15 = k-2
29232 102478  jl. e17.,  e17 = k-2
29233 102480  jl. e25. , e25 = k-2
29234 102482  jl. e31.,  e31 = k-2
29235 102484  jl. e32.,  e32 = k-2
29236 102486  jl. e33.,  e33 = k-2
29237 102488  
29237 102488  
29237 102488  
29237 102488  ; the functions m25-m30 all have a common
29238 102488  ;   call-sequence and error-return actions:
29239 102488  ;
29240 102488  ; call:  w2 = slices
29241 102488  ;        m<number>, <claims exceeded addr>
29242 102488  ; error return: goto-action 1, if claims exceeded
29243 102488  ; the functions m260 and m280 are used to adjust maincat entry claims in case 
29244 102488  ; of insert entry result 3.
29245 102488  ; they will set w2=slices=0.
29246 102488  
29246 102488  b. g20, h10 w.
29247 102488  
29247 102488  h0:  0                 ; entry-change
29248 102490  h1:  0                 ; slice-change
29249 102492  h2:  0                 ; maincat claim addr
29250 102494  h3:  0                 ; auxcat  claim addr
29251 102496  h4:  0, r.a109*2       ; pseudo main cat bs_claims
29252 102504  
29252 102504  m25:                   ; prepare bs:
29253 102504       al  w1     0      ;    entries := 0;
29254 102506       al  w0     a110   ;    newkey := max catalog key;
29255 102508       jl.        g0.    ;    goto init pseudo claims;
29256 102510  m260: al  w2      0    ; claim 1 aux entry. (slices already claimed) insert entry r es 3
29257 102512  
29257 102512  m26:                   ; create aux entry:
29258 102512       al  w1     1      ;    entries := 1;
29259 102514       al  w0    -f51-1  ;
29260 102516       la. w0     d1.+f3 ;    newkey := key.work;
29261 102518  
29261 102518  g0:                    ; init pseudo claims:
29262 102518       al  w3    -1      ;    oldkey := -1;
29263 102520       ds. w2     h1.    ;    save (entries, slices);
29264 102522       rs. w1    h4.     ; save entries
29265 102524        r. a109*2        ;
29266 102530       al. w1     h4.    ;    maincat claim addr := pseudo claim;
29267 102532       jl.        g3.    ;    goto get auxcat claim addr;
29268 102534  
29268 102534  m27:                   ; permanent entry:
29269 102534  ; w2 = negative number of slices to claim
29270 102534       ac  w2  x2        ;    w2 := number of slices to claim;
29271 102536       al  w1     1      ;    entries := 1;
29272 102538       rl. w3     d10.   ;    oldkey := saved old key;
29273 102540       al  w0    -f51-1  ;
29274 102542       la. w0     d1.+f3 ;    newkey := key.work;
29275 102544       sl  w0  x3        ;    if newkey >= oldkey then
29276 102546       jl.        g2.    ;      goto get maincat claim addr;
29277 102548  ; the rest of the algorithm supposes an ascending key-change.
29278 102548  ; in order to do this the entry- and slice-claims are negated
29279 102548       ac  w2  x2        ;    slices  := - slices;
29280 102550       ac  w1  x1        ;    entries := - entries
29281 102552       rx  w3     0      ;    exchange keys;
29282 102554       jl.        g2.    ;    goto get maincat claim addr;
29283 102556  m280: al  w2      0    ; unclaim 1 main and aux entry. aux entry will be reclaimed later
29284 102558  
29284 102558  m28:                   ; remove entry:
29285 102558  ; (as in permanent entry, the claims must be negated)
29286 102558  ; (w2 is already negative number of slices to claim)
29287 102558       am        -1-0    ;    entries := -1;
29288 102560  m29:                   ; change entry:
29289 102560       am         0-1    ;    entries := 0;
29290 102562  m30:                   ; create entry:
29291 102562       al  w1     1      ;    entries := 1;
29292 102564       al  w0    -f51-1  ;
29293 102566       la. w0     d1.+f3 ;    newkey := key.work;
29294 102568       al  w3    -1      ;    oldkey := -1;
29295 102570  
29295 102570  g2:                    ; get maincat claim addr:
29296 102570       ds. w2     h1.    ;    save (entries, slices);
29297 102572       rl  w1     b25    ;    w1 := maincat docaddr;
29298 102574       rl  w1  x1+f60    ;    w1 :=  rel claim addr.maindoc;
29299 102576       wa. w1     d2.    ;    w1 := abs addr of maincat claim in sender descr;
29300 102578  
29300 102578  g3:                    ; get auxcat claim addr:
29301 102578  ; w0 = newkey
29302 102578  ; w1 = maincat claim addr
29303 102578  ; w3 = oldkey   ( <= newkey )
29304 102578       rl. w2     d4.    ;
29305 102580       rl  w2  x2+f60    ;
29306 102582       wa. w2     d2.    ;    w2 := abs addr of auxcat claim in sender descr;
29307 102584  
29307 102584       ds. w2     h3.    ;    save (maincat claim addr, auxcat claim addr);
29308 102586  
29308 102586       ld  w0     1      ;    oldkey := oldkey * 2;
29309 102588       hs. w0     h5.    ;    newkey := newkey * 2;
29310 102590  
29310 102590       al  w2  x3        ;    current key := oldkey;
29311 102592       jl.        g11.   ;    goto test key;
29312 102594  
29312 102594  g10:                   ; next claim:
29313 102594  ; w2 = current key  :   even = test entry-claim
29314 102594  ;                       odd  = test slice-claim
29315 102594  ; w3 = second scan  :   oldkey      == false
29316 102594  ;                       max key + 1 == true
29317 102594  
29317 102594  ; the claims are scanned twice:
29318 102594  ;      first  time the claims are just tested for claims exceeded
29319 102594  ;      second time the claims are changed
29320 102594  
29320 102594       al  w1  x2        ;    claim addr := current key
29321 102596       ls  w1     1      ; half word addr changed to integer addr 
29322 102598       so  w2     2.1    ;      + if slice-claim
29323 102600       sl  w2     a109*2-2;       or current key >= minimum aux key then
29324 102602       am         h3-h2  ;          auxcat claim addr
29325 102604       wa. w1     h2.    ;        else maincat claim addr;
29326 102606       rl  w0     x1+4   ; w0:=current claim(claim addr);
29327 102608       sz  w2     2.1    ;    rest := current claim
29328 102610       am         h1-h0  ;          - if slice claim then slices
29329 102612       ws. w0     h0.    ;                           else entries;
29330 102614  
29330 102614       sh  w0    -1      ;    if rest < 0 then
29331 102616       jl.        n5.    ;      goto claims exceeded;
29332 102618  
29332 102618       sn  w3     a110*2+2;    if second scan then
29333 102620       rs  w0     x1+4   ; current claim(claim addr):=rest
29334 102622  
29334 102622       al  w2  x2+1      ;    increase(current key);
29335 102624  
29335 102624  g11:                   ; test key:
29336 102624  h5 = k+1
29337 102624       se  w2 ; newkey*2 ;    if current key <> newkey then
29338 102626       jl.        g10.   ;      goto next claim;
29339 102628  
29339 102628       al  w2  x3        ;    current key := oldkey;
29340 102630       al  w3     a110*2+2;    oldkey := second scan := true;
29341 102632       se  w2  x3        ;    if second pass not done yet then
29342 102634       jl.        g11.   ;      goto test key;
29343 102636  
29343 102636  ; all claims in the interval oldkey-newkey have been tested and
29344 102636  ;   changed, without having claims exceeded
29345 102636  
29345 102636       jl.        n1.    ;    skip
29346 102638  
29346 102638  e.                     ;
29347 102638  
29347 102638  
29347 102638  
29347 102638  ; prepare maincat entry
29348 102638  ;
29349 102638  ;   the permanens key.work is set to the minimum of key.entry and
29350 102638  ;     min aux cat key - 1.
29351 102638  ;   slices to claim is set to zero
29352 102638  ;
29353 102638  ; call: m33
29354 102638  ;       w2 will be loaded with missing parameter.
29355 102638  ;
29356 102638  ; call: w2 = entry address
29357 102638  ;       m31
29358 102638  ; exit: w2 = slices = 0
29359 102638  m33:                   ; get missing param and continue with m31
29360 102638       al. w2     d1.    ;
29361 102640  
29361 102640  m31:                   ; prepare maincat entry:
29362 102640       al  w0    -f51-1  ;
29363 102642       la  w0  x2+f3     ;    w0 := permkey.entry;
29364 102644       sl  w0     a109   ;    if permkey >= min aux key then
29365 102646       al  w0     a109-1 ;      permkey := min aux key - 1;
29366 102648       hs. w0     d1.+f3 ;    key.work := permkey;
29367 102650       al  w2     0      ;    w2 := slices to claim := 0;
29368 102652       jl.        n0.    ;    next instruction;
29369 102654  
29369 102654  
29369 102654  ; set bs claims
29370 102654  ;
29371 102654  ;   it is tested that the claims can be subtracted from
29372 102654  ;     the parent and added to the childs claims
29373 102654  ;   the claims are given to the child
29374 102654  ;
29375 102654  ;   notice:  the claims-change may be positive or negative
29376 102654  ;
29377 102654  ; call: m32
29378 102654  ; error return: result 1, if claims exceeded
29379 102654  ;               result 3, if process does not exist
29380 102654  ;               result 3, if process is not an internal process
29381 102654  ;               result 3, if process is not a child of calling process
29382 102654  
29382 102654  b. g10, h10 w.
29383 102654  
29383 102654  m32:                   ; set bs claims:
29384 102654       jl. w3     e17.   ;    first proc;
29385 102656       jl. w3     e75.   ;    move bs-params from sender to claim-array;
29386 102658       al. w2     d16.   ;    w2 := claim array;
29387 102660       rl. w3     d4.    ;    w3 := curdoc;
29388 102662  
29388 102662  g0:                    ; convert next key:
29389 102662       al  w0     0      ;
29390 102664       se  w3    (b25)   ;    if curdoc = maincat docaddr
29391 102666       sl. w2     d16.+a109*4;  or key >= min aux key then
29392 102668       rl  w0  x2        ;      keep (entrychange.key)
29393 102670       rs  w0  x2        ;    else entrychange.key := 0;
29394 102672  
29394 102672       rl  w0  x2+2      ;    w0w1 := signed segmentchange.key;
29395 102674       ad  w1    -24     ;
29396 102676       wd  w1  x3+f64    ;    slices := segments // slicelength.curdoc
29397 102678       sl  w0     1      ;
29398 102680       al  w1  x1+1      ;            + sign (remainder);
29399 102682       sh  w0    -1      ;
29400 102684       al  w1  x1-1      ;
29401 102686       rs  w1  x2+2      ;    save in claim-array;
29402 102688  
29402 102688       al  w2  x2+4      ;    increase key;
29403 102690       sh. w2     d16.+4*a110;   if not all keys converted then
29404 102692       jl.        g0.    ;      goto convert next key;
29405 102694  
29405 102694       rs. w2     d1.    ;    second pass := false;
29406 102696  
29406 102696  g5:                    ; next pass:
29407 102696       rl. w1     d2.    ;    w1 := sender;
29408 102698       rl. w2     d14.   ;    w2 := child;
29409 102700  
29409 102700       wa  w1  x3+f60    ;    w1 := claimaddr.sender (curdoc);
29410 102702       wa  w2  x3+f60    ;    w2 := claimaddr.child  (curdoc);
29411 102704  
29411 102704       al. w3     d16.   ;    w3 := start of claim-array;  ( = key 0 )
29412 102706  
29412 102706  g8:                    ; next key:
29413 102706  ; first test that the parent won't have claims exceeded
29414 102706       rl  w0  x1        ; remainder:= claim(key).sender
29415 102708       ws  w0  x3        ;               - claimchange(key);
29416 102710       sh  w0    -1      ;    if remainder < 0 then
29417 102712       jl.        j1.    ;      goto result 1;  (i.e. claims exceeded at sender)
29418 102714       sl. w3    (d1.)   ;    if second pass then
29419 102716       rs  w0  x1        ; claim(key).sender:= remainder
29420 102718  
29420 102718  ; parent claims was ok (till now)
29421 102718  ; test child claims
29422 102718       rl  w0  x2        ; newclaim:= claim(key).child
29423 102720       wa  w0  x3        ;              + claimchange(key);
29424 102722       sh  w0    -1      ;    if newclaim < 0 then
29425 102724       jl.        j1.    ;      goto result 1;  (i.e. claims excceded at child)
29426 102726       sl. w3    (d1.)   ;    if second pass then
29427 102728       rs  w0  x2        ; claim(key).child:=newclaim
29428 102730  
29428 102730  ; child-claims was also ok
29429 102730  ; try next key
29430 102730       al  w1  x1+2      ; increase (sender claimaddr);
29431 102732       al  w2  x2+2      ; increase (child claimaddr);
29432 102734  
29432 102734       al  w3  x3+2      ;    increase (key);
29433 102736  
29433 102736       sh. w3     d16.+4*a110+3;   if not all keys tested then
29434 102738       jl.        g8.    ;      goto next key;
29435 102740  
29435 102740  ; all keys have been tested (or updated)
29436 102740  
29436 102740       al. w3     d16.-2 ;
29437 102742       sn. w3    (d1.)   ;    if second pass then
29438 102744       jl.        j0.    ;      goto result ok;
29439 102746  
29439 102746       rs. w3     d1.    ;    second pass := true;
29440 102748       rl. w3     d4.    ;    w3 := curdoc;
29441 102750       jl.        g5.    ;    goto next pass;
29442 102752  
29442 102752  e.                     ;
29443 102752  
29443 102752  
29443 102752  ; if not bs-device then goto <not bs>
29444 102752  ;
29445 102752  ;   the kind of the process description of curproc is tested to
29446 102752  ;     find out whether or not it is a bs-device
29447 102752  ;
29448 102752  ; call: m34, <not bs addr>
29449 102752  ; error return: goto-action 1, if not bs-device;
29450 102752  
29450 102752  m34:                   ; check bs-device:
29451 102752       rl. w2    (d11.)  ;    proc := nametable (cur proc name table address);
29452 102754  
29452 102754       rl  w1  x2+a10    ;    w1 := kind.proc;
29453 102756  
29453 102756       se  w1     84     ;    if kind = rcnet subprocess then
29454 102758       sn  w1     85     ;
29455 102760       bz  w1  x2+a63    ;      kind := subkind.proc;
29456 102762  
29456 102762       se  w1     6      ;    if kind = drum
29457 102764       sn  w1     62     ;    or kind = disc then
29458 102766       jl.        n1.    ;      skip;
29459 102768  n1=k-2
29460 102768  
29460 102768       jl.        n5.    ;    goto <not bs>;
29461 102770  n5=k-2
29462 102770  
29462 102770  
29462 102770  ; search any chains (allowed state)
29463 102770  ;
29464 102770  ;   finds a document on which the sender has enough claims
29465 102770  ;     to create the entry described in entry.work
29466 102770  ;
29467 102770  ; call: m35, <allowed states>
29468 102770  ; error return: result 2, if document not found
29469 102770  ;               result 2, if state.document not allowed
29470 102770  ;               result 4, if no documents with enough claims
29471 102770  ;               result 6, if document nameformat illegal
29472 102770  ; return: curdoc is defined
29473 102770  
29473 102770  b. g10, h10 w.
29474 102770  
29474 102770  m35:                   ; search any chains:
29475 102770       rl. w0     d1.+f7 ;    w0 := size.work;
29476 102772       rl. w2     d1.+f11;    w2 := docname(0).work;
29477 102774  
29477 102774       sl  w0     0      ;    if size < 0
29478 102776       sz  w2    -2<1    ;    or docname(0) is neither 0 nor 1,2,3 then
29479 102778       jl.        m36.   ;      goto search chain;
29480 102780  
29480 102780       jl. w3     n10.   ;    w0 := allowed state := param;
29481 102782       hs. w0     h0.    ;
29482 102784  
29482 102784       rl  w1     b24    ;    w1:= end of chain table list
29483 102786       al  w0     0      ;
29484 102788       ds. w1     h4.    ;    max_doc:=end of list;
29485 102790       jl.        g2.    ;
29486 102792  g0:                    ; test chain state:
29487 102792       rl  w3  x1        ;    doc := name table(entry);
29488 102794       bl  w2  x3+f68    ;    w2 := state.doc;
29489 102796  h0 = k+1
29490 102796       al  w0 ; allowed state;
29491 102798       sh  w0 (x3+f61)   ;    if docname.doc = 0
29492 102800       so  w0  x2        ;    or state.doc not allowed then
29493 102802       jl.        g2.    ;      goto next chain;
29494 102804       rl  w2     b212   ;
29495 102806       rs. w2     h1.    ;    min_segm:=8388604;
29496 102808       al  w2     0      ;    for key:=0 step 1 until last_key do begin
29497 102810       rl  w3  x3+f60    ;
29498 102812       wa. w3     d2.    ;      w3:=claim_addr.doc.sender;
29499 102814       rs. w3     h2.    ;
29500 102816  g1:                    ; next_key:
29501 102816       al  w3  x2        ;
29502 102818       ls  w3     2      ;
29503 102820       wa. w3     h2.    ;      w3:=claim_addr.doc.sender.key
29504 102822       dl  w0  x3+2      ;      entry_count:=entries(key);
29505 102824                         ;      slice_count:=slice(key);
29506 102824       sh  w2     a109-1 ;      if key<min aux key then
29507 102826       al  w3     1      ;        entry_count:=1; <* no key check *>
29508 102828       sh  w3     0      ;      if entry_count<1 then
29509 102830       jl.        g2.    ;        goto next_chain;
29510 102832       rl  w3  x1        ;
29511 102834       wm  w0  x3+f64    ;      segment_count:=slice:=count*slice_length;
29512 102836       sl. w0     (d1.+f7);     if segment_count< wanted segment then
29513 102838       sz                ;
29514 102840       jl.        g2.    ;      goto next chain;
29515 102842       sh. w0     (h1.)  ;      if segment_count<min_segm then
29516 102844       rs. w0     h1.    ;      min_segm:=segment_count;
29517 102846       al  w2  x2+1      ;
29518 102848       sh. w2     (d1.+f11);    if not all key tested then
29519 102850       jl.        g1.    ;        goto next_key;
29520 102852       rl. w0     h1.    ;
29521 102854       sl. w0     (h3.)  ;      if min_segm.cur_doc > segment.max_doc then
29522 102856       ds. w1     h4.    ;        max_doc:=cur_doc;
29523 102858  g2:  al  w1  x1-2      ; next chain:
29524 102860       sl  w1     (b22)  ;      if below first chain then
29525 102862       jl.        g0.    ;        goto next_chain;
29526 102864                         ;    end;
29527 102864       rl. w1     h4.    ;    w1:=max_doc;
29528 102866       sn  w1     (b24)  ;    if no document found then
29529 102868       jl.        j4.    ;      goto result 4;(claims exceeded)
29530 102870                         ;    else
29531 102870       rl  w3  x1        ; document found:
29532 102872       rs. w3     d4.    ;    curdoc := doc;
29533 102874       al. w1     d1.+f11;
29534 102876       al  w2  x3+f61    ;    move docname.curdoc to docname.work;
29535 102878       jl. w3     e32.   ;
29536 102880       jl.        n0.    ;    next instruction;
29537 102882  h1:  0                 ;    min_segm
29538 102884  h2:  0                 ;    claim_addr.cur_doc
29539 102886  h3:  0                 ;    segm_count.max_doc;
29540 102888  h4:  0                 ;    max_doc;
29541 102890  e.                     ; end;
29542 102890  
29542 102890  
29542 102890  ; procedure search chain (allowed state)
29543 102890  ;
29544 102890  ; searches the chaintables for a document with docname = docname.work
29545 102890  ;
29546 102890  ; call: m36, <allowed states>
29547 102890  ; error return: result 2, if document not found
29548 102890  ;               result 2, if state.document not allowed
29549 102890  ;               result 6, if document nameformat illegal
29550 102890  ; return: curdoc is defined
29551 102890  
29551 102890  b. g10 w.
29552 102890  
29552 102890  m36:                   ; search chain:
29553 102890       rl. w0     d1.+f7 ;
29554 102892       sl  w0     0      ;    if size.work >= 0 then
29555 102894       jl.        g1.    ;      goto area;
29556 102896  
29556 102896       jl. w3     e15.   ;    compute document address;
29557 102898       jl.        g5.    ;    goto test state;
29558 102900  
29558 102900  g1:                    ; area:
29559 102900       jl. w3     e45.   ;    find chain (docname.work);
29560 102902         d1+f11          ;
29561 102904       jl.        g10.   ;+4:  not found:  goto test document name;
29562 102906                         ;+6:  found:
29563 102906  
29563 102906  g5:                    ; test state:
29564 102906       rs. w2     d4.    ;    curdoc := doc;
29565 102908       jl. w3     n10.   ;    w0 := allowed states := param;
29566 102910       bl  w1  x2+f68    ;    if state.curdoc is not allowed then
29567 102912       so  w0  x1        ;
29568 102914       jl.        j2.    ;      goto result 2;
29569 102916  
29569 102916       jl.        n0.    ;    next instruction;
29570 102918  
29570 102918  g10:                   ; test document name:
29571 102918       al. w1     d1.+f5 ;
29572 102920       al  w2  x1+f11-f5 ;    move docname.work to name.work;
29573 102922       jl. w3     e32.   ;
29574 102924       jl. w3     e24.   ;    test format;
29575 102926       jl.        j2.    ;    goto result 2;
29576 102928  j2 = k-2               ; (stepping stone)
29577 102928  
29577 102928  e.                     ;
29578 102928  
29578 102928  
29578 102928  
29578 102928  ; set chainstate
29579 102928  ;
29580 102928  ;   the state of curdoc chain is set
29581 102928  ;
29582 102928  ; call: m37, <new state>
29583 102928  
29583 102928  m37:                   ; set chainstate:
29584 102928       jl. w3     n10.   ;    w0 := new state := param;
29585 102930       rl. w2     d4.    ;    w2 := curdoc;
29586 102932       hs  w0  x2+f68    ;    state.curdoc := new state;
29587 102934       rl  w3 (x2+f62)   ;
29588 102936       al  w1     f90    ;    if new state = ready then
29589 102938       sn  w0     t3     ;        curdoc.disc.type :=
29590 102940       al  w1     f91    ;        logical_disc_with_catalog
29591 102942       se  w0     t3     ;    else if new state = during delete then
29592 102944       sn  w0     t4     ;        curdoc.disc.type :=
29593 102946       hs  w1  x3+a57    ;        logical_disc_without_catalog;
29594 102948       jl.        n0.    ;    next instruction;
29595 102950  
29595 102950  
29595 102950  
29595 102950  ; find empty chain and prepare
29596 102950  ;
29597 102950  ;   the kind is tested, whether it is a fast or slow device (drum/disc)
29598 102950  ;   the size of the chaintable is tested against the corresponding
29599 102950  ;     maximum size
29600 102950  ;   an empty chain is found, and all the chain-link are cleared
29601 102950  ;     (i.e. set to free)
29602 102950  ;   the chainhead is copied (except first word of docname)
29603 102950  ;   it is tested that the size of the catalog wont give too large
29604 102950  ;     entry-claim
29605 102950  ;   all claims on the device are given to the sender, while all other
29606 102950  ;     internal processes will have their claims cleared
29607 102950  ;
29608 102950  ;   (kind: 0: fast device (drum)
29609 102950  ;          1: slow device (disc)
29610 102950  ;          2: new fast device (drum used with mon. 9 and later versions)
29611 102950  ;          3: new slow device (disc used with mon. 9 and later versions)).
29612 102950  ;
29613 102950  ; call: m38
29614 102950  ; error return: result 5: illegal kind (neither fast not slow device)
29615 102950  ;               result 5: too many slices
29616 102950  ;               result 5: catalog too big, i.e. too many entries
29617 102950  ;               result 7: no chains idle
29618 102950  
29618 102950  b. g20, h10 w.
29619 102950  
29619 102950  m38:                   ; find empty chain and prepare:
29620 102950       bz. w2     d1.+f53+f0; w2 := chain kind.chainhead;
29621 102952       ls  w2    -3      ;
29622 102954       sl  w2     4      ;    if illegal kind then
29623 102956       jl.        j5.    ;      goto result 5;
29624 102958  j5=k-2
29625 102958       la. w2      h6.    ;     exclude new drum and disc bit
29626 102960  ; kind = 0 :  fast device, i.e. drum
29627 102960  ; kind = 1 :  slow device, i.e. disc
29628 102960  
29628 102960       ls  w2     1      ;
29629 102962       bz. w0     d1.+f66+f0; if last slice.chainhead
29630 102964       sl. w0 (x2+h0.)   ;      >= chainsize(kind) then
29631 102966       jl.        j5.    ;      goto result 5;
29632 102968  
29632 102968  ; find an empty chain of the specified kind
29633 102968  ; an empty chain is characterized by having first word of docname = 0
29634 102968       dl  w3  x2+b22+2  ;    w3 := top  entry;
29635 102970       al  w2  x2-2      ;    w2 := base entry;
29636 102972       al  w0     0      ;    (empty docname)
29637 102974  g0:                    ; next chain:
29638 102974       al  w2  x2+2      ;    increase(entry);
29639 102976       sn  w2  x3        ;    if all chains(kind) are tested
29640 102978       jl.        j7.    ;      goto result 7;  (i.e. no chains idle)
29641 102980  
29641 102980       rl  w1  x2        ;    doc := chain(entry);
29642 102982       se  w0 (x1+f61)   ;    if first word of docname.doc <> 0 then
29643 102984       jl.        g0.    ;      goto next chain;
29644 102986  
29644 102986  ; a chaintable was found: clear all chainlinks
29645 102986       rs. w1     d4.    ;    curdoc := doc;
29646 102988       bz. w2     d1.+f66+f0;
29647 102990       wa  w2     2      ;    w2 := abs addr of last slice of curdoc chaintable;
29648 102992       al  w0    -2048   ;    w0 := free slice;
29649 102994  g2:                    ; clear next slice:
29650 102994       hs  w0  x2        ;
29651 102996       al  w2  x2-1      ;    clear all slices in chain table
29652 102998       sl  w2  x1        ;      (notice: there is at least one slice)
29653 103000       jl.        g2.    ;
29654 103002  
29654 103002  ; w1 = curdoc
29655 103002       jl.        g5.    ;    goto init chainhead;
29656 103004  
29656 103004  h0:  a114 + f60        ; size of fast-chains (i.e. drums)
29657 103006       a116 + f60        ; size of slow-chains (i.e. discs)
29658 103008  
29658 103008  
29658 103008  
29658 103008  ; set maincat and prepare
29659 103008  ;
29660 103008  ;   maincat docaddr is set to curdoc
29661 103008  ;   the pseudo-chainhead for main catalog is initialized
29662 103008  ;   the size of main catalog is tested for too large entry-claim
29663 103008  ;   all maincat entry-claims are given to sender, while all other
29664 103008  ;     internal processes will have their maincat entry-claims cleared
29665 103008  ;
29666 103008  ; call: m39
29667 103008  ; error return: result 5: catalog size illegal (i.e. too many entries)
29668 103008  
29668 103008  m39:                   ; set maincat and prepare:
29669 103008       rl. w1     d4.    ;
29670 103010       rs  w1     b25    ;    maincat docaddr := curdoc;
29671 103012  
29671 103012       rl. w1     d5.    ;    w1 := pseudo chaintable;
29672 103014  
29672 103014  g5:                    ; init chainhead:
29673 103014       rl. w0      v7.   ;    if no of keys = 0 then (initial problem)
29674 103016       el. w2     v27.   ;    no of keys := size.catalog
29675 103018       sn  w2     0      ;
29676 103020       hs. w0     v27.   ;
29677 103022       el. w2     v27.   ;     test no of keys:
29678 103024       sh  w2     512    ;    if no of keys >= 512 or
29679 103026       sh  w2     0      ;    no of keys <= 0 then
29680 103028       jl.         j5.   ;    goto error result 5
29681 103030                         ;
29682 103030       zl. w2     v3.    ;    chainkind := new chainkind;
29683 103032       lo. w2     h5.    ;    (i.e. drum (0) := new drum (2)
29684 103034       hs. w2     v3.    ;          disc (1) := new disc (3)).
29685 103036  ; w1 = chaintable (or maincatalog pseudo chaintable)
29686 103036       rs. w1     h1.    ;    save(chaintable addr);
29687 103038       al  w1  x1-f0     ;
29688 103040       al. w2     d1.    ;    move chainhead from work to chaintable;
29689 103042       jl. w3     e33.   ;
29690 103044  
29690 103044       rl. w1     h1.    ;    (docname.chain must stay cleared until
29691 103046       al  w0     0      ;    all checking is ended, because this is the
29692 103048       se. w1    (d5.)   ;
29693 103050       rs  w0  x1+f61    ;    way to characterize an empty chain)
29694 103052  
29694 103052       rs  w0  x1+f70    ;    catalog name table addr := 0;
29695 103054  
29695 103054  ; compute number of entries in the catalog and compare this to
29696 103054  ;   the maximum possible claim
29697 103054       al  w0     f10    ;
29698 103056       wm  w0  x1+f57    ;    if number of entries.catalog
29699 103058  
29699 103058       bz  w3  x1+f66    ;    slices := last slice number + 1;
29700 103060       al  w1  x3+1      ;
29701 103062  
29701 103062  g8:                    ; prepare claims:
29702 103062  ; w0 = max claims
29703 103062  ; w3=max entry claims
29704 103062  ; w0=max slice claims
29705 103062       ds. w1     h3.    ;
29706 103064  
29706 103064  ; initialize claims for all internal processes:
29707 103064  
29707 103064       rl  w2     b6     ;    w2 := first internal in nametable;
29708 103066                         ;      (there is at least one, namely sender itself)
29709 103066       jl.        g13.   ; test more internals
29710 103068  g10:
29711 103068       rl  w2  x2        ;   proc:=nametable(entry)
29712 103070       ld  w0     -100   ;   clear w3-w0
29713 103072       sn. w2    (d2.)   ;   claim:= if
29714 103074       dl. w0     h3.    ;      proc= sender then maxclaim else 0
29715 103076       rl. w1     d4.    ; w1 := curdoc
29716 103078       wa  w2  x1+f60    ; claim addr:=proc +claimrel.curdoc
29717 103080       se. w1    (h1.)   ;    if chain <> curdoc then
29718 103082       jl.        g15.   ;      goto init maincat entry-claim;
29719 103084       al  w1  x2        ;
29720 103086  g11:                   ;  init next key:
29721 103086        ; w3 = entry claim
29722 103086        ; w0 = slice claim
29723 103086       rs  w0  x2+2      ; init slice claim from slice
29724 103088       sl  w2  x1+a109*4 ; if key >=min aux key then
29725 103090       rs  w3  x2        ; init entry claim
29726 103092       al  w2  x2+4      ; increase(key)
29727 103094       sh  w2  x1+a110*4 ; if key <= max cat key then
29728 103096       jl.        g11.   ; goto init next key
29729 103098  g12:                   ; test more internal
29730 103098       rl. w2     h4.    ; load nametable entry
29731 103100       al  w2  x2+2      ; increase(entry)
29732 103102  g13: rs. w2     h4.    ; store next entry
29733 103104       se  w2    (b7)    ;    if entry < last internal in nametable then
29734 103106       jl.        g10.   ;      goto next internal;
29735 103108  
29735 103108  ; all internals have had their claims initialized
29736 103108       jl.        n0.    ;    next instruction
29737 103110  
29737 103110  g15:                   ; init maincat entry-claim:
29738 103110       al  w1  x2        ;
29739 103112  g16:                   ;  init maincat key:
29740 103112       rs  w3  x2        ; init entry claim(key)
29741 103114       al  w2  x2+4      ; increase(key)
29742 103116       sh  w2  x1+a109*4-1; if key < min aux key then
29743 103118       jl.        g16.   ;      goto init next maincat key;
29744 103120  
29744 103120       jl.        g12.   ;    goto test more internals;
29745 103122  
29745 103122  h1:  0                 ; chaintable to be initialized
29746 103124  h2:  0                 ; maxclaim ( = entries)
29747 103126  h3:  0                 ; slice claim
29748 103128  h4:  0                 ; name table entry
29749 103130  h5:  1<4               ; new drum-disc bit
29750 103132  h6:  1<0               ; mask to remove new drum and disc kit
29751 103134  
29751 103134  
29751 103134  ; stepping stones:
29752 103134  am  e12-e17 , e12=k-2
29753 103136  am  e17-e18 , e17 = k-2
29754 103138  am  e18-e19 , e18 = k-2
29755 103140  am  e19-e20 , e19 = k-2
29756 103142  am  e20-e24 , e20 = k-2
29757 103144  am  e24-e26 , e24 = k-2
29758 103146  am  e26-e31 , e26 = k-2
29759 103148  jl. e31.    , e31 = k-2
29760 103150  jl. e44.    , e44 = k-2
29761 103152  jl. e45.    , e45=k-2
29762 103154  jl. e25.    , e25=k-2
29763 103156  jl. e47.    , e47 = k-2
29764 103158  jl. e50.    , e50 = k-2
29765 103160  jl. e53.    , e53 = k-2
29766 103162  jl. e56.    , e56 = k-2
29767 103164  jl. e57.    , e57 = k-2
29768 103166  jl. e58.    , e58 = k-2
29769 103168  jl. e59.    , e59 = k-2
29770 103170  jl. e60.    , e60 = k-2
29771 103172  jl. e64.    , e64 = k-2
29772 103174  jl. e65.    , e65 = k-2
29773 103176  jl. e66.    , e66 = k-2
29774 103178  jl. e70.    , e70 = k-2
29775 103180  jl. e72.    , e72 = k-2
29776 103182  jl. e73.    , e73 = k-2
29777 103184  jl. e74.    , e74 = k-2
29778 103186  jl. e76.    , e76 = k-2
29779 103188  jl. e80.    , e80 = k-2
29780 103190  jl. e81.    , e81 = k-2
29781 103192  jl. e83.    , e83 = k-2
29782 103194  jl. e85.    , e85 = k-2
29783 103196  jl. e90.    , e90 = k-2
29784 103198  jl. e92.    , e92 = k-2
29785 103200  jl. e95.    , e95 = k-2
29786 103202  jl. e96.   , e96 = k-2
29787 103204  
29787 103204  
29787 103204  
29787 103204  ; terminate update of new chainhead
29788 103204  ;
29789 103204  ;   the chaintable and the disc-process are linked, and the slicelength
29790 103204  ;     is inserted in the process-description of the disc
29791 103204  ;   first word of docname.chaintable is initialized, thus indicating
29792 103204  ;     that the chain is no longer empty.
29793 103204  ;   procfunc itself is inserted as user and reserver of the disc-process
29794 103204  ;
29795 103204  ; call: m40
29796 103204  
29796 103204  m40:                   ; terminate update of new chainhead:
29797 103204       rl. w1     d4.    ;    w1 := curdoc;
29798 103206       rl. w2     d11.   ;    w2 := cur proc name table address;
29799 103208       rs  w2  x1+f62    ;    set document name table address;
29800 103210  
29800 103210       rl. w0     d1.+f61+f0;
29801 103212       rs  w0  x1+f61    ;    first word of docname.chainhead := docname.work;
29802 103214  ; now the chaintable-head is completely initialized
29803 103214  ; (except state, which still is undefined)
29804 103214  
29804 103214       rl  w3  x2        ;    proc := disc process description;
29805 103216  
29805 103216       rl  w2  x1+f64    ;    slicelength.proc := slicelength;
29806 103218       ds  w2  x3+a72    ;    chaintable .proc := curdoc;
29807 103220       al  w2  x3        ; insert procfunc as user
29808 103222       rl  w1  (b6)      ; and reserver
29809 103224       jl. w3  e57.      ;
29810 103226       jl.     n0.       ;
29811 103228  
29811 103228  
29811 103228  
29811 103228  ; terminate use of chain and disc
29812 103228  ;
29813 103228  ;   **************************************************
29814 103228  ;   *                                                *
29815 103228  ;   * notice that the following is executed disabled *
29816 103228  ;   *                                                *
29817 103228  ;   **************************************************
29818 103228  ;
29819 103228  ;   the first word of docname.curdoc is cleared, thus indicating
29820 103228  ;     that the chain is empty
29821 103228  ;   removes the links between disc-process and chaintable
29822 103228  ;   removes the name of disc-proc
29823 103228  ;   excludes procfunc as user and reserver of disc-proc
29824 103228  ;   all internal processes will have their claims cleared
29825 103228  ;
29826 103228  ; call: m41
29827 103228  
29827 103228  m41:                   ; terminate use of chain and disc:
29828 103228       rl. w1     d4.    ;    w1 := curdoc;
29829 103230       rs. w1     h1.    ;    save (chaintable address);
29830 103232       jl. w3     e65.    ;
29831 103234       al  w2     0      ;
29832 103236       rs  w2  x1+f61    ;    first word of docname.curdoc := 0;
29833 103238  
29833 103238       rx  w2  x1+f62    ;    document name table addr := 0;
29834 103240  
29834 103240       rl  w2  x2        ;    proc := disc-process;
29835 103242  
29835 103242       rl  w1     (b6)   ;    exclude procfunc as user of the process;
29836 103244       jl  w3  b37       ; exclude procfunc as user(and reserver)
29837 103246  
29837 103246       ld  w1    -100    ;
29838 103248       rs  w0  x2+a11    ;    name(0).proc := 0;
29839 103250                         ;    (this will prevent further use of disc-proc)
29840 103250       rs  w0  x2+a52    ;    reserver.proc := 0;
29841 103252  
29841 103252       ds  w1  x2+a72    ;    chaintable.proc := slicelength.proc := 0;
29842 103254  
29842 103254  ; w0 = 0  ( = max claims )
29843 103254       jl. w3     e66.   ; unlock(monitor)
29844 103256       jl.        g8.    ;    enable, goto prepare claims;
29845 103258  
29845 103258  e.                     ;
29846 103258  
29846 103258  
29846 103258  
29846 103258  ; clean catalog
29847 103258  ;
29848 103258  ;   clears all segments in the current catalog (which must be maincat)
29849 103258  ;
29850 103258  ; call: m42
29851 103258  ; error return: result 2, if catalog io-error
29852 103258  
29852 103258  b. g10, h10 w.
29853 103258  
29853 103258  m42:                   ; clean catalog:
29854 103258       jl. w3     e7.    ;   (terminate update);
29855 103260  ; w2 = start of catalog buffer
29856 103260       al  w0    -1      ;    
29857 103262       al  w1  x2+f9     ;
29858 103264  g1:                    ; clear next word of catalog buffer:
29859 103264       rs  w0  x2        ;
29860 103266       al  w2  x2+2      ;    set all words of catalog buffer to -1
29861 103268       se  w2  x1        ;      thus indicating all entries are free;
29862 103270       jl.        g1.    ;
29863 103272  
29863 103272       al  w0     0      ;    entry count.catbuffer := 0;
29864 103274       rs  w0  x2        ;
29865 103276  
29865 103276                         ;    segment number := 0;
29866 103276  
29866 103276  g2:                    ; next segment:
29867 103276       rs. w0    (h0.)   ;    save (segment number);
29868 103278       jl. w3     e9.    ;    prepare update;
29869 103280       jl. w3     e7.    ;    terminate update;  i.e. write the catalog buffer
29870 103282  ; w1 = segment number
29871 103282       al  w0  x1+1      ;    increase (segment number);
29872 103284       ws. w1    (h1.)   ;
29873 103286       se  w1    -1      ;    if segment number <> size of curcat then
29874 103288       jl.        g2.    ;      goto next segment;
29875 103290  
29875 103290  ; now all catalog segments have been cleared
29876 103290       jl.        n0.    ;    next instruction
29877 103292  
29877 103292  h0:  d8 + f36          ; address of segment number in cat-message
29878 103294  h1:  c0                ; address of size of curcat
29879 103296  
29879 103296  e.                     ;
29880 103296  
29880 103296  
29880 103296  
29880 103296  ; check idle bs-device or still same name
29881 103296  ;
29882 103296  ;   if the disc-process has a link to a chaintable (i.e. chain.disc <> 0)
29883 103296  ;     the new name must correspond with docname.chain
29884 103296  ;     (used after intervention on a disc).
29885 103296  ;   otherwise there are no further limitations on the new process-name.
29886 103296  ;
29887 103296  ; call: m43, <idle bs addr>
29888 103296  ; error return: result 3, if chain.proc <> 0 and newname <> docname.chain.proc
29889 103296  ;               result 6, if newname(0) = 0
29890 103296  ;               goto-action 1, if chain.proc = 0
29891 103296  
29891 103296  m43:                   ; check idle bs-device or test still same name:
29892 103296       rl. w2    (d11.)  ;
29893 103298       rl  w2  x2+a71    ;    chain := chain.curproc;
29894 103300       sn  w2     0      ;    if chain = 0 then
29895 103302       jl.        n5.    ;      goto <idle bs-device>
29896 103304  
29896 103304       rs. w2     d4.    ;    curdoc := chain;
29897 103306  
29897 103306  ; test that name.work = docname.chain
29898 103306  ;  (e.g. find chain with docname = name.work and test same chain)
29899 103306  
29899 103306       jl. w3     e45.   ;    find chain (name.work);
29900 103308         d1+f5           ;
29901 103310       jl.        j3.    ;+4:  not found:  result 3;  (not same name at all)
29902 103312                         ;+6:  found:
29903 103312       sn. w2    (d4.)   ;    if chain = curdoc then
29904 103314       jl.        n1.    ;      skip;  (i.e. name.chain = name.work)
29905 103316  
29905 103316       jl.        j3.    ;    result 3;  (not same name)
29906 103318  j3 = k-2               ; (stepping stone)
29907 103318  
29907 103318  
29907 103318  
29907 103318  
29907 103318  ;set work1.area:=no of keys.catalog.work
29908 103318  ;
29909 103318  ;call d11: name table address of area
29910 103318  
29910 103318  m44:                   ; 
29911 103318       rl. w2   (d11.)   ;
29912 103320       zl. w3    v27.    ; set work1.area:=no of keys
29913 103322       hs  w3  x2+a58    ;
29914 103324       jl.        n0.    ;
29915 103326  
29915 103326  
29915 103326  
29915 103326  
29915 103326  
29915 103326  ; search best area process
29916 103326  ;
29917 103326  ; call: m45, <not found addr>
29918 103326  ; error return: goto-action 1, if area process not found
29919 103326  
29919 103326  m45:                   ; search best area process:
29920 103326       jl. w3     e47.   ;    search best process
29921 103328         b5              ;      between first area process
29922 103330         b6              ;      and     top   area process;
29923 103332       jl.        n5.    ;+6: not found: goto <not found>
29924 103334  
29924 103334  ; w2 = area- (or pseudo-) process
29925 103334       rl  w0  x2+a10    ;    w0 := kind.proc;
29926 103336       sn  w0     f38    ;    if kind.proc = area process then
29927 103338       jl.        n1.    ;      skip;
29928 103340  
29928 103340       jl.        n5.    ;    goto <not area>;
29929 103342  
29929 103342  
29929 103342  
29929 103342  ; setup area process
29930 103342  ;
29931 103342  ;   if the area process already exists, the specified process
29932 103342  ;     is included as user (in case it has resources)
29933 103342  ;   otherwise the area-claim of the process is tested,
29934 103342  ;     and an empty area process is initialized according to entry.work
29935 103342  ;
29936 103342  ; call: (entry.work contains the entry)
29937 103342  ;       m46, <process code>    (code = 0 : procfunc, code = 2 : sender)
29938 103342  ;
29939 103342  ; error return: result 1, if area claims exceeded
29940 103342  ; return: cur proc name table address corresponds to the area process
29941 103342  ;         the specified process is included as user of the area process
29942 103342  
29942 103342  b. g10, h10 w.
29943 103342  
29943 103342  m46:                   ; setup area process:
29944 103342       jl. w3     n10.   ;    w0 := process code := param;
29945 103344       rl  w1    (b6)    ; internal = case process code of
29946 103346       se  w0     0      ;   0: procfunc
29947 103348       rl. w1    (d20.)  ;   2: sender
29948 103350       rs. w1     h1.    ;
29949 103352  
29949 103352       jl. w3     e47.   ;    search best area process;
29950 103354         b5              ;
29951 103356         b6              ;
29952 103358       jl.        g1.    ;+6:   not found: goto test area claim;
29953 103360  
29953 103360  ; an area process was found, but was it the rigth one, i.e how about the base
29954 103360  ; w0w1 = base.proc
29955 103360       sn. w0    (d1.+f1);    if base.proc <> base.work then
29956 103362       se. w1    (d1.+f2);
29957 103364       jl.        g1.    ;      goto test area claim;
29958 103366  
29958 103366  ; it was the correct area proces
29959 103366       jl.        g5.    ;    goto include;
29960 103368  
29960 103368  g1:                    ; test area claim:
29961 103368       rl. w1     h1.    ;
29962 103370       bz  w0  x1+a20    ;    if area claim.internal = 0 then
29963 103372       sn  w0     0      ;
29964 103374       jl.        j1.    ;      goto result 1;  i.e. claims exceeded
29965 103376  
29965 103376  ; the internal process has the claim of at least one area process,
29966 103376  ;   i.e. at least one empty area process exist.
29967 103376  ; find that one and initialize it.
29968 103376       jl. w3     e40.   ;    find empty area process;
29969 103378       ld  w1  -100      ;
29970 103380       rs  w0  x3+a57    ; work0:=work1:= 0
29971 103382       ds  w1  x3+a412   ;   access counters:=0,0;
29972 103384       jl. w3     g10.   ;    init area(enabled);
29973 103386  
29973 103386  ; an area process exists now, corresponding to entry.work
29974 103386  g5:                    ; include:
29975 103386       rl. w1     h1.    ;  w1:=intproc;
29976 103388       rl. w2    (d11.)  ;  w2:=extproc;
29977 103390       jl. w3     e64.   ;  test users and reserver
29978 103392       sz  w3     f20    ;  if intproc already user then
29979 103394       jl.        n0.    ;  goto next instruction else
29980 103396       al  w0     -1     ;
29981 103398       ba  w0   x1+a20   ;
29982 103400       sn  w0     -1     ;  if areaclaim.sender=0 then
29983 103402       jl.        j1.    ;  goto result 1 else
29984 103404       j1=k-2
29985 103404       hs  w0  x1+a20    ;  else decrease areaclaim.sender;
29986 103406       jl. w3  e58.      ;  include internal as user
29987 103408  
29987 103408       jl.        n0.    ;    next instruction
29988 103410  
29988 103410  
29988 103410  
29988 103410  ; subprocedure init area
29989 103410  ;
29990 103410  ;   initializes the area process from information given in entry.work
29991 103410  ;
29992 103410  ; an empty    area process may  be initialized enabled
29993 103410  ; an existing  -      -    must  -      -      disabled
29994 103410  ;
29995 103410  ; call: w3 = link
29996 103410  
29996 103410  g10:                   ; procedure init area:
29997 103410       rs. w3     h2.    ;    save (return);
29998 103412       al. w2     d1.    ;    move from: entry.work
29999 103414       rl. w3    (d11.)  ;         to:   area process   the following:
30000 103416  
30000 103416       al  w0     f38    ;
30001 103418       rs  w0  x3+a10    ;      kind ( = area process)
30002 103420  
30002 103420       dl  w1  x2+f11+2  ;
30003 103422       ds  w1  x3+a62+2  ;      docname
30004 103424       dl  w1  x2+f11+6  ;
30005 103426       ds  w1  x3+a62+6  ;
30006 103428  
30006 103428       bz  w0  x2+f4     ;
30007 103430       rs  w0  x3+a60    ;      first slice
30008 103432  
30008 103432       rl  w0  x2+f7     ;
30009 103434       rs  w0  x3+a61    ;      size
30010 103436  
30010 103436       dl  w1  x2+f2     ;
30011 103438       ds  w1  x3+a49    ;      base
30012 103440       rl. w1     d4.    ;
30013 103442       rl  w1 (x1+f62)   ;      <* logical disc
30014 103444       rl  w0  x1+a250   ;         driverproc address or -1 if itc-area *>
30015 103446       rs  w0  x3+a250   ;
30016 103448       rl  w0  x1+a10    ;      area.main :=
30017 103450       se  w0     62     ;      if logical_disc.kind = 62 <* old disc *> and
30018 103452       jl.        g9.    ;         logical_disc.state= after_intervention then
30019 103454       rl  w0  x1+42     ;         0
30020 103456       sn  w0     0      ;      else
30021 103458       al  w1     0      ;         logical_disc;
30022 103460  g9:  rs  w1  x3+a50    ;
30023 103462                         ;
30024 103462  
30024 103462  ; notice: name(0) is moved last
30025 103462       dl  w1  x2+f5+6   ;
30026 103464       ds  w1  x3+a11+6  ;      name
30027 103466       dl  w1  x2+f5+2   ;
30028 103468       ds  w1  x3+a11+2  ;
30029 103470  
30029 103470       jl.       (h2.)   ;    return;
30030 103472  
30030 103472  h1:  0                 ; internal
30031 103474  h2:  0                 ; return from init area
30032 103476  
30032 103476  
30032 103476  
30032 103476  ; include in area process
30033 103476  ;
30034 103476  ;   the internal process, specified in the parameter is included
30035 103476  ;     as user of the area process
30036 103476  ;
30037 103476  ; call: m47, <process code>
30038 103476  ; error return: result 1, if area claims exceeded
30039 103476  
30039 103476  m47:                   ; include in area process:
30040 103476       jl. w3     n10.   ;    w0 := process code := param;
30041 103478       rl  w1    (b6)    ; internal = case process code of
30042 103480       se  w0     0      ;   0: procfunc
30043 103482       rl. w1    (d20.)  ;   2: sender
30044 103484       rs. w1     h1.    ;
30045 103486       jl.        g5.    ;    goto include;
30046 103488  
30046 103488  d20: d2                ;                param = 2 : sender
30047 103490  
30047 103490  
30047 103490  ; if area process then reinit area process
30048 103490  ;
30049 103490  ;   it is tested, that an area process was found earlier.
30050 103490  ;   in this case it will be re-initialized from the current entry.work
30051 103490  ;
30052 103490  ; call: m48
30053 103490  
30053 103490  m48:                   ; reinit area process:
30054 103490       rl. w2     d11.   ;    if cur proc name table address
30055 103492       sl  w2    (b5)    ;      does not outpoint an area process then
30056 103494       sl  w2    (b6)    ;
30057 103496       jl.        n0.    ;      next instruction;
30058 103498  
30058 103498       jl. w3     g10.   ;    init area process ;
30059 103500  
30059 103500       jl.        n0.    ;    
30060 103502                         ;    next instruction
30061 103502  
30061 103502  e.                     ;
30062 103502  
30062 103502  
30062 103502  
30062 103502  ; make sender to reserver of area process
30063 103502  ;
30064 103502  ; call: m49
30065 103502  
30065 103502  m49:                   ; make sender reserver:
30066 103502       rl. w1     d2.    ;    w1 := sender;
30067 103504       rl. w2    (d11.)  ;    w2 := area process;
30068 103506       jl. w3     e57.   ; insert reserver
30069 103508  
30069 103508       jl.        n0.    ;    next instruction
30070 103510  n0 = k-2               ; (stepping stone)
30071 103510  
30071 103510  
30071 103510  
30071 103510  ; if area process then delete area process
30072 103510  ;
30073 103510  ;   the first word of name.proc is cleared, indicating an empty areaprocess.
30074 103510  ;   reserver.proc and users.proc are cleared.
30075 103510  ;   all internal processes who were users of the area process will have
30076 103510  ;     their area-claim increased.
30077 103510  ;
30078 103510  ; call: m50
30079 103510  
30079 103510  b. g10, h5 w.
30080 103510  
30080 103510  m50:                   ; if areaprocess then delete area process:
30081 103510       rl. w2     d11.   ;    w2 := name table address of possible area process;
30082 103512       sl  w2    (b5)    ;    if not an area process then
30083 103514       sl  w2    (b6)    ;
30084 103516       jl.        n0.    ;      next instruction
30085 103518       rl  w2  x2         ; proc=area
30086 103520       jl. w3     e67.    ; clean area proc;
30087 103522       rl  w3  b6         ;
30088 103524  g1:  rl  w1  x3         ;
30089 103526       rs. w3  h1.        ; for all internals in nametable do
30090 103528       jl. w3  e64.       ; test users and reserver
30091 103530       rs. w3  h0.        ;
30092 103532       so  w3  f20        ; if internal is user then
30093 103534       jl.     g2.        ; exclude internal as user
30094 103536       jl. w3  e56.       ; increase claim
30095 103538       rl. w3  h0.       ; if internal has writeprotected
30096 103540       sz  w3  f24       ;
30097 103542       jl. w3  e53.      ;    then remove writeprotection;
30098 103544       al  w0  1          ;
30099 103546       ba  w0  x1+a20     ;
30100 103548       hs  w0  x1+a20     ;
30101 103550  g2:  dl. w0  h0.        ;
30102 103552       so  w0  f22        ; if no other users then
30103 103554       jl.     n0.        ; return
30104 103556       al  w3  x3+2       ;
30105 103558       jl.     g1.        ;
30106 103560  
30106 103560  h1: 0                   ; saved internal
30107 103562  h0: 0                   ; result from test user,reserver and writeprotected
30108 103564  
30108 103564  
30108 103564  e.                     ;
30109 103564  
30109 103564  
30109 103564  ; find process and move bs-claims from process to sender area
30110 103564  ; call : m51
30111 103564  b.   g10 w.
30112 103564  m51: am.        (d2.)  ; prepare move of name
30113 103566       al  w2     +a11   ;
30114 103568       al. w1     v5.    ;
30115 103570       rl  w3  x1        ; if name(0):= 0 then
30116 103572       sn  w3     0      ; name:= name.caller
30117 103574       jl. w3     e32.   ;
30118 103576       jl. w3     e47.   ; find best process
30119 103578              b6         ; first internal in name table
30120 103580              b7         ; last in name table
30121 103582       jl.        j3.    ; process non exist: result 3
30122 103584       am.        (d4.)  ;
30123 103586       wa  w2     f60    ; w2:= bs-claim address in curr proc
30124 103588       al  w1  x2        ;
30125 103590       al  w0     a110*4+4; bs-claims length
30126 103592       jl. w3     e83.   ; move
30127 103594       jl. w2     e60.   ; w2:=addr(w1.sender);
30128 103596       al  w1  x2+a110*4 ; w1:=last key;
30129 103598  g0:  rl  w0  x2+2      ; w0:=slice;
30130 103600       am.        (d4.)  ;
30131 103602       wm  w0     f64    ; w0:=segments;
30132 103604       rs  w0  x2+2      ;  :=segment;
30133 103606       al  w2  x2+4      ; w2:=next key;
30134 103608       sh  w2  x1        ; if w2<=last key then
30135 103610       jl.        g0.    ; goto next key;
30136 103612       jl.        j0.    ; goto result ok
30137 103614  e.
30138 103614  
30138 103614  
30138 103614  
30138 103614  ; find empty entry
30139 103614  ;
30140 103614  ;   the current catalog is searched for an empty catalog entry
30141 103614  ;
30142 103614  ; call: m55, <no room addr>
30143 103614  ; error return: result 2, if catalog io-error
30144 103614  ;               goto-action 1, if no empty entries were found
30145 103614  
30145 103614  m55:                   ; find empty entry:
30146 103614       jl. w3     e10.   ;    search free entry;
30147 103616       jl.        n5.    ;+2:  no room: goto <no room>
30148 103618       jl.        n1.    ;    skip
30149 103620  
30149 103620  
30149 103620  
30149 103620  ; modify cur entry
30150 103620  ;
30151 103620  ;   the entry, previously found by ..find empty entry.. or some other
30152 103620  ;     search-routines is modified by the current contents of work.
30153 103620  ;
30154 103620  ; call: m56
30155 103620  ; error return: result 2, if catalog io-error
30156 103620  
30156 103620  m56:                   ; modify cur entry:
30157 103620       jl.       (2), e12;    set cur entry and return;
30158 103624  
30158 103624  
30158 103624  
30158 103624  ; delete cur entry
30159 103624  ;
30160 103624  ;   the entry, previously found by some search-routines, is deleted
30161 103624  ;
30162 103624  ; call: m57
30163 103624  ; error return: result 2, if catalog io-error
30164 103624  
30164 103624  m57:                   ; delete cur entry:
30165 103624       jl.       (2), e13;    delete cur entry and return;
30166 103628  ;stepping stones:
30167 103628  jl.   e2. , e2 =k-2
30168 103630  jl.  e31. , e31=k-2
30169 103632  jl.  e32. , e32=k-2
30170 103634  jl.  e33. , e33=k-2
30171 103636  jl.  e40. , e40=k-2
30172 103638  jl.  e65. , e65=k-2
30173 103640  jl.  e66. , e66=k-2
30174 103642  ;jl.  e70. , e70=k-2
30175 103642  ;jl.  e72. , e72=k-2
30176 103642  ;jl.  e73. , e73=k-2
30177 103642  ;jl.  e80. , e80=k-2
30178 103642  ;jl.  e81. , e81=k-2
30179 103642  ;jl.  e85. , e85=k-2
30180 103642  ;jl.  e90. , e90=k-2
30181 103642  ;jl.  e95. , e95=k-2
30182 103642  ;jl.  e96. , e96=k-2
30183 103642  ;jl.  e92. , e92=k-2
30184 103642  jl.  n20. , n20=k-2
30185 103644  jl.  n1.  , n1 =k-2
30186 103646  jl.  n5.  , n5 =k-2
30187 103648  
30187 103648  
30187 103648  
30187 103648  ; set aux entry
30188 103648  ;
30189 103648  ;   if the entry does not exist already in the auxcat, it will be
30190 103648  ;     created.
30191 103648  ;   finally entry.work is moved to that entry
30192 103648  ;
30193 103648  ; call: m58, <overlap or no room addr>
30194 103648  ; error return: result 2, if catalog io-error
30195 103648  ;               goto-action 1, if entry could not be created
30196 103648  ;                                (i.e. overlapping intervals or no room)
30197 103648  
30197 103648  m58:                   ; set aux entry:
30198 103648       al. w3     p0.    ;
30199 103650       jl.        n20.   ;    call(set aux);
30200 103652  
30200 103652  
30200 103652  
30200 103652  ; delete aux entry
30201 103652  ;
30202 103652  ;   if the entry exists in the aux catalog, it will be removed
30203 103652  ;     (if it does'nt exist nothing will be deleted)
30204 103652  ;
30205 103652  ; call: m59
30206 103652  ; error return: result 2, if catalog io-error
30207 103652  
30207 103652  m59:                   ; delete aux entry:
30208 103652       al. w3     p1.    ;
30209 103654       jl.        n20.   ;    call(delete aux);
30210 103656  
30210 103656  ; clear access counters.work
30211 103656  ;
30212 103656  ;  the write and read access counters in the statarea of work is cleared.
30213 103656  ;
30214 103656  ;  call: m60
30215 103656  
30215 103656  m60:                   ; clear access counters:
30216 103656       ld  w1     -100   ;
30217 103658       ds. w1     d30.+4 ;   access counters.work:=0,0;
30218 103660       jl.        n0.    ;   next instruction;
30219 103662  
30219 103662  
30219 103662  ; update and insert statarea
30220 103662  ; updates last change in statarea of work and moves statarea.work to current entry.
30221 103662  ;
30222 103662  ;  call: m62
30223 103662  
30223 103662  m62:                    ; update and insert statarea:
30224 103662       dl  w1     b13+2   ;
30225 103664       ld  w1     5       ;   now:=monitor time shift 5;
30226 103666       rs. w0     d30.+0  ;   last change:=word0(now);
30227 103668       rs. w0     d30.+6  ;   last used:=word0(now)
30228 103670  
30228 103670  
30228 103670  ; move statarea.work to statarea.entry
30229 103670  
30229 103670  ;
30230 103670  ; moves statarea.work to statarea.entry (=docname area)
30231 103670  ;
30232 103670  ;  call:  m63
30233 103670  
30233 103670  m63:                    ; move statarea.work to statarea.entry:
30234 103670       jl. w3      e9.    ;   prepare update;
30235 103672       am          e49-e50;
30236 103674  
30236 103674  ; move statarea.entry to statarea.work
30237 103674  ;
30238 103674  ; moves statarea.entry (=docname area in aux cat) to statarea.work
30239 103674  ;
30240 103674  ;  call:  m64
30241 103674  
30241 103674  m64:                    ; move statarea.entry to statarea.work:
30242 103674       jl. w3     e50.    ;   get statinf;
30243 103676       jl.        n0.     ;   next instruction;
30244 103678  
30244 103678  
30244 103678  
30244 103678  ; set base and name
30245 103678  ;
30246 103678  ;   base.work and name.work are taken from catbase.sender and w3-name.sender
30247 103678  ;
30248 103678  ; call: m65
30249 103678  
30249 103678  m65:                   ; set base and name:
30250 103678       rl. w1  d2.       ;   w1:=sensed;
30251 103680       dl  w1  x1+a43    ;
30252 103682       ds. w1     d1.+f2 ;    base.work := catbase.sender;
30253 103684       jl. w3     e90.   ;    move name.sender to name.work;
30254 103686       jl.        n0.    ;    next instruction
30255 103688  
30255 103688  
30255 103688  
30255 103688  ; docname.work := docname.chain
30256 103688  ;
30257 103688  ; call: m66
30258 103688  
30258 103688  m66:                   ; init docname.work from docname.curdoc:
30259 103688       am         f61-f55;    namerel := docname rel;
30260 103690  
30260 103690  ; name.work := name.chain
30261 103690  ;
30262 103690  ; call: m67
30263 103690  
30263 103690  m67:                   ; init name.work from name.curdoc:
30264 103690       al  w2     f55    ;    namerel := name rel;
30265 103692       al. w1  x2+d1.+f0 ;    to-addr := work + namerel;
30266 103694       wa. w2     d4.    ;    from-addr := curdoc + namerel;
30267 103696       jl.        e32.   ;    move name
30268 103698                         ;      and return;
30269 103698  
30269 103698  
30269 103698  
30269 103698  ; name.work := name.pseudochain ( = main catalog name )
30270 103698  ;
30271 103698  ; call: m68
30272 103698  
30272 103698  m68:                   ; init name.work from maincat name:
30273 103698       al. w1     d1.+f5 ;
30274 103700       rl. w2     d5.    ;
30275 103702       al  w2  x2+f55    ;    move name.pseudochain to name.work;
30276 103704       jl.        e32.   ;      (and return)
30277 103706  
30277 103706  
30277 103706  
30277 103706  ; base.work := interval for catalogs
30278 103706  ;
30279 103706  ; call: m70
30280 103706  
30280 103706  m70:                   ; init base.work from catalog interval:
30281 103706       dl  w1     b45    ;
30282 103708       ds. w1     d1.+f2 ;    base.work := catalog interval;
30283 103710       jl.        n0.    ;    next instruction
30284 103712  
30284 103712  
30284 103712  
30284 103712  ; test new base ( = w0w1.sender )
30285 103712  ;
30286 103712  ;   the new base must be either:
30287 103712  ;               1. equal to stdbase (or maxbase)
30288 103712  ;           or  2. inside stdbase
30289 103712  ;           or  3. between stdbase and maxbase
30290 103712  ;
30291 103712  ; call: m71
30292 103712  ; error return: result 4, if illegal new base
30293 103712  ; return:  w0w1 = new base
30294 103712  
30294 103712  b. g10 w.
30295 103712  ;test catbase of internal 
30296 103712  m69: rl. w3  d1.+f5    ; if name(0):= 0
30297 103714       sn  w3  0         ; then proc:=sender
30298 103716       jl.     m71.      ;
30299 103718       jl. w3  e17.      ; else proc:=child.sender
30300 103720       al  w2  x3        ;
30301 103722       jl.     g0.       ; test new base
30302 103724  
30302 103724  m71:                   ; test new base:
30303 103724       rl. w2     d2.    ;    w2 := sender;
30304 103726       al  w1  x2        ;
30305 103728  
30305 103728  g0:  dl  w1  x1+a29    ;    newbase := w0w1.sender;
30306 103730  
30306 103730       sh  w1 (x2+a44-0) ;    if newupper > maxupper
30307 103732       sl  w0  x1+1      ;    or newlower > newupper then
30308 103734       jl.        j4.    ;      goto result 4;
30309 103736                         ;      (i.e. not inside maxbase or illegal base)
30310 103736  
30310 103736       sl  w0 (x2+a45-2) ;    if newlower < stdlower then
30311 103738       jl.        g5.    ;      begin  <* test between stdbase and maxbase *>
30312 103740       al  w3  x1+1      ;      (trick)
30313 103742       sl  w0 (x2+a44-2) ;      if newlower < maxlower <* outside maxbase *>
30314 103744       sh  w3 (x2+a45-0) ;      or newupper < stdupper <* embraces stdlower *>
30315 103746       jl.        j4.    ;        then goto result 4;
30316 103748  
30316 103748  ; at this point: maxlower <= newlower <  stdlower
30317 103748  ;                stdupper <= newupper <= maxupper
30318 103748       jl.        n0.    ;      next instruction
30319 103750  
30319 103750  g5:                    ;      end;
30320 103750  
30320 103750  ; at this point: stdlower <= newlower
30321 103750  ;                            newupper <= maxupper
30322 103750  
30322 103750       se  w0 (x2+a45-2) ;    if newlower = stdlower <* irrellevant newupper *>
30323 103752       sh  w1 (x2+a45-0) ;    or newupper <= stdupper <* inside stdbase *>
30324 103754       jl.        n0.    ;      then next instruction;
30325 103756  
30325 103756  ; this time the following was allowed:
30326 103756  ;                stdlower = newlower <= newupper <= maxupper
30327 103756  ;            or  stdlower < newlower <= newupper <= stdupper
30328 103756  
30328 103756       jl.        j4.    ;    goto result 4;
30329 103758  j4 = k-2               ; (stepping stone)
30330 103758  
30330 103758  e.                     ;
30331 103758  
30331 103758  
30331 103758  
30331 103758  ; save oldbase, base.work := w0w1.sender
30332 103758  ;
30333 103758  ; call: w0w1 = newbase
30334 103758  ;       m72, <same base addr>
30335 103758  ;
30336 103758  ; error return: goto-action 1, if newbase = oldbase
30337 103758  
30337 103758  b. g10, h10 w.
30338 103758  
30338 103758  m72:                   ; save oldbase:
30339 103758       dl. w3     d1.+f2 ;
30340 103760       ds. w3     h1.    ;    save (base.work);
30341 103762  
30341 103762       ds. w1     d1.+f2 ;    base.work := newbase;
30342 103764  
30342 103764       sn  w0  x2        ;    if newbase <> oldbase then
30343 103766       se  w1  x3        ;
30344 103768       jl.        n1.    ;      skip;
30345 103770  
30345 103770       jl.        n5.    ;    goto <same base>;
30346 103772  
30346 103772  h0:  0                 ; old lower base
30347 103774  h1:  0                 ; old upper base
30348 103776  
30348 103776  
30348 103776  
30348 103776  ; restore old base
30349 103776  ;
30350 103776  ; call: m73
30351 103776  
30351 103776  m73:                   ; restore old base:
30352 103776       dl. w1     h1.    ;
30353 103778       ds. w1     d1.+f2 ;    base.work := oldbase;
30354 103780       jl.        n0.    ;    next instruction;
30355 103782  
30355 103782  e.                     ;
30356 103782  
30356 103782  
30356 103782  
30356 103782  ; set catbase of internal
30357 103782  ;
30358 103782  ;   if first word of name.w3.sender = 0, the catbase of sender is set
30359 103782  ;     otherwise name must outpoint a child of sender:
30360 103782  ;       catbase.child := newbase
30361 103782  ;
30362 103782  ; call: w0w1 = newbase
30363 103782  ;       w2   = sender
30364 103782  ;       m74
30365 103782  ;
30366 103782  ; error return: result 2, if state.child <> waiting for start by parent
30367 103782  ;               result 3, if internal not found
30368 103782  ;               result 3, if internal not child
30369 103782  ;               result 6, if nameformat illegal
30370 103782  ; return: is always enabled
30371 103782  
30371 103782  b. g10 w.
30372 103782  
30372 103782  m74:                   ; set catbase of internal:
30373 103782       rl. w3     d1.+f5 ;    if name(0) = 0 then
30374 103784       sn  w3     0      ;      goto set base;
30375 103786       jl.        g5.    ;      (i.e. own process)
30376 103788  
30376 103788       jl. w3     e17.   ;    first proc;
30377 103790  ; w1 = sender, w3 = child
30378 103790       al  w0  x3        ; save w3 and
30379 103792       jl. w3     e65.   ; lock(monitor)
30380 103794       rl  w3     0      ; restore w3
30381 103796  c.-1
30382 103796       bz  w0  x3+a13    ;    if state.child
30383 103796       se  w0     f47    ;          <> waiting for start by parent then
30384 103796       jl.        j2.    ;      enabled goto result 2;
30385 103796  z.
30386 103796       dl  w1  x1+a29    ;    w0w1 := newbase.sender;
30387 103798       al  w2  x3        ;    internal := child;
30388 103800  
30388 103800  g5:                    ; set base:
30389 103800  ; w0w1 = newbase
30390 103800  ; w2   = internal
30391 103800       ds  w1  x2+a43    ;    catbase.internal := newbase;
30392 103802       jl.        n0.    ;    enable (if after check of child)
30393 103804                         ;    next instruction;
30394 103804  
30394 103804  e.                     ;
30395 103804  
30395 103804  
30395 103804  
30395 103804  ; test base.work, key.work
30396 103804  ;
30397 103804  ;   the consistency of base and key is checked:
30398 103804  ;     if key < min global key then base must be inside stdbase
30399 103804  ;
30400 103804  ; call: m75, <error addr>
30401 103804  ; error return: goto-action 1, if base,key inconsistent
30402 103804  
30402 103804  m75:                   ; test base and key:
30403 103804       al  w0    -f51-1  ;
30404 103806       la. w0     d1.+f3 ;    key := key.work;
30405 103808       sl  w0     a111   ;    if key >= min global key then
30406 103810       jl.        n1.    ;      skip;
30407 103812  
30407 103812       rl. w2     d2.    ;    w2 := sender;
30408 103814       dl. w1     d1.+f2 ;    w0w1 := base.work;
30409 103816       al  w1  x1-1      ;    (codetrick)
30410 103818  
30410 103818       sl  w0 (x2+a45-2) ;    if base.work is outside stdbase.sender then
30411 103820       sl  w1 (x2+a45-0) ;
30412 103822       jl.        n5.    ;      goto <error>;
30413 103824  
30413 103824       jl.        n1.    ;    skip;
30414 103826  
30414 103826  
30414 103826  
30414 103826  ; test auxkey, interval
30415 103826  ;
30416 103826  ;   tests that:  min aux key <= key.work <= max cat key
30417 103826  ;     and that base.work is legal and not outside catalog interval
30418 103826  ;
30419 103826  ;   notice: it is thus allowed to make any kind of intervals,
30420 103826  ;           independant of maxbase.sender and stdbase.sender
30421 103826  ;
30422 103826  ; call: m76
30423 103826  ; error return: result 5, if key.work not a legal aux-key
30424 103826  ;               result 5, if base.work illegal
30425 103826  
30425 103826  m76:                   ; test auxkey and interval:
30426 103826       al  w0    -f51-1  ;
30427 103828       la. w0     d1.+f3 ;    key := key.work;
30428 103830       sl  w0     a109   ;    if key < min aux key
30429 103832       sl  w0     a110+1 ;    or key > max cat key then
30430 103834       jl.        j5.    ;      goto result 5;
30431 103836  
30431 103836       dl. w2     d1.+f2 ;    w1w2 := base.work;
30432 103838  
30432 103838       sl  w1    (b45-2) ;    if lower base < minimum
30433 103840       sl  w1  x2+1      ;    or lower base > upper base
30434 103842       jl.        j5.    ;
30435 103844  
30435 103844       sh  w2    (b45)   ;    or upper base > maximum then
30436 103846       jl.        n0.    ;      goto result 5;
30437 103848       jl.        j5.    ;    next instruction;
30438 103850  j5 = k-2               ; (stepping stone)
30439 103850  
30439 103850  
30439 103850  
30439 103850  ; if key.work < min aux key then goto ...
30440 103850  ;
30441 103850  ; call: m77, <not aux key>
30442 103850  ; error return: goto-action 1, if key < min aux key
30443 103850  
30443 103850  m77:                   ; test aux key:
30444 103850       al  w0    -f51-1  ;
30445 103852       la. w0     d1.+f3 ;    key := key.work;
30446 103854       sl  w0     a109   ;    if key >= min aux key then
30447 103856       jl.        n1.    ;      skip;
30448 103858  
30448 103858       jl.        n5.    ;    goto <not aux key>;
30449 103860  
30449 103860  
30449 103860  
30449 103860  ; save oldkey and test newkey
30450 103860  ;
30451 103860  ;   old key is saved
30452 103860  ;   the new key must obey:  0 <= new key <= max cat key
30453 103860  ;   key.work := new key;
30454 103860  ;
30455 103860  ; call: m78
30456 103860  ; error return: result 4, if newkey illegal
30457 103860  
30457 103860  b. g10 w.
30458 103860  
30458 103860  m78:                   ; save oldkey and test newkey:
30459 103860       al  w0    -f51-1  ;
30460 103862       la. w0     d1.+f3 ;    key := key.work;
30461 103864       rs. w0     d10.   ;    oldkey := key;
30462 103866  
30462 103866       rl. w1     d2.    ;    w1 := sender;
30463 103868       rl  w0  x1+a29    ;    newkey := w1.sender;
30464 103870       sl  w0     0      ;    if new key illegal then
30465 103872       sl  w0     a110+1 ;
30466 103874       jl.        j4.    ;      goto result 4;
30467 103876  
30467 103876  g0:                    ; set key.work:
30468 103876  ; w0 = key
30469 103876       al  w1     f51    ;
30470 103878       la. w1     d1.+f3 ;    (leave first slice and namekey unchanged)
30471 103880       wa  w1     0      ;
30472 103882       rs. w1     d1.+f3 ;    key.work := key;
30473 103884  
30473 103884       jl.        n0.    ;    next instruction;
30474 103886  
30474 103886  d10: 0                 ; oldkey
30475 103888  
30475 103888  
30475 103888  
30475 103888  ; restore oldkey
30476 103888  ;
30477 103888  ;   key.work := oldkey
30478 103888  ;
30479 103888  ; call: m79
30480 103888  
30480 103888  m79:                   ; restore oldkey:
30481 103888       am.       (d10.)  ;    key := oldkey;
30482 103890  
30482 103890  
30482 103890  
30482 103890  ; key.work := 0
30483 103890  ;
30484 103890  ; call: m80
30485 103890  
30485 103890  m80:                   ; clear key.work:
30486 103890       al  w0     0      ;    key := 0;
30487 103892       jl.        g0.    ;    goto set key.work;
30488 103894  
30488 103894  e.                     ;
30489 103894  
30489 103894  
30489 103894  
30489 103894  ; size.work := name table addr of area process
30490 103894  ;
30491 103894  ; call: m83
30492 103894  
30492 103894  m83:                   ; set name table addr:
30493 103894       am.       (d11.)  ;    size.work := cur proc name table addr;
30494 103896  
30494 103896  
30494 103896  
30494 103896  ; size.work := 0
30495 103896  ;
30496 103896  ; call: m84
30497 103896  
30497 103896  m84:                   ; clear size.work:
30498 103896       al  w0     0      ;    size.work := 0;
30499 103898       rs. w0     d1.+f7 ;
30500 103900       jl.        n0.    ;    next instruction;
30501 103902  
30501 103902  
30501 103902  
30501 103902  ; search bs-process and check reserved by sender
30502 103902  ;
30503 103902  ;   the document, specified in docname.work must be a bs-device,
30504 103902  ;     i.e. it must have base.proc = catalog interval.
30505 103902  ;   it must be reserved by sender, because this will ensure, that
30506 103902  ;     the document not already exists in the bs-system (otherwise
30507 103902  ;     it would have been reserved by procfunc)
30508 103902  ;   notice: chainhead.work is destroyed, but reinitialized
30509 103902  ;
30510 103902  ; call: m85, <not exist or not reserved addr>
30511 103902  ; error return: result 6, if document nameformat illegal
30512 103902  ;               goto-action 1, if not reserved bs-device
30513 103902  ; return: cur proc name table addr is defined (i.e. the bs-device)
30514 103902  
30514 103902  m85:                   ; check reserved bs-device:
30515 103902       al. w1     d1.+f5 ;
30516 103904       al  w2  x1+f11-f5 ;    move docname.work to name.work;
30517 103906       jl. w3     e32.   ;
30518 103908  
30518 103908       jl. w3     e24.   ;    test format;
30519 103910       jl. w3     e47.   ;    search best process in device-part of name table;
30520 103912         b4              ; (first device in name table)
30521 103914         b5              ; (top   device in name table)
30522 103916       jl.        n5.    ;+6:   not found: goto <not exist>
30523 103918  
30523 103918  ; w0w1 = base.proc, w2 = proc
30524 103918       sn  w0    (b45-2) ;    if base.proc <> catalog interval then
30525 103920       se  w1    (b45-0) ;
30526 103922       jl.        n5.    ;      goto <not bs interval>;
30527 103924  
30527 103924       rl. w1     d2.    ;    w1 := sender;
30528 103926       rl  w0  x2+a52    ;    w0 := reserver.proc;
30529 103928       se  w0 (x1+a14)   ;    if sender is not reserver then
30530 103930       jl.        n5.    ;      goto <not reserver>;
30531 103932  
30531 103932  ; (move chainhead.sender to work, because name.work was destroyed above)
30532 103932  
30532 103932  
30532 103932  
30532 103932  ; move chainhead.sender to work, if catsize <= 0 then goto <illegal catsize>
30533 103932  ;
30534 103932  ;   (the catalog must have at least one catalog segment)
30535 103932  ;
30536 103932  ; call: m86, <illegal catsize addr>
30537 103932  ; error return: goto-action 1, if catsize illegal
30538 103932  
30538 103932  m86:                   ; move chainhead to work, test catsize:
30539 103932       jl. w3     e92.   ;    move chainhead.sender to work;
30540 103934  
30540 103934  
30540 103934  
30540 103934  ; if size <= 0 then goto <illegal catsize>
30541 103934  ;
30542 103934  ; call: m87, <illegal catsize addr>
30543 103934  ; error return: goto-action 1, if size <= 0
30544 103934  
30544 103934  m87:                   ; test positive size:
30545 103934       am         1-0    ;    minimum size := 1;
30546 103936  
30546 103936  
30546 103936  
30546 103936  ; if size < 0 then goto <file descriptor>
30547 103936  ;
30548 103936  ; call: m88, <file descr addr>
30549 103936  ; error return: goto-action 1, if size < 0
30550 103936  
30550 103936  m88:                   ; test size not negative:
30551 103936       al  w0     0      ;    minimum size := 0;
30552 103938       sh. w0    (d1.+f7);    if size.work >= minimum size then
30553 103940       jl.        n1.    ;      skip;
30554 103942  n1 = k-2               ; (stepping stone)
30555 103942       jl.        n5.    ;    goto <illegal size  or  file descr>;
30556 103944  n5 = k-2               ; (stepping stone)
30557 103944  
30557 103944  
30557 103944  
30557 103944  ; move tail and test new size
30558 103944  ;
30559 103944  ;   if the old entry was a file-descriptor, it must still stay so
30560 103944  ;   if the old entry was an area          , it must still stay so
30561 103944  ;   (i.e. the sign of size.work may not change)
30562 103944  ;
30563 103944  ; call: m89
30564 103944  ; error return: result 6, if illegal size-change
30565 103944  
30565 103944  b. h10 w.
30566 103944  
30566 103944  m89:                   ; move tail and test new size:
30567 103944       rl. w0     d1.+f7 ;
30568 103946       rs. w0     h0.    ;    old size := size.work;
30569 103948  
30569 103948       jl. w3     m105.  ;    move tail.sender to tail.work;
30570 103950  
30570 103950       rl. w0     d1.+f7 ;    if sign (newsize)
30571 103952       lx. w0     h0.    ;     = sign (oldsize) then
30572 103954       sl  w0     0      ;
30573 103956       jl.        n0.    ;      next instruction;
30574 103958  
30574 103958       jl.        j6.    ;    goto result 6;  (i.e. illegal size-change)
30575 103960  j6=k-2
30576 103960  
30576 103960  h0:  0                 ; old size
30577 103962  
30577 103962  e.                     ;
30578 103962  
30578 103962  
30578 103962  
30578 103962  ; slice.work := 0
30579 103962  ;
30580 103962  ; call: m90
30581 103962  
30581 103962  m90:                   ; clear first slice.work:
30582 103962       al  w0     0      ;
30583 103964       hs. w0     d1.+f4 ;    first slice.work := 0;
30584 103966       jl.        n0.    ;    next instruction;
30585 103968  
30585 103968  
30585 103968  
30585 103968  ; compute docnumber
30586 103968  ;
30587 103968  ;   first slice.work := docnumber of curdoc
30588 103968  ;   if old firstslice was neither 0 nor docnumber then error
30589 103968  ;
30590 103968  ; call: m91
30591 103968  ; exit: w2 = unchanged
30592 103968  ; error return: result 5, if illegal document-change
30593 103968  
30593 103968  b. h10 w.
30594 103968  
30594 103968  m91:                   ; compute docnumber:
30595 103968       rl. w1     d4.    ;    w1 := curdoc;
30596 103970       rl  w1  x1+f60    ;    docnumber := (claimsrel.curdoc
30597 103972       al  w1  x1-a46    ;               - start of claimrel)
30598 103974       al  w0     0      ;               / number of keys;
30599 103976       wd. w1     h0.    ;
30600 103978       al  w1  x1-2048   ;
30601 103980       bl. w0     d1.+f4 ;    oldnumber := first slice.work;
30602 103982       hs. w1     d1.+f4 ;    first slice.work := docnumber + auxcat-mark;
30603 103984  
30603 103984       se  w0     0      ;    if only in maincat
30604 103986       sn  w0  x1        ;    or still in same auxcat then
30605 103988       jl.        n0.    ;      next instruction;
30606 103990  
30606 103990       jl.        j5.    ;    goto result 5;  (i.e. illegal document-change)
30607 103992  h0:  (:a110+1:)<1      ; number of keys * 2 (=max cat key +1 *2)
30608 103994  
30608 103994  e.                     ;
30609 103994  
30609 103994  
30609 103994  
30609 103994  
30609 103994  ; the following set of routines all perform the different moves
30610 103994  ;   between sender and procfunc:
30611 103994  ;
30612 103994  ; they all have a common call- and return-sequence:
30613 103994  ;
30614 103994  ; call: m<number>
30615 103994  
30615 103994  m100:am         e90-e95; move name.sender to name.work;
30616 103996  m101:am         e95-e96; move name.work   to name.sender;
30617 103998  m102:am         e96-e70; move name.work + nametable address to name etc.sender
30618 104000  m103:am         e70-e85; move newname.sender to/name.work;
30619 104002  m104:am         e85-e72; move docname.sender to docname.work;
30620 104004  m105:am         e72-e80; move tail.sender to tail.work;
30621 104006  m106:am         e80-e73; move tail.work   to tial.sender;
30622 104008  m107:am         e73-e81; move entry.sender to entry.work;
30623 104010  m108:am         e81-e92; move entry.work   to entry.sender;
30624 104012  m109:am         e92-e24; move chainhead.sender to entry.work;
30625 104014       jl.        e24.   ;
30626 104016  
30626 104016  ; redefinition of variables
30627 104016  l101 : d1     ; work
30628 104018  l102 : d2     ; sender proc
30629 104020  l111 : d11    ; cur proc name table address
30630 104022  l114 : d14    ; internal
30631 104024  l115 : d15    ; end chain
30632 104026  l116 : d16    ; answer area
30633 104028  l131 : d16+2  ; 
30634 104030  
30634 104030  
30634 104030  
30634 104030  ; check any area processes
30635 104030  ;
30636 104030  ;   all area processes are scanned, and it is tested that no internal
30637 104030  ;     processes (except procfunc itself) are users of area processes
30638 104030  ;     belonging to curdoc. (of course procfunc has a single one, the
30639 104030  ;     auxcat area process).
30640 104030  ;   notice that pseudo processes share the same area, but no process
30641 104030  ;     can be user of a pseudo process
30642 104030  ;
30643 104030  ; call: m115
30644 104030  ; error return: result 5, if any processes has area processes on curdoc
30645 104030  b. g10,h5 w.
30646 104030  m115:                  ;  check any area process;
30647 104030       rl  w2     b5     ;  w2:=first addr in nametable;
30648 104032       jl.        g0.    ;
30649 104034  g1:
30650 104034  g2:  rl. w2     h0.    ;
30651 104036       al  w2  x2+2      ;  w2:=next in nametable
30652 104038  g0:  sn  w2    (b6)    ;  if upper limit in namtable is exceeded
30653 104040       jl.        n0.    ;  then goto next instruction;
30654 104042       rs. w2     h0.    ;
30655 104044       rl  w2  x2        ;  w2:=addr(next extproc);
30656 104046       rl  w1         (b6)   ;  w1:=addr(procfunc process description);
30657 104048       jl. w3     e64.   ;  test users and reserver;
30658 104050       sn  w3     0      ;  if no users then
30659 104052       jl.        g2.    ;  goto next extproc;
30660 104054  
30660 104054  ; an area process was found in use.
30661 104054  ; first test whether it is a file-descriptor-process or an area-process
30662 104054  
30662 104054       rl  w1  x2+a61    ;    w3 := size.proc;
30663 104056       sh  w1    -1      ;    if size < 0 then
30664 104058       jl.        g3.    ;      goto file-descriptor;
30665 104060  
30665 104060  ; it was an area: test the document-name
30666 104060       so  w3     f22    ; if not any other users then
30667 104062       jl.        g1.    ; goto next area
30668 104064       rl. w3     d4.    ;    w3 := curdoc;
30669 104066       dl  w1  x3+f61+2  ;
30670 104068       sn  w0 (x2+a62+0) ;    if docname.proc <> docname.curdoc then
30671 104070       se  w1 (x2+a62+2) ;
30672 104072       jl.        g1.    ;      goto next area;
30673 104074       dl  w1  x3+f61+6  ;
30674 104076       sn  w0 (x2+a62+4) ;
30675 104078       se  w1 (x2+a62+6) ;
30676 104080       jl.        g1.    ;
30677 104082  
30677 104082       jl.        j5.    ;    goto result 5;  (i.e. other users)
30678 104084  
30678 104084  g3:                    ; file-descriptor:
30679 104084       rl  w3  x2+a60    ;    w3 := first slice.proc;
30680 104086       sn  w3     0      ;    if first slice = 0 then
30681 104088       jl.        g2.    ;      goto next area;  (i.e. maincat entry)
30682 104090  
30682 104090       am        (b22)   ;    if docnumber (entry) <> docnumber (curdoc) then
30683 104092       rl  w3  x3-2048   ;
30684 104094       se. w3    (d4.)   ;
30685 104096       jl.        g2.    ;      goto next area;
30686 104098  
30686 104098       jl.        j5.    ;    goto result 5;  (i.e. entry in auxcat.curdoc)
30687 104100  h0:  0                 ;  addr in name table;
30688 104102  
30688 104102  e.                     ;
30689 104102  
30689 104102  
30689 104102  
30689 104102  ; prepare catalog scan
30690 104102  ;
30691 104102  ; call: m116
30692 104102  b. h2 w.
30693 104102  m116:                  ; *** note: the following should be removed in a later
30694 104102                         ;           release;
30695 104102       rl. w2     d4.    ; if size.catalog < = 512 segments then
30696 104104       zl  w1  x2+f68    ; if state = ready then begin
30697 104106       se  w1      t3    ;
30698 104108       jl.         h0.   ;
30699 104110       rl  w1  x2+f57    ; change format of chainhead ;
30700 104112       sl  w1    513     ; * set old format *
30701 104114       jl.        h0.    ; first slice of chaintable chain
30702 104116       al  w0      0     ; := 0
30703 104118       hs  w0  x2+f67    ; * now the disc can be used with 
30704 104120       zl  w0  x2+f53    ; * a monitor release older than 9.0
30705 104122       lx. w0     h2.    ; *
30706 104124       hs  w0  x2+f53    ; *
30707 104126       al  w0     t4     ; * state.curdoc := during delete;
30708 104128       hs  w0  x2+f68    ; * this is done to signal no error return in
30709 104130                         ; * case of io errors
30710 104130       jl. w3     e2.    ; * 
30711 104132                         ; ***
30712 104132  
30712 104132  h0  :                  ; prepare catscan:
30713 104132       al  w0     0      ;
30714 104134       rl. w2     d4.    ;
30715 104136       rs  w0  x2+f70    ; scanned segment := 0
30716 104138                         ; (use NTA.catalog area process as work variable)
30717 104138       jl.        n0.    ;    next instruction;
30718 104140  h2:  1<4               ; new drum - disc bit
30719 104142    e.
30720 104142  
30720 104142  
30720 104142  
30720 104142  
30720 104142  ; test more catalog segments
30721 104142  ;
30722 104142  ;   curkey is increased, and compared to size.maincat.
30723 104142  ;   if more segments then goto ...
30724 104142  ;
30725 104142  ; call: m117, <more segments addr>
30726 104142  ; error return: goto-action 1, if more segments in main catalog
30727 104142  
30727 104142  m117:                  ; test more catalog segments:
30728 104142       rl. w2     d4.    ;
30729 104144       al  w0     1      ;
30730 104146       wa  w0  x2+f70    ; increase segment.curdoc
30731 104148       rs  w0  x2+f70    ;
30732 104150  
30732 104150       rl. w2     d5.    ;
30733 104152       se  w0 (x2+f57)   ;   if curkey <> number of segments in maincat then
30734 104154       jl.        n5.    ;      goto <more segments>;
30735 104156       jl.        n1.    ;    skip;
30736 104158  
30736 104158  
30736 104158  
30736 104158  ; for all curkey.curdoc entries do
30737 104158  ;
30738 104158  ;   all entries, with key.entry = curkey, in main catalog are scanned
30739 104158  ;   when all entries are examined then goto <no more>, else continue
30740 104158  ;
30741 104158  ; call: m118, <no more addr>
30742 104158  ;       w2 = entry
30743 104158  ;       ...
30744 104158  ;       <actions for entries with key.entry = curkey>
30745 104158  ;       ...
30746 104158  ;       m119
30747 104158  ;
30748 104158  ; error return: result 2, if catalog io-error
30749 104158  ;               goto-action 1, when no more entries to examine
30750 104158  
30750 104158  b. g10, h10 w.
30751 104158  
30751 104158  m118:                  ; for all curkey entries do:
30752 104158       al  w0     0      ;
30753 104160       rs. w0     h0.    ;    entry-change := 0;
30754 104162  
30754 104162       rl. w2     d4.    ;    w2 := curdoc;
30755 104164       rl  w2  x2+f70    ; segment := cur segment.curdoc
30756 104166       jl. w3     e14.   ;    for all key entries do
30757 104168       jl.        n5.    ;+2:  no more: goto <no more>;
30758 104170  
30758 104170  ; w2 = entry
30759 104170  ; w3 = continue search
30760 104170       rs. w2     h1.    ;    save (entry);
30761 104172       am         n25-n35;    call (second instruction);
30762 104174  n25 = k-2              ; (stepping stone)
30763 104174  
30763 104174  
30763 104174  
30763 104174  ; endfor
30764 104174  ;
30765 104174  ;   continues with the previous for-procedure
30766 104174  ;
30767 104174  ; call: m119
30768 104174  
30768 104174  m119:                  ; endfor:
30769 104174       am         n35-e14;    goto return;
30770 104176       jl.        e14.   ;
30771 104178  
30771 104178  
30771 104178  
30771 104178  ; multi-delete entry
30772 104178  ;
30773 104178  ;   the current entry is deleted, and entrycount is prepared for later update
30774 104178  ;
30775 104178  ; call: w3 = return
30776 104178  ;       m120
30777 104178  ; exit: w2 = entry address
30778 104178  
30778 104178  m120:                  ; multi-delete entry:
30779 104178       rl. w2     h1.    ;    restore (entry);
30780 104180       al  w0    -1      ;
30781 104182       rs  w0  x2+f4     ;    first word.entry := -1;
30782 104184       wa. w0     h0.    ;
30783 104186       rs. w0     h0.    ;    decrease (entry count change);
30784 104188       jl.        e9.    ;    prepare update
30785 104190                         ;      and return;
30786 104190  
30786 104190  
30786 104190  
30786 104190  ; update entry-count
30787 104190  ;
30788 104190  ;   in case any entries have been multi-deleted then the key-segment
30789 104190  ;     will have its entry-count updated
30790 104190  ;
30791 104190  ; call: m121
30792 104190  ; error return: result 2, if catalog io-error
30793 104190  
30793 104190  m121:                  ; update entry-count:
30794 104190       rl. w0     h0.    ;
30795 104192       sn  w0     0      ;    if entry-count change = 0 then
30796 104194       jl.        n0.    ;      next instruction;
30797 104196  
30797 104196       rl. w2     d4.    ;
30798 104198       rl  w2  x2+f70    ;    segment := cur segment.curdoc
30799 104200       jl. w3     e5.    ;    get catalog segment;
30800 104202  
30800 104202  ; w2 = start of catalog buffer
30801 104202       rl. w0     h0.    ;    change entry count and prepare update;
30802 104204       jl. w3     e8.    ;
30803 104206  
30803 104206       jl.        n0.    ;    next instruction;
30804 104208  
30804 104208  h0 : 0                 ; entry-count change
30805 104210  h1 : 0                 ; entry
30806 104212  
30806 104212  e.                     ;
30807 104212  
30807 104212  
30807 104212  
30807 104212  ; check entry on document
30808 104212  ;
30809 104212  ;   tests whether the current entry belongs to curdoc
30810 104212  ;
30811 104212  ; call: w2 = entry
30812 104212  ;       m122, <not on doc addr>
30813 104212  ; error return: goto-action 1, if entry does not belong to curdoc
30814 104212  
30814 104212  b. g10 w.
30815 104212  
30815 104212  m122:                  ; check entry on document:
30816 104212       rl. w3     d4.    ;    w3 := curdoc;
30817 104214       rl  w0  x2+f7     ;
30818 104216       sh  w0    -1      ;    if size.entry < 0 then
30819 104218       jl.        g2.    ;      goto file-descriptor;
30820 104220  
30820 104220       dl  w1  x2+f11+2  ;
30821 104222       sn  w0 (x3+f61+0) ;    if docname.entry <> docname.curdoc then
30822 104224       se  w1 (x3+f61+2) ;
30823 104226       jl.        n5.    ;      goto <not on document>;
30824 104228       dl  w1  x2+f11+6  ;
30825 104230       sn  w0 (x3+f61+4) ;
30826 104232       se  w1 (x3+f61+6) ;
30827 104234       jl.        n5.    ;
30828 104236  
30828 104236       jl.        n1.    ;    skip;
30829 104238  
30829 104238  g2:                    ; file-descriptor:
30830 104238       bz  w1  x2+f4     ;    w1 := first slice.entry;
30831 104240       sn  w1     0      ;    if either maincat-entry
30832 104242       jl.        n5.    ;
30833 104244       am        (b22)   ;    or docnumber.entry <> docnumber.curdoc then
30834 104246       se  w3 (x1-2048)  ;
30835 104248       jl.        n5.    ;      goto <not on document>;
30836 104250  
30836 104250       jl.        n1.    ;    skip;
30837 104252  
30837 104252  e.                     ;
30838 104252  
30838 104252  
30838 104252  
30838 104252  ; for all existing chaintables do
30839 104252  ;
30840 104252  ;   all chaintables, including maincat-pseudochain, are scanned.
30841 104252  ;   when all tables are tested, then goto <no more>, else continue
30842 104252  ;
30843 104252  ; call: m123, <no more addr>
30844 104252  ;       work = chainhead
30845 104252  ;       w2 = work
30846 104252  ;       ...
30847 104252  ;       <actions for chaintable>
30848 104252  ;       ...
30849 104252  ;       m119
30850 104252  ;
30851 104252  ; error return: goto-action 1, when no more chaintables
30852 104252  
30852 104252  b. g10, h10 w.
30853 104252  
30853 104252  m123:                  ; for all existing chaintables do:
30854 104252       rl  w1     b22    ;
30855 104254       al  w1  x1-2      ;    cur chain entry := base of chains in name table;
30856 104256  
30856 104256       rl. w2     d5.    ;    chain := maincat pseudo chain;
30857 104258  
30857 104258  g1:                    ; exit with chain:
30858 104258       rs. w1     h0.    ;    save (cur chain entry);
30859 104260       al  w2  x2-f0     ;
30860 104262       al. w1     d1.    ;    move chainhead.chain to work;
30861 104264       jl. w3     e33.   ;
30862 104266  
30862 104266       al. w2     d1.    ;    w2 := work;
30863 104268       jl. w3     n25.   ;    call (second instruction);
30864 104270  
30864 104270  ; when action m119 has been executed, then proceed here:
30865 104270  
30865 104270       rl. w1     h0.    ;    restore (cur chain entry);
30866 104272  g2:                    ; next chain:
30867 104272       al  w1  x1+2      ;    increase (cur chain entry);
30868 104274       sn  w1    (b24)   ;    if all chain are tested then
30869 104276       jl.        n5.    ;      goto <no more>;
30870 104278  
30870 104278       rl  w2  x1        ;    chain := name table (cur chain entry);
30871 104280       rl  w3  x2+f61    ;
30872 104282       se  w3     0      ;    if docname(0).chain <> 0 then
30873 104284       jl.        g1.    ;      goto exit with chain;  i.e. chain exists
30874 104286       jl.        g2.    ;    goto next chain;  i.e. chain was idle;
30875 104288  
30875 104288  h0 : 0               ; cur chain entry
30876 104290  
30876 104290  e.                     ;
30877 104290  
30877 104290  
30877 104290  
30877 104290  ; goto
30878 104290  ;
30879 104290  ; call: m125, <next address>
30880 104290  
30880 104290  m125:                  ; goto:
30881 104290       jl.        n5.    ;    goto <next address>;
30882 104292  
30882 104292  
30882 104292  
30882 104292  ; return
30883 104292  ;
30884 104292  ; call: m126
30885 104292  
30885 104292  m126:                  ; return:
30886 104292       am         n30-n31;    return;
30887 104294  
30887 104294  
30887 104294  
30887 104294  ; skip-return
30888 104294  ;
30889 104294  ; call: m127
30890 104294  
30890 104294  m127:                  ; skip-return:
30891 104294       am         n31-n33;    skip-return;
30892 104296  
30892 104296  
30892 104296  
30892 104296  ; goto-return
30893 104296  ;
30894 104296  ; call: m128
30895 104296  
30895 104296  m128:                  ; goto-return:
30896 104296       am        -2048   ;
30897 104298       jl.        n33.+2048;    goto-return;
30898 104300  
30898 104300  
30898 104300  
30898 104300  ; test devicenumber, user and reserver
30899 104300  ;
30900 104300  ;   it is tested that the device number is legal, and that sender
30901 104300  ;     is user of the device, and that no other processes are
30902 104300  ;     reserver
30903 104300  ;
30904 104300  ; call: m149
30905 104300  ; error return: result 2, if sender is not user of the device
30906 104300  ;               result 4, if illegal device number
30907 104300  ;               result 5, if device reserved by another process
30908 104300  
30908 104300  m149:                  ; test device,user,reserver:
30909 104300       rl. w1     d2.    ;    w1 := sender;
30910 104302       rl  w2  x1+a29    ;    devno := save w1.sender;
30911 104304  
30911 104304       ls  w2     1      ;    entry := 2 * devno
30912 104306       wa  w2     b4     ;           + first device in name table;
30913 104308       sl  w2    (b4)    ;
30914 104310       sl  w2    (b5)    ;    if entry is outside device-part of nametable then
30915 104312       jl.        j4.    ;      result 4;  (illegal device number);
30916 104314  
30916 104314       rs. w2     (l111.);    cur proc name table addr := entry;
30917 104316  
30917 104316       rl  w2  x2+0      ;    proc := nametable(entry);
30918 104318       jl. w3    e64.    ; test users and reserver
30919 104320       so  w3    f20     ; if sender not user then
30920 104322       jl.        j2.    ; deliver result 2
30921 104324       j2=k-2            ; (stepping stone)
30922 104324       sz  w3    f23     ; if other reserver then
30923 104326       jl.        j5.    ; deliver result 5
30924 104328       jl.        n0.    ; goto next instruction
30925 104330  
30925 104330  
30925 104330  
30925 104330  ; set name and interval
30926 104330  ;
30927 104330  ;   the curproc is initialized from base.work and name.work
30928 104330  ;
30929 104330  ;   in case of magtape stations, the state.proc is set too, indicating
30930 104330  ;     that the process is named
30931 104330  ;
30932 104330  ; call: m150
30933 104330  b.  g5  w.
30934 104330  
30934 104330  m150:                  ; set name and interval:
30935 104330       jl. w3     e65.   ; lock monitor
30936 104332       rl. w3     l111.  ;
30937 104334       rl  w3  (x3)      ;    w3 := proc;
30938 104336       rl. w2     l101.  ;
30939 104338       al  w2  x2+f5     ;    w2 := name of work;
30940 104340  
30940 104340       rl  w1  x3+a10    ;    w1 := kind.proc;
30941 104342       rl  w0  x3+a250   ;
30942 104344       se  w1     0      ;
30943 104346       sn  w1     64     ;    if proc.kind = external and
30944 104348       sz                ;       proc.driverproc < 0 then
30945 104350       sl  w0     0      ;    begin
30946 104352       jl.        g1.    ;      <* itc process - device driven by monitor *>
30947 104354       rl  w0  x3+a78    ;
30948 104356       se  w0     f82    ;      if proc.state <> connected then
30949 104358       jl.        j2.    ;         result(2);
30950 104360       se  w1     18     ;      if proc.kind = ida_mt then
30951 104362       jl.        g2.    ;      begin
30952 104364       rl  w0  x3+a70    ;
30953 104366       sn  w0     f89    ;        if proc.doc_state = no document mounted then
30954 104368       jl.        n0.    ;           next instruction;
30955 104370       al  w0     f87    ;        <* return ok-result but don't give the tape
30956 104372       rs  w0  x3+a70    ;           station a name - compatibility reasons *>
30957 104374                         ;        proc.doc_state := identified document mounted;
30958 104374       jl.        g2.    ;      end;
30959 104376                         ;    end;
30960 104376  g1:  se  w1     84     ;    if kind = rcnet subprocess then
30961 104378       sn  w1     85     ;
30962 104380       bz  w1  x3+a63    ;      kind := subkind.proc;
30963 104382       al  w0     0      ;
30964 104384       sn  w1     60     ;    if magtape station then
30965 104386       rs  w0  x3+a70    ;      state.proc := named;
30966 104388       se  w1     18     ;
30967 104390       sn  w1     34     ;
30968 104392       rs  w0  x3+a70    ;
30969 104394  
30969 104394  g2:  dl  w1  x2+f2-f5  ;    base.proc := base.work;
30970 104396       ds  w1  x3+a49    ;
30971 104398  
30971 104398       al  w1  x3+a11    ;    w1 := name.proc;
30972 104400       jl. w3     e32.   ;    move name.work to name.proc;
30973 104402       jl. w3     e66.   ; unlock(monitor)
30974 104404       jl.        n0.    ;
30975 104406                         ;    next instruction;
30976 104406  e.
30977 104406  
30977 104406  
30977 104406  
30977 104406  
30977 104406  
30977 104406  ; create internal process
30978 104406  ; call: w1 = parameter address
30979 104406  ;       w3 = name address
30980 104406  ; return: w0 = 0  ok
30981 104406  ;              1  storage,protection or claim trouble
30982 104406  ;              3  name overlap
30983 104406  ;              6  name illegal
30984 104406  ; parameters:  0    first core
30985 104406  ;              2    last core
30986 104406  ;              4    buf claim, area claim
30987 104406  ;              6    intern claim, func mask
30988 104406  ;              8    prot reg, prot key
30989 104406  ;             10-12 max interval
30990 104406  ;             14-16 stand interval
30991 104406  
30991 104406  b.g10
30992 104406  w.
30993 104406  m151:                ; create internal process:
30994 104406       rl. w1  (l102.) ; w1 := sender;
30995 104408       bz  w0  x1+a21  ; if internal claim.sender = 0
30996 104410       sn  w0  0       ;
30997 104412       jl.     j1.     ; then goto error 1
30998 104414       jl. w3     e76.   ;    move internal-params to work;
30999 104416       jl. w3     e44.   ;    find idle process;
31000 104418         b6              ;+2:   (from internal processes)
31001 104420       al  w1  x2+a27  ; index:= addr(ir addr.proc)
31002 104422  g1:  rs  w0  x1      ; proc descr(index):= 0
31003 104424       al  w1  x1+2    ; index:= index+2
31004 104426       se  w1  x2+a4+a47; end until index = proc descr end
31005 104428       jl.     g1.     ;
31006 104430       rl. w1  l101.   ;
31007 104432       al  w1  x1+f6   ;
31008 104434       dl  w0  x1+2    ;
31009 104436       la. w3  g6.     ;
31010 104438       la. w0  g6.     ;
31011 104440       ds  w0  x2+a18  ; move first and last core
31012 104442       dl  w0  x1+6    ;
31013 104444       ds  w0  x2+a21  ; move claims and function mask
31014 104446       rl  w3  x1+8    ; move protection reg and mask
31015 104448       rl. w0  c5.     ; 
31016 104450       ds  w0  x2+a26  ; move interrupt mask
31017 104452       dl  w0  x1+12   ;
31018 104454       ds  w0  x2+a44  ; move max interval
31019 104456       dl  w0  x1+16   ;
31020 104458       ds  w0  x2+a45  ; move stand interval
31021 104460       ds  w0  x2+a43  ; set catalog base
31022 104462       rl. w1  (l102.) ; w1 := sender
31023 104464       dl  w0  x2+a44  ; test max base:
31024 104466       sh  w0  x3-1    ; if lower.max.proc > upper.max.proc
31025 104468       jl.     j1.     ; then goto error 1
31026 104470       bs. w0  1       ;
31027 104472       sl  w3 (x1+a44-2; if lower.max.proc < lower.max.sender
31028 104474       sl  w0 (x1+a44) ; or upper.max.proc > upper.max.sender
31029 104476       jl.     j1.     ; then goto error 1
31030 104478       dl  w0  x2+a45  ; test standard base:
31031 104480       sh  w0  x3-1    ;
31032 104482       jl.     j1.     ;
31033 104484       bs. w0  1       ;
31034 104486       sl  w3 (x1+a45-2;
31035 104488       sl  w0 (x1+a45) ;
31036 104490       jl.     j1.     ;
31037 104492  
31037 104492       dl  w0  x1+a182   ;   initial,current (cpa, base) (child)
31038 104494       ds  w0  x2+a172   ;     := current cpa,base (sender);
31039 104496       ds  w0  x2+a182   ;
31040 104498  
31040 104498  ; the following is just an ad hoc solution for determining the writing priviliges:
31041 104498       bz  w0  x2+a25    ;   if pk(child) = 0 then
31042 104500       se  w0     0      ;     begin
31043 104502       jl.        g8.    ;
31044 104504  
31044 104504       al  w3     a398   ;     lower write limit := if RC9000 then 0 else 8;
31045 104506       rl  w0     b12    ;     top   write limit := core size;
31046 104508       rl. w1     g10.   ;     interrupt levels := standard;
31047 104510       jl.        g9.    ;     end
31048 104512  g8:                    ;   else begin
31049 104512       dl  w0  x2+a18    ;     lower write limit := first of process + base;
31050 104514       wa  w3  x2+a182   ;     top   write limit := top   of process + base;
31051 104516       wa  w0  x2+a182   ;
31052 104518       sh  w0  x3        ;     if base is so extreme that process wraps around then
31053 104520       jl.        j1.    ;       goto result 1;
31054 104522       sh  w0    (b12)   ;     if limits gets outside relevant part of core then
31055 104524       sh  w3     8-1    ;
31056 104526       jl.        j1.    ;       goto result 1;
31057 104528  
31057 104528       rl  w1  x1+a185   ;     interrupt levels := current interrupt levels(sender);
31058 104530  g9:                    ;     end;
31059 104530       ds  w0  x2+a184   ;   initial,current write-limits := limits;
31060 104532       ds  w0  x2+a174   ;
31061 104534       rs  w1  x2+a185   ;   initial,current interrupt levels := interrupt levels;
31062 104536       rs  w1  x2+a175   ;
31063 104538       rl. w1  (l102.)   ;   restore sender;
31064 104540  
31064 104540       rl  w3  x1+a22  ; 
31065 104542       bz  w0  x2+a22  ; if function mask.proc
31066 104544       so  w3 (0)      ;    is not subset of mask.sender
31067 104546       jl.     j1.     ; then goto error 1
31068 104548  g2:  dl  w0  x2+a18  ;
31069 104550  c.(:a399>23a.1:)-1
31070 104550       sz  w0  8.3777  ; if lower limit mod 2k<>0 then
31071 104550       jl.     j1.     ;   goto error 1
31072 104550       sz  w3  8.3777  ; if upper limit mod 2k<>0 then
31073 104550       jl.     j1.     ;   goto error 1
31074 104550  z.
31075 104550       sl  w3 (x1+a17) ; if first core.proc < first core.sender
31076 104552       sh  w0  x3      ; or last core.proc <= first core.proc
31077 104554       jl.     j1.     ; then goto error 1
31078 104556       sh  w0 (x1+a18) ; if last core.proc > last core.sender
31079 104558       jl.     g3.     ;
31080 104560       jl.     j1.     ; then goto error 1
31081 104562  g3:  rs  w3  x2+a33  ; ic.proc := first core.proc;
31082 104564       zl  w0  x1+a19  ; if buf claim > buf claim.sender
31083 104566       zl  w3  x2+a19  ; 
31084 104568       ws  w0       6  ;
31085 104570       sh  w0      -1  ;
31086 104572       jl.         j1. ; then goto error 1;
31087 104574       rs. w0      g0. ;
31088 104576       zl  w3  x1+a20  ; if area claim > area claim.sender
31089 104578       zl  w0  x2+a20  ;
31090 104580       ws  w3       0  ;
31091 104582       sh  w3      -1  ; 
31092 104584       jl.         j1., j1=k-2 ; then goto error 1;
31093 104586       rl. w0      g0. ;
31094 104588       ls  w0      12  ;
31095 104590       lo  w0       6  ; w0 = parrents new buf,area claims
31096 104592       rs. w0      g0. ;
31097 104594                       ;
31098 104594       zl  w3  x2+a21  ; if internal claim > internal claim.sender -1 
31099 104596       ac  w3  x3+1    ;
31100 104598       zl  w0  x1+a21  ;
31101 104600       wa  w3       0  ;
31102 104602       sh  w3      -1  ; then goto error 1
31103 104604       jl.         j1. ;
31104 104606       hs  w3  x1+a21  ; sender.internal claim := adjusted internal claims;
31105 104608       rl. w0      g0. ; sender.buf,area claim := adjusted buf,area claims;
31106 104610       rs  w0  x1+a19  ;
31107 104612       rs  w1  x2+a34  ; parent.proc:= sender
31108 104614       dl  w0  b13+2   ;
31109 104616       ds  w0  x2+a38+2; start run.proc:= time
31110 104618       al  w0  f47     ; stop count.proc:= 0
31111 104620       rs  w0  x2+a13  ; state.proc:= wait start parent
31112 104622       al  w0  0       ; save area.proc := 0;
31113 104624       rs  w0  x2+a302 ;
31114 104626       rl  w0  x1+a301 ; priority.proc := priority.sender;
31115 104628       rs  w0  x2+a301 ;
31116 104630       jl.     n0.     ; goto next instruction
31117 104632  g5:  8.7400 7770     ;
31118 104634  g6:  8.7777 7776     ;
31119 104636  g10: 6 < 12 + b54      ; standard interrupt levels, used by drivers etc
31120 104638  g0:  0               ; save parent adjusted buf and area claims;
31121 104640  e.                   ;
31122 104640  
31122 104640  
31122 104640  ; start internal process(name);
31123 104640  ;   follows the process tree starting with the process given by name.work
31124 104640  ;   which must be a child of the sender (otherwise: error 3); if the state
31125 104640  ;   of the child is not waiting for start by parent nothing will be done at all.
31126 104640  ;   if ok then the child and all the decendants with state = waiting for
31127 104640  ;   for start by ancestor found by following the tree are treated as follows:
31128 104640  ;      the protection key is set on the whole process area, the description
31129 104640  ;   address of the processes are chained together via wait address with end
31130 104640  ;   chain holding the address of the last process.
31131 104640  ;   when the tree is exhausted then the chain is followed in disabled mode
31132 104640  ;   and each process is entered in the timer queue, its state is set to run-
31133 104640  ;   ning and stop count for its parent is increased by one.
31134 104640  
31134 104640  b.   g5                     ; begin
31135 104640  w.                          ; start internal process:
31136 104640  
31136 104640  m152:                 ;
31137 104640       jl. w3   e17.          ;   first proc (proc addr, new state);
31138 104642  
31138 104642  g0:  bz  w0  x3+a13         ; treat next:  disable;
31139 104644       se  w0  x2+f41         ;   if state.proc addr = new state + no stop bit
31140 104646       jl.      g1.           ;   then begin enable;
31141 104648       jl. w3   e18.          ;   chain and add children;
31142 104650  
31142 104650  g1:  jl. w3   e20.          ; next process;
31143 104652       jl.      g0.           ;   if more then goto treat next;
31144 104654  ; tree exhausted. now start all the processes:
31145 104654  
31145 104654       rl. w3   (l115.)       ;   proc := end chain;
31146 104656       jd       1<11+58       ;   start the whole chain; (special instruction)
31147 104658       jl.     (2), j0        ;   goto exit ok;
31148 104662  j0 = k-4  ; stepping stone
31149 104662  
31149 104662  e.                          ; end start internal process;
31150 104662  
31150 104662  ; stop internal process (name,buf,result);
31151 104662  ;   follows the process tree, starting with the process given by name.
31152 104662  ;   work, of those processes which are not waiting for stop or already
31153 104662  ;   stopped.
31154 104662  ;      each of these processes is treated, in disabled mode, as follows:
31155 104662  ;   if it is in a queue then it is removed from that queue,
31156 104662  ;   if it is in a waiting state then the instruction counter is decreased
31157 104662  ;   by 2 so that the original monitor call will be repeated when it is
31158 104662  ;   restarted.
31159 104662  ;   if stop count is zero then the state is set to:  if the process is
31160 104662  ;   the direct child of the sender, i.e. the first process treated, then
31161 104662  ;   wait start by parent, else wait start by ancestor; and stop count
31162 104662  ;   for the parent is decreased by one, possibly stopping the parent.
31163 104662  ;   if stop count is not zero then state is set to wait stop by parent
31164 104662  ;   or wait stop by ancestor as above.
31165 104662  ;     when the states of all the processess involved are set, the stop count
31166 104662  ;   of the process given by name.work is inspected. if the count is zero, thus
31167 104662  ;   indicating that the processes are effectively stopped, then a normal answer
31168 104662  ;   (result = 1) is send to the calling process.
31169 104662  
31169 104662  b.   g10,  i5                   ; begin
31170 104662  w.                        ; stop internal process:
31171 104662  
31171 104662  m153:                 ;
31172 104662       jl. w3   e17.        ;   first proc (proc addr, new state);
31173 104664       ds. w3      (l131.)     ;   save (new state, proc);
31174 104666  
31174 104666  ; prepare the message buffer for returning the answer
31175 104666       bz  w0  x1+a19         ;   decrease(bufclaim(sender));
31176 104668       bs. w0   1             ;   (it has already been tested that
31177 104670       hs  w0  x1+a19         ;    the claim is present).
31178 104672       jl. w3     e65.         ;   lock monitor
31179 104674  
31179 104674       rl  w2   b8            ;   buf := next(mess buf pool);
31180 104676       jl  w3   b35           ;   remove(buf);
31181 104678       rl  w0     (b6)
31182 104680  
31182 104680       ac  w0   (0)            ;   receiver(buf) := -procfunc; i.e. let procfunc claim it.
31183 104682       ds  w1  x2+6           ;   sender(buf) := sender;
31184 104684       rl  w0  x1+a30         ; 
31185 104686       rs  w0  x2+a139        ; mess.flag=saved w2
31186 104688  
31186 104688       rs  w2  x1+a30         ;   save w2(sender) := buf;
31187 104690  
31187 104690       rl. w3     (l131.)       ;   w3 := proc;
31188 104692       rs  w2  x3+a40         ;
31189 104694       rl. w2     (l116.)     ;   w2 := new state;
31190 104696  
31190 104696  g0:  bz  w0  x3+a13       ; treat next:  disable;
31191 104698       sz  w0   f43         ;   state.w0:= state.proc;
31192 104700       jl.      g3.         ;   if -, stopped bit (state.w0) then
31193 104702  
31193 104702       hs  w2  x3+a13       ;   begin
31194 104704       rl  w2  x3+a33       ;   state.proc:= new state;
31195 104706       al  w2  x2-2         ;   if repeat bit (state.w0) then
31196 104708       sz  w0   f40         ;   ic.proc:= ic.proc - 2;
31197 104710       rs  w2  x3+a33       ;
31198 104712  
31198 104712       al  w2  x3+a16       ; 
31199 104714       sz  w0   f44         ;   if out of queue bit (state.w0)
31200 104716       jl  w3   b35         ;   then remove (proc);
31201 104718       al  w3  x2-a16       ;
31202 104720  
31202 104720  g1:  rl  w2  x3+a12       ; loop stop:
31203 104722       sz. w2  (c7.)        ;   if stop count.proc = 0 and
31204 104724       jl.      g2.         ;   -, no stop bit (state.proc) then
31205 104726  
31205 104726       al  w2  x2+f41       ;   begin
31206 104728       hs  w2  x3+a13       ;   state.proc:= state.proc + no stop bit;
31207 104730       rl  w3  x3+a34       ;   proc:= parent.proc;
31208 104732       bz  w2  x3+a12       ;   stop count.proc:=
31209 104734       al  w2  x2-1         ;   stop count.proc - 1;
31210 104736       hs  w2  x3+a12       ;   goto loop stop;
31211 104738       jl.      g1.         ;   end;
31212 104740  
31212 104740  g2:  jl. w3   e19.        ;   add children;
31213 104742       se  w2  0         ;  if delta > 0 then
31214 104744       jl. w3  g5.       ;     stop itc-io messages;
31215 104746                            ;  end;
31216 104746  
31216 104746  g3:  jl. w3   e20.        ;     next proc (proc, newstate);
31217 104748       jl.      g0.         ;   if more then goto treat next;
31218 104750       jl. w3     e66.      ; unlock monitor
31219 104752       rl. w3   (l131.)     ; no more:unsave proc;
31220 104754       al. w1   (l116.)     ;   if stop count.proc = 0 then
31221 104756       rl  w2  x3+a40       ;   send answer (answ addr,
31222 104758       bz  w0  x3+a12       ;   wait addr.proc,1);
31223 104760       rl  w3  (b6)
31224 104762       ac  w3  x3+0         ;
31225 104764       sn  w0    0          ; if stopcount <> 0
31226 104766       se  w3  (x2+4)       ;     or procfunc not receiver anymore
31227 104768                        ;     i.e. a driver may have used ...decrease stopcount...
31228 104768       jl.      j0.         ; then goto exit ok
31229 104770       ac  w3  x3+0         ;
31230 104772       bz  w0  x3+a19       ; bufclaim.procfunc
31231 104774       bs. w0    1          ; - 1
31232 104776       hs  w0  x3+a19       ; =: bufclaim.procfunc
31233 104778       al  w0    1          ;
31234 104780       jd     1<11+22       ; send answer
31235 104782       jl.      j0.         ; goto exit ok
31236 104784                            ; stop itc-io messages:
31237 104784  ; w2: stopcount (justeret)
31238 104784  ; w3: link
31239 104784                            ;
31240 104784  g5:  ds. w3     i3.       ; begin
31241 104786       rs. w2     i4.       ;
31242 104788       rl  w1     b4        ;   for proc := first external, next until last do 
31243 104790       sz                   ;   begin
31244 104792  g6:  al  w1  x1+2         ;
31245 104794       sn  w1    (b5)       ;
31246 104796       jl.        g9.       ;
31247 104798       rl  w3  x1           ;
31248 104800       rl  w0  x3+a10       ;
31249 104802       rl  w2  x3+a250      ;
31250 104804       se  w0     20        ;     if proc.kind = idamain or
31251 104806       sn  w0     26        ;        proc.kind = ifpmain or
31252 104808       sz                   ;        proc.driverproc < 0 then
31253 104810       sh  w2    -1         ;     begin
31254 104812       sz                   ;
31255 104814       jl.        g6.       ;
31256 104816       rl  w2  x3+a54       ;       message := proc.eventq.first;
31257 104818  g7:  sn  w2  x3+a54       ;       while message <> none do
31258 104820       jl.        g6.       ;       begin
31259 104822       rl  w0  x2+a142      ;
31260 104824       rs. w0     i6.       ;
31261 104826       rl. w0    (l114.)    ;
31262 104828       se. w0    (i6.)      ;         if message.sender = internal and
31263 104830       jl.        g8.       ;            message.operation = io then
31264 104832       zl  w0  x2+a138+1    ;         begin
31265 104834       so  w0     2.1       ;
31266 104836       jl.        g8.       ;
31267 104838       rl  w0  x2+a140      ;
31268 104840       jd      1<11+130     ;           stop itc-io message(message);
31269 104842       al  w2     (0)       ;
31270 104844       rl. w0     i4.       ;           saved stopcount := 
31271 104846       bs. w0     1         ;           saved stopcount - 1;
31272 104848       sn  w0     0         ;           if saved stopcount = 0 then
31273 104850       jl.        g9.       ;              goto out;
31274 104852       rs. w0     i4.       ;
31275 104854       jl.        g7.       ;         end;
31276 104856  g8:                       ;
31277 104856       rl  w2  x2+a140      ;         message := message.next;
31278 104858       jl.        g7.       ;       end  * while * ;
31279 104860                            ;     end  * itc process *;
31280 104860                            ;   end  * for all external *;
31281 104860  g9:  dl. w3     i3.       ;out:
31282 104862       jl      x3           ; 
31283 104864                            ;
31284 104864       0                    ; saved w2
31285 104866  i3:  0                    ; saved w3
31286 104868  i4:  0                    ; saved stopcount
31287 104870  i6:  0                    ;
31288 104872                            ; end *** regret itc io message ***;
31289 104872                            ;
31290 104872  
31290 104872  e.                        ; end stop internal process;
31291 104872  
31291 104872  ; modify internal process (name,registers);
31292 104872  ;   finds the process given by name.work and checks that it is a child of
31293 104872  ;   the sender.  if the process is waiting for start by parent then the
31294 104872  ;   given values of the registers and the instruction counter are set in
31295 104872  ;   the process description.
31296 104872  
31296 104872  b.   g5                        ; begin
31297 104872  w.                             ; modify internal process:
31298 104872  
31298 104872  m154:                 ;
31299 104872       jl. w3   e17.             ;   first proc (proc addr,new state);
31300 104874       bz  w0  x3+a13            ;   disable;
31301 104876       se  w0   f47              ;   if state.proc <> waiting for start by parent
31302 104878       jl.      j2.,j2=k-2       ;   then goto enabled error2;
31303 104880  
31303 104880  g0:                    ;
31304 104880       jl. w3     e74.   ;      move registers to tail.work;
31305 104882       rl. w1     (l114.);    w1 := child;
31306 104884       am  -2048       ;
31307 104886       al. w2     v6.+2048    ;    w2 := register area;
31308 104888  
31308 104888       al  w0    -1<1    ;
31309 104890       la  w0  x2-a28+a33;    make child ic even;
31310 104892       rs  w0  x2-a28+a33;
31311 104894  
31311 104894       sl  w0 (x1+a17)   ;    if child ic outside
31312 104896       sl  w0 (x1+a18)   ;      child process then
31313 104898       jl.        j2.    ;      goto result 2;
31314 104900  
31314 104900       rl. w3     (l102.) ;    w3 := sender;  (i.e. parent process)
31315 104902       rl  w0  x3+a32    ;    new status :=
31316 104904       lo. w0     g3.    ;      monmode.sender
31317 104906       la  w0  x2-a28+a32;    and monmode.new status
31318 104908       la. w0     g4.    ;    or  exceptionbits.new status
31319 104910  
31319 104910       rl  w3  x1+a32    ;
31320 104912       la. w3     g5.    ;    or  aritmetic interrupts.status.child;
31321 104914       lo  w3     0      ;
31322 104916  
31322 104916       rs  w3  x2-a28+a32;    status.child := new status;
31323 104918  
31323 104918       al  w0     12     ;
31324 104920       al  w1  x1+a28    ;
31325 104922       jl. w3     e31.   ;    move registers to child description;
31326 104924  
31326 104924       jl.        j0.    ;   return ok;
31327 104926  
31327 104926  g3:  2.111             ; exception
31328 104928  g4:  1<23+2.111        ; monitor mode + exception
31329 104930  g5:  2.11<18           ; aritmetic interrupts
31330 104932  e.                             ; end modify internal process;
31331 104932  
31331 104932  ; remove process (name);
31332 104932  ;   area process: the sender is removed as user and reserver of the
31333 104932  ;   process, possibly removing the area process (see procedure clear
31334 104932  ;   area proc).
31335 104932  ;   peripheral process: if the sender is allowed to call the function
31336 104932  ;   the peripheral process is removed if it is not reserved by another 
31337 104932  ;   process.
31338 104932  ;   internal process: if the process is a child of the sender and is
31339 104932  ;   waiting for start by parent then
31340 104932  ;   1*   the protection key is reset in the process area,
31341 104932  ;   2*   the process is removed,
31342 104932  ;   3*   the process is removed from all external processes,
31343 104932  ;   4*   all message buffers involving the removed process are cleaned
31344 104932  ;        up, so that the buffers may return to the pool,
31345 104932  ;   5*   all console buffers involving the removed process are released.
31346 104932  ;   2* to 5*  is applied to all descendants of the child in  a recursive
31347 104932  ;   way.
31348 104932  
31348 104932  b.   g25, h2                       ; begin
31349 104932  w.                             ; remove process:
31350 104932  
31350 104932  m155:jl. w3     e47.   ;    search best process in name table;
31351 104934         b3              ; (first in name table)
31352 104936         b7              ; (top   of name table)
31353 104938       jl.        e26.   ;+6:   not found:  goto test found;
31354 104940       al. w3   j0.      ;    return to ex ok;
31355 104942  
31355 104942       rl  w0  x2+a10    ; get and examine kind:
31356 104944       rl. w1    (l102.) ;    w1 := sender;
31357 104946       sn  w0     f38    ;   goto case kind of
31358 104948       jl.        e25.   ;      area: remove area(sender,proc) (return to w3)
31359 104950       sn  w0     f37    ;
31360 104952       jl.        g1.    ;      internal: 
31361 104954       sn  w0     64     ;
31362 104956       jl.        g0.    ;      pseudo process:
31363 104958       se  w0     q28    ;
31364 104960       sn  w0     q8     ;
31365 104962       jl.        g9.    ;
31366 104964       se  w0     85     ;
31367 104966       jl.        g3.    ;      peripheral process except temp link
31368 104968  g9:                    ;      temp link:
31369 104968  ; temp link:           ; begin
31370 104968       jl. w3     e56.   ;    remove user
31371 104970       jl. w3     e64.   ;    test users and reserver
31372 104972       so  w3  f22       ;    if no other users then
31373 104974       jl. w3     g7.    ;       release link
31374 104976       jl.        j0.    ; end
31375 104978  
31375 104978  ; peripheral process:  ; begin
31376 104978  g3:  
31377 104978       se  w0     q20    ; if kind = idamain or ifpmain then
31378 104980       sn  w0     q26    ;   answer ok
31379 104982       jl.        j0.    ;
31380 104984       bl  w0  x1+a22    ;    w0 := function mask.sender;
31381 104986       so  w0     f75    ;    if function not allowed then
31382 104988       jl.        j1.    ;       unlock(monitor) and goto result 1;
31383 104990       jl. w3     e65.   ;    lock(monitor)
31384 104992       jl  w3     b48    ;
31385 104994       so  w3     f20    ;    if sender not user then
31386 104996       jl.        j2.    ;       unlock(monitor) and goto result 2
31387 104998       sz  w3     f23    ;    if other reserver then
31388 105000       jl.        j5.    ;       unlock(monitor) and goto result 5
31389 105002       j5=k-2            ; (stepping stone)
31390 105002       al  w0     0      ;    name(0).proc:= 0;
31391 105004       rs  w0  x2+a11    ;    comment: now removed;
31392 105006       rs  w0  x2+a52    ;    reserved.proc:= 0;
31393 105008       jl.        j0.    ;    unlock(monitor) and goto result 1;
31394 105010                         ; end;
31395 105010  
31395 105010  ; pseudo process:      ;
31396 105010  g0:                    ; begin
31397 105010       se  w1 (x2+a50)   ;    if sender <> mainproc.pseudo process then
31398 105012       jl.        j3.    ;       goto result 3;
31399 105014       j3=k-2            ; (stepping stone)
31400 105014       rs. w2     g24.   ;    save (pseudo process);
31401 105016       jl. w3     e65.   ;    lock(monitor)
31402 105018       al  w0     0      ;    saved name := pseudo.name(0); pseudo.name(0) := 0
31403 105020       rx  w0  x2+a11    ;
31404 105022       rs. w0     g25.   ;
31405 105024       jl. w3     e66.   ;    unlock(monitor); prevent more mess to pseudo proc
31406 105026       rl  w2     b8+4   ;
31407 105028       al  w2  x2+a7     ;    for i= first buf in pool step 1 until last do
31408 105030  g22: rl. w1     g24.   ;    begin
31409 105032       ac  w3  x1        ;
31410 105034       sn  w3 (x2+4)     ;       if buf.receiver = pseudo and
31411 105036       jl.        g23.   ;           buffer claimed then
31412 105038       sn  w1 (x2+6)     ;           goto repair
31413 105040       jd      1<11+82   ;        else
31414 105042       sn  w1 (x2+4)     ;        if buf.sender = pseudo then
31415 105044       jl. w3     g12.   ;           regret message
31416 105046       wa  w2     b8+8   ;        if buf.receiver = pseudo then
31417 105048       sh  w2    (b8+6)  ;           clean buf
31418 105050       jl.        g22.   ;    end
31419 105052  
31419 105052       al  w0     0      ;    ; release pseudo proc
31420 105054       rl. w2     g24.   ;
31421 105056       rl. w1    (l102.) ;
31422 105058       rs  w0  x2+a50    ;    pseudo.mainproc= 0;
31423 105060       bz  w2  x1+a23    ;
31424 105062       al  w2  x2+1      ;    increase (pseudo claim.sender);
31425 105064       hs  w2  x1+a23    ;
31426 105066       jl.        j0.    ;    end;goto result ok;
31427 105068  
31427 105068  g23:                   ; repair:
31428 105068       dl. w2     g25.   ;   restore pseudo.name(0)
31429 105070       rs  w2  x1+a11    ;   goto result 2
31430 105072       jl.        j2.    ;
31431 105074  
31431 105074  g24: 0                 ; saved pseudo process  ,  work
31432 105076  g25: 0                 ; saved pseudo.name(0)
31433 105078  
31433 105078  ; internal process:
31434 105078  g1:                    ; begin;
31435 105078       jl. w3   e17.     ;   first proc (proc addr,--);
31436 105080       bz  w0  x3+a13    ;   if not child then goto error 3;
31437 105082       se  w0     f47    ;   if state.proc <> wait start by parent then
31438 105084       jl.        j2.    ;      goto error 2;
31439 105086       j2=k-2            ; (stepping stone)
31440 105086  g5:  al  w0     0;used ;   repeat
31441 105088       rs  w0  x3+a11    ;      proc.name(0) := 0
31442 105090       jl. w3     e18.   ;      chain and add children;
31443 105092       jl. w3     e20.   ;      next proc (proc addr,--);
31444 105094       jl.        g5.    ;   until no more descendants
31445 105096       rl. w2    (l115.) ;   proc:= end chain;
31446 105098  
31446 105098  g6:  rs. w2    (l114.) ;   save intproc
31447 105100       rl  w2     b4     ;   for extproc:= first device in name table,
31448 105102  g2:  rs. w2     g24.   ;   step 1 until last do
31449 105104       rl. w1    (l114.) ;   begin
31450 105106       rl  w2  x2+0      ;      if kind.extproc = area kind then
31451 105108       rl  w0  x2+a10    ;         remove area( intproc,extproc);
31452 105110       sn  w0     64     ;
31453 105112       se  w1 (x2+a50)   ;      if kind.extproc = pseudoproc
31454 105114       jl.        g15.   ;         and mainproc.extproc = intproc then
31455 105116       al  w0     0      ;         extproc.name(0) := 0; claims returned later
31456 105118       rs  w0  x2+a11    ;
31457 105120       jl.        g4.    ;       if intproc user of extproc then
31458 105122  g15: se  w0     f38    ;          exclude user
31459 105124       jl.        g16.   ; 
31460 105126       jl. w3     e25.   ;       if no users and extproc.kind = temp link then
31461 105128       jl.        g4.    ;          release link;
31462 105130  g16: jl. w3     e64.   ;
31463 105132       rs. w3     h0.    ;
31464 105134       sz  w3     f20    ;
31465 105136       jl. w3     e56.   ;
31466 105138       rl. w3     h0.    ;
31467 105140       so  w3     f22    ;
31468 105142       jl. w3     g7.    ;
31469 105144  
31469 105144  g4:  rl. w2     g24.   ;
31470 105146       al  w2  x2+2      ;
31471 105148       se  w2    (b6)    ;
31472 105150       jl.        g2.    ;   end;
31473 105152  
31473 105152       jl. w3     e65.   ;   lock(monitor); finis a possible send message
31474 105154       jl. w3     e66.   ;   unlock(monitor); all relevant external names are now removed
31475 105156  
31475 105156       rl  w2     b8+4   ;   ;examine all message buffers:
31476 105158       al  w2  x2+a7     ;   <start at the link field of the message>
31477 105160  g10: rl  w1  x2+4      ;
31478 105162       rl  w3  x2+6      ;   for buf:= first mess buf step 1 until last do
31479 105164       sh  w1     0      ;   begin
31480 105166       ac  w1  x1        ;      receiver= abs buf.receiver
31481 105168       rl  w0  x1+a10    ;      sender  = abs buf.sender
31482 105170       sn  w0     64     ;      if receiver = pseudoproc then
31483 105172       rl  w1  x1+a50    ;         receiver:= mainproc.reciever
31484 105174       sh  w3     0      ;      if sender = pseudoproc then
31485 105176       ac  w3  x3        ;         sender:= mainproc.sender
31486 105178       rl  w0  x3+a10    ;
31487 105180       sn  w0     64     ;
31488 105182       rl  w3  x3+a50    ;
31489 105184       rl. w0    (l114.) ;
31490 105186       sn  w3    (0)     ;
31491 105188       jd      1<11+82   ;      if intproc = buf.sender then
31492 105190       rl  w3  x2+4      ;         regret message
31493 105192       se  w1    (0)     ;      if intproc = buf.receiver 
31494 105194       jl.        g11.   ;         and buf not returned by regret then
31495 105196       se  w3     0      ;
31496 105198       jl. w3     g12.   ;         clean message
31497 105200  g11: wa  w2     b8+8   ;
31498 105202       sh  w2    (b8+6)  ;   end;
31499 105204       jl.        g10.   ;
31500 105206  
31500 105206  
31500 105206       al  w0     0      ;  ;return pseudo process claims
31501 105208       rl. w3    (l114.) ;   for pseudoproc:=first pseudoproc in name table
31502 105210       rl  w1     b5     ;   step 1 until first internal in name table do   
31503 105212  g19: rl  w2  x1+0      ;
31504 105214       se  w3 (x2+a50)   ;   begin
31505 105216       jl.        g20.   ;      if proc=mainproc.proc
31506 105218       rs  w0  x2+a50    ;      then
31507 105220       bz  w2  x3+a23    ;      begin
31508 105222       al  w2  x2+1      ;         mainproc.proc:=0;
31509 105224       hs  w2  x3+a23    ;         pseudoclaims.proc:=
31510 105226  g20: al  w1  x1+2      ;         pseudoclaims.proc+1;
31511 105228       se  w1    (b6)    ;      end
31512 105230       jl.        g19.   ;   end
31513 105232  
31513 105232       al  w2     0      ;   ; add bs claim
31514 105234       rl. w3    (l114.) ;   for i:= first claimlist in intproc step 1 until last do
31515 105236       dl  w1  x3+a21    ;   begin
31516 105238       rx  w2  x3+a34    ;      claims.parent.proc:=
31517 105240       hl. w1     g5.+1;note;   claims.parent.proc + claim.proc;
31518 105242       aa  w1  x2+a21    ;      add one to int claim.parent.proc;
31519 105244       wa. w1     c8.    ;      parent.proc:= 0;
31520 105246       ds  w1  x2+a21    ;      proc:= wait addr.proc;
31521 105248       dl  w1  x3+a36+2  ;      runtime(parent) :=
31522 105250       aa  w1  x2+a36+2  ;      runtime(parent) +
31523 105252       ds  w1  x2+a36+2  ;      runtime(child);
31524 105254       al  w1  x3+a46    ;      claims child
31525 105256       al  w2  x2+a46    ;      claims parent
31526 105258  g17: rl  w0  x2        ;      claims parant(i)
31527 105260       wa  w0  x1        ;      + claims child(i)
31528 105262       rs  w0  x2        ;      =:claims parent(i)
31529 105264       al  w1  x1+2      ;
31530 105266       al  w2  x2+2      ;
31531 105268       se  w1  x3+a4+a47 ;
31532 105270       jl.        g17.   ;   end
31533 105272       rl  w2  x3+a40    ;   intproc=intproc.wait address
31534 105274       se  w2     0      ;   if intproc <> 0 then goto remove one process else
31535 105276       jl.        g6.    ;   goto result ok;
31536 105278       jl.        j0.    ;  
31537 105280                         ; end remove process;
31538 105280  h0: 0                  ; save result from test users and reserver
31539 105282  c5:  a89               ; initial interrupt mask
31540 105284  c7:  -1<12 + f41       ; used by stop internal
31541 105286  c8:  1<12 + 0          ;
31542 105288  
31542 105288  ; release process.
31543 105288  ; this procedure releases an external process if it is of
31544 105288  ; type remote subprocess (monitor kind=85) or csp terminal process or generel sekvential device.
31545 105288  ;        call:         return:
31546 105288  ; w0                   destroyed
31547 105288  ; w1                   destroyed
31548 105288  ; w2     proc          destroyed
31549 105288  ; w3     link          destroyed
31550 105288  b.i10 w.
31551 105288  g7:  rl  w0  x2+a10    ; release process:
31552 105290       se  w0     q28    ; if generel sekvential device or
31553 105292       sn  w0     q8     ; csp terminal then
31554 105294       jl.        g8.    ;   goto disconnect device
31555 105296       se  w0     85     ;   if kind<>85 then
31556 105298       jl      x3        ;     return;
31557 105300       rs. w3     i1.    ;
31558 105302       rs. w2     i2.    ;
31559 105304       al. w1     i0.    ;   message:=release;
31560 105306       al. w3     i3.    ;   name:=<:host:>;
31561 105308  i8:  jd      1<11+16   ;   send message;
31562 105310       rl. w1     i4.    ;
31563 105312       jd      1<11+18   ;   wait answer;
31564 105314       jl.       (i1.)   ; exit: return;
31565 105316  
31565 105316  i0:  2<12+1            ; message: operation:=release, mode:=indirect addr;
31566 105318  i4:  d16               ;   dummy (answer area address)
31567 105320  i1:  0                 ;   dummy (saved return addr)
31568 105322  i2:  0       ; i0+6    ;   proc
31569 105324  
31569 105324  i3:  <:host:>,0,0,0    ;   name-constant and name table addr
31570 105334  
31570 105334  g8:  rs. w3     i1.    ;
31571 105336       rl  w0  x2+a59    ;   insert device no
31572 105338       rs. w0     i6.    ;
31573 105340       rl  w2  x2+a50    ;   w2:=main
31574 105342       al  w2  x2+2      ;
31575 105344       rl. w1     i4.    ;
31576 105346       jl. w3     e32.   ;  move name to work
31577 105348       rl. w3     i4.    ;
31578 105350       al. w1     i5.    ;  disconnect
31579 105352       jl.        i8.    ;
31580 105354  i5:  10<12+0           ;
31581 105356  i6:  0,r.4             ;
31582 105364  
31582 105364  e.
31583 105364  
31583 105364  
31583 105364  ; procedure clean to (buf);
31584 105364  ;   delivers a dummy answer <receiver does not exist> in the queue of
31585 105364  ;   the sending process (the buffer administration takes care if the 
31586 105364  ;   sender is removed).
31587 105364  ;   call:          return
31588 105364  ;   w0 -           destroyed
31589 105364  ;   w1 -           destroyed
31590 105364  ;   w2 buffer      unchanged
31591 105364  ;   w3 link        destroyed
31592 105364  
31592 105364  
31592 105364  g12: rs. w3     g14.   ; save (return);
31593 105366       jl. w3     e65.   ; lock(monitor)
31594 105368       rl  w3    (b6)    ;
31595 105370       bz  w0  x3+a19    ; bufclaim.procfunc
31596 105372       bs. w0     1      ; -1
31597 105374       hs  w0  x3+a19    ; =: bufclaim.procfunc
31598 105376       ac  w3  x3        ;
31599 105378       rx  w3  x2+4      ; receiver.buf:= -procfunc; oldreceiver= receiver.buf
31600 105380       sl  w3     0      ; if oldreceiver has claimed the buffer then
31601 105382       jl.        g13.   ; begin
31602 105384       ac  w3  x3        ;
31603 105386       rl  w0  x3+a10    ;    if receiver=pseudo proc then
31604 105388       sn  w0     64     ;    oldreceiver := pseudo.main
31605 105390       rl  w3  x3+a50    ;
31606 105392       zl  w0  x3+a19    ; bufclaim.oldreceiver
31607 105394       ba. w0     1      ;                 
31608 105396       hs  w0  x3+a19    ; =: bufclaim.oldreceiver  + 1
31609 105398  g13: jl  w3     b35    ; remove(buf)
31610 105400       jl. w3     e66.   ; unlock(monitor)
31611 105402       al. w1     0 ; here
31612 105404       al  w0     5      ;
31613 105406       jd      1<11+22   ; send answer(5,answer addr,buf)
31614 105408       jl.       (g14.)  ;
31615 105410  
31615 105410  g14: 0                 ; saved return
31616 105412  
31616 105412  e.
31617 105412  
31617 105412  
31617 105412  
31617 105412  ; copy message
31618 105412  ;
31619 105412  ; call: m156
31620 105412  ; error return: result 2, if sender.buf is stopped
31621 105412  ;               result 3, if message regretted
31622 105412  ;               result 3, if addresses.buffer illegal
31623 105412  ;               result 3, if operation.buffer neither input nor output
31624 105412  
31624 105412  b. g10, h10 w.
31625 105412  
31625 105412  m156:                  ; copy message:
31626 105412       rl. w1     (l102.);    w1 := sender;
31627 105414       rl  w3  x1+a30    ;    w3 := buf := save w2.sender;
31628 105416       rl  w2  x3+6      ;    w2 := sender.buf;
31629 105418       sh  w2    -1      ;    if sender.buf < 0 then
31630 105420       jl.        j3.    ;      result 3;  i.e. message regretted;
31631 105422       rl  w0  x2+a10    ;    if sender.buf is a pseudo process
31632 105424       sn  w0  64        ;       then sender.buf:= main(sender.buf);
31633 105426       rl  w2  x2+a50    ;
31634 105428  
31634 105428       bz  w0  x2+a13    ;    if state(sender.buf) = stopped then
31635 105430       sz  w0     a105   ;
31636 105432       jl.        j2.    ;      goto result 2;
31637 105434  
31637 105434       dl  w0  x3+12     ;    w3 := first addr.buf;  w0 := last addr.buf;
31638 105436       sl  w3 (x2+a17)   ;    if addresses outside sender-process then
31639 105438       sl  w0 (x2+a18)   ;
31640 105440       jl.        j3.    ;      goto result 3;
31641 105442       la. w3     h0.    ;
31642 105444       la. w0     h0.    ;    (make addresses even)
31643 105446       sh  w0  x3-1      ;    if last address < first address then
31644 105448       jl.        j3.    ;      goto result 3;
31645 105450  
31645 105450       ws  w0     6      ;    w0 := size of area(buf);    (less two bytes)
31646 105452       wa  w3  x2+a182   ;    w3 := abs first of area(buf);
31647 105454       ds. w0     h3.    ;    save (first addr, size);
31648 105456  
31648 105456       dl. w0     h1.    ;
31649 105458       la  w3  x1+a29    ;    w3 := first of area.sender;  (even)
31650 105460       la  w0  x1+a31    ;    w0 := last  of area.sender;  (even)
31651 105462       ws  w0     6      ;    w0 := size of area.sender;  (less two bytes)
31652 105464       wa  w3  x1+a182   ;    w3 := abs first of area.sender;
31653 105466  
31653 105466       al  w2  x3        ;    w2 := from := abs first of area.sender;
31654 105468       rl  w3  x1+a30    ;
31655 105470       bz  w3  x3+8      ;    w3 := operation.buf.sender;
31656 105472       rl. w1     h2.    ;    w1 := to   := abs first of area(buf);
31657 105474  
31657 105474       sn  w3     3      ;    if operation.buf = input then
31658 105476       jl.        g5.    ;      goto prepare move;
31659 105478       se  w3     5      ;    if operation.buf <> output then
31660 105480       jl.        j3.    ;      goto result 3;
31661 105482  h4:  rx  w2     2 ;used;    exchange (from, to);
31662 105484  
31662 105484  g5:                    ; prepare move:
31663 105484  
31663 105484  ; w0 = size of area.sender (less two)
31664 105484  ; w1 = to-address
31665 105484  ; w2 = from-address
31666 105484  
31666 105484       sl. w0    (h3.)   ;    bytes to move :=
31667 105486       rl. w0     h3.    ;      minimum (size.sender, size.buf)
31668 105488       ba. w0     h4.+1  ;      + 2;
31669 105490       rs. w0     h3.    ;    save (bytes to move);
31670 105492  
31670 105492       jl. w3     e31.   ;    move;
31671 105494  
31671 105494  ; now the data has been moved between sender-process and buffer-area
31672 105494  ; compute the number of bytes and characters transferred and deliver to
31673 105494  ;   sender-process
31674 105494  
31674 105494       rl. w2     h3.    ;    w2 := bytes moved;
31675 105496       al  w3  x2        ;
31676 105498       ls  w3    -1      ;
31677 105500       wa  w3     4      ;    w3 := chars moved;  ( = bytes * 3 / 2 )
31678 105502  
31678 105502       rl. w1    (d20.)  ;
31679 105504       rs  w2  x1+a29    ;    save w1.sender := bytes moved;
31680 105506       rs  w3  x1+a31    ;    save w3.sender := chars moved;
31681 105508  
31681 105508       jl.        j0.    ;    goto result 0;
31682 105510  
31682 105510  h0:  -1 < 1            ; mask for making even
31683 105512  h1:  -1 < 1            ; double-mask for making two words even
31684 105514  h2:  0                 ; abs first of area(buf)
31685 105516  h3:  0                 ; size of area(buf)
31686 105518                         ; (later:  bytes to move)
31687 105518  
31687 105518  e.                     ;
31688 105518  
31688 105518  
31688 105518  ; general copy
31689 105518  ;
31690 105518  ; call: m157
31691 105518  ; error return: result 2, if sender.buf is stopped
31692 105518  ;               result 3, if message regretted
31693 105518  ;               result 3, if addresses illegal
31694 105518  ;               result 3, if operation in buffer is even
31695 105518  
31695 105518  b. g10, h10 w.
31696 105518  
31696 105518  m157:                  ; general copy:
31697 105518       rl. w1  (l102.)   ;  w1:= sender
31698 105520       rl  w3  x1+a30    ;  w3:= buf:= save w2.sender
31699 105522       rl  w2  x3+6      ;  w2:= sender.buf
31700 105524       sh  w2  -1        ;  if sender.buf<0 then
31701 105526       jl.     j3.       ;  goto result3
31702 105528                         ;
31703 105528       rl  w0  x2+a10    ;    if sender.buf is a pseudo process
31704 105530       sn  w0  64        ;       then sender.buf:= main(sender.buf);
31705 105532       rl  w2  x2+a50    ;
31706 105534       bz  w0  x2+a13    ;  if state(sender.buf)=stopped then
31707 105536       sz  w0  a105      ;  goto result2
31708 105538       jl.     j2.       ;
31709 105540                         ;
31710 105540  
31710 105540  ; get start and size of area described in messagebuffer
31711 105540  
31711 105540       rl  w3  x1+a29    ;  param:= save w1.sender
31712 105542       wa  w3  x1+a182   ;  w3:= abs addr of param
31713 105544       rs. w3  h3.       ;  save abs addr
31714 105546       rl  w3  x3        ;  rel of addr:= param.function(bit(1:5))
31715 105548       ls  w3  -1        ;
31716 105550       am      (x1+a30)  ;  first:= mess buf(rel of addr)
31717 105552       dl  w0  x3+10     ;  last:= mess buf(rel of addr+2)
31718 105554       am.     (h3.)     ;  first:= first+relative.param
31719 105556       wa  w3  6         ;  first in buf:= even(first)
31720 105558       la. w3  h0.       ;
31721 105560       la. w0  h0.       ;  size in buf:= even(last)-first
31722 105562       ws  w0  6         ;
31723 105564       wa  w3  x2+a182   ;  w3:= abs addr of first in buf
31724 105566       ds. w0  h2.       ;  save(first in buf, size in buf)
31725 105568  
31725 105568  ; get start and size of corearea
31726 105568  
31726 105568       rl. w3  h3.       ;  first in core:= even(first addr.param)
31727 105570       dl  w0  x3+4      ;  last:= even(last addr.param)
31728 105572       la. w3  h0.       ;  size in core:= last - first in core
31729 105574       la. w0  h0.       ;
31730 105576       ws  w0  6         ;
31731 105578       wa  w3  x1+a182   ;  w3:= abs addr of first in core
31732 105580  
31732 105580  ; get minimum size of core- and buffer area
31733 105580  
31733 105580       sl. w0  (h2.)     ;  size to move:=
31734 105582       rl. w0  h2.       ;     min(size in buf, size in core)+2
31735 105584       ba. w0  h4.       ;  saved w1.sender:= size to move
31736 105586       rs  w0  x1+a29    ;
31737 105588  
31737 105588  ; check direction in which to move
31738 105588  
31738 105588       al  w2  x3        ;  from:= first in core
31739 105590       rl. w1  h1.       ;  to:= first in buf
31740 105592       rl. w3  (h3.)     ;  if param.function(bit(0))=0 then
31741 105594       so  w3  2.1       ;  exchange(to,from)
31742 105596       rx  w2  2;used    ;
31743 105598  h4=k-1                 ;
31744 105598       am      -2048     ;
31745 105600       jl. w3  e31.+2048 ;  move(size to move,to,from)
31746 105602                         ;
31747 105602       jl.     j0.       ;  goto result0
31748 105604  
31748 105604  h0:  -1<1              ; mask to remove bit 0
31749 105606  h1:  0                 ; saved first in buf
31750 105608  h2:  0                 ; saved size in buf
31751 105610  h3:  0                 ; saved parameter address
31752 105612  
31752 105612  e.                     ; end of general copy
31753 105612  
31753 105612  
31753 105612  
31753 105612  
31753 105612  ; setup pseudo process
31754 105612  ;
31755 105612  ;   the pseudo-process claim is decreased and an empty pseudo-process
31756 105612  ;     is initialized according to entry.work
31757 105612  ;
31758 105612  ; call: m158
31759 105612  ; error return: result 1, if pseudo process claims exceeded
31760 105612  
31760 105612  m158:                  ; setup pseudo process:
31761 105612       rl. w1    (l102.)  ;    w1:=sender
31762 105614       bz  w3  x1+a23    ;    if pseudo-process claims.sender exceeded then
31763 105616       sn  w3     0      ;
31764 105618       jl.        j1.    ;      goto result 1;
31765 105620  
31765 105620       al  w3  x3-1      ;    decrease(pseudo-process claims.sender);
31766 105622       hs  w3  x1+a23    ;
31767 105624  
31767 105624       jl. w3     e40.   ;      find idle pseudo process;
31768 105626  
31768 105626  ; w2 = pseudo process
31769 105626       rl  w0  x1+a30    ;
31770 105628       rs  w0  x2+a60    ;     mref.pseudo:= save w2(cur)
31771 105630  
31771 105630       rs  w1  x2+a50    ;    mainproc.pseudo := sender;
31772 105632       al  w0     64     ;
31773 105634       rs  w0  x2+a10    ;    kind.pseudo := pseudo process;
31774 105636       am        -2048   ;
31775 105638  
31775 105638       jl.        n0.+2048;   next instruction;
31776 105640  
31776 105640  
31776 105640  
31776 105640  ; redefine m-names:
31777 105640  
31777 105640  m00 = m00-n50, m01 = m01-n50, m02 = m02-n50, m03 = m03-n50, m04 = m04-n50, 
31778 105640  m05 = m05-n50, m06 = m06-n50, m07 = m07-n50, m08 = m08-n50, m09 = m09-n50, 
31779 105640  m10 = m10-n50, m11 = m11-n50, m12 = m12-n50, m13 = m13-n50, m14 = m14-n50, 
31780 105640  m15 = m15-n50, m16 = m16-n50, m17 = m17-n50, m18 = m18-n50, m19 = m19-n50, 
31781 105640  m20 = m20-n50, m21 = m21-n50, m22 = m22-n50, m23 = m23-n50, m24 = m24-n50, 
31782 105640  m25 = m25-n50, m26 = m26-n50, m27 = m27-n50, m28 = m28-n50, m29 = m29-n50, 
31783 105640  m30 = m30-n50, m31 = m31-n50, m32 = m32-n50, m33 = m33-n50, m34 = m34-n50, 
31784 105640  m35 = m35-n50, m36 = m36-n50, m37 = m37-n50, m38 = m38-n50, m39 = m39-n50, 
31785 105640  m40 = m40-n50, m41 = m41-n50, m42 = m42-n50, m43 = m43-n50, m44 = m44-n50, 
31786 105640  m45 = m45-n50, m46 = m46-n50, m47 = m47-n50, m48 = m48-n50, m49 = m49-n50, 
31787 105640  m50 = m50-n50, m51 = m51-n50  ,            ,            ,            , 
31788 105640  m55 = m55-n50, m56 = m56-n50, m57 = m57-n50, m58 = m58-n50, m59 = m59-n50, 
31789 105640  m60 = m60-n50,              , m62 = m62-n50, m63 = m63-n50, m64 = m64-n50,
31790 105640  m65 = m65-n50, m66 = m66-n50, m67 = m67-n50, m68 = m68-n50, m69 = m69-n50, 
31791 105640  m70 = m70-n50, m71 = m71-n50, m72 = m72-n50, m73 = m73-n50, m74 = m74-n50, 
31792 105640  m75 = m75-n50, m76 = m76-n50, m77 = m77-n50, m78 = m78-n50, m79 = m79-n50, 
31793 105640  m80 = m80-n50,            ,            , m83 = m83-n50, m84 = m84-n50, 
31794 105640  m85 = m85-n50, m86 = m86-n50, m87 = m87-n50, m88 = m88-n50, m89 = m89-n50, 
31795 105640  m90 = m90-n50, m91 = m91-n50,            ,            ,            , 
31796 105640  m100=m100-n50, m101=m101-n50, m102=m102-n50, m103=m103-n50, m104=m104-n50, 
31797 105640  m105=m105-n50, m106=m106-n50, m107=m107-n50, m108=m108-n50, m109=m109-n50, 
31798 105640  m115=m115-n50, m116=m116-n50, m117=m117-n50, m118=m118-n50, m119=m119-n50, 
31799 105640  m120=m120-n50, m121=m121-n50, m122=m122-n50, m123=m123-n50,              , 
31800 105640  m125=m125-n50, m126=m126-n50, m127=m127-n50, m128=m128-n50,              , 
31801 105640               ,              ,              ,              , m149=m149-n50, 
31802 105640  m150=m150-n50, m151=m151-n50, m152=m152-n50, m153=m153-n50, m154=m154-n50, 
31803 105640  m155=m155-n50, m156=m156-n50, m157=m157-n50, m158=m158-n50,              , 
31804 105640  m260=m260-n50 ,m280=m280-n50 ,
31805 105640  
31805 105640  j0=j0-n50, j1=j1-n50, j2=j2-n50, j3=j3-n50, j4=j4-n50, 
31806 105640  j5=j5-n50, j6=j6-n50, j7=j7-n50
31807 105640  \f


31807 105640  
31807 105640  
31807 105640  ; the following few instructions all perform an exit:
31808 105640  h.                 ; (the whole table is in halfword mode)
31809 105640  r0:  j0            ; goto result ok;
31810 105641  r1:  j1            ; goto result 1;
31811 105642  r2:  j2            ; goto result 2;
31812 105643  r3:  j3            ; goto result 3;
31813 105644  r4:  j4            ; goto result 4;
31814 105645  r5:  j5            ; goto result 5;
31815 105646  r6:  j6            ; goto result 6;
31816 105647  r7:  j7            ; goto result 7;
31817 105648  
31817 105648  
31817 105648  
31817 105648  ; procedure set aux entry
31818 105648  b. g10 h.
31819 105648  
31819 105648  p0:              ;
31820 105648       m77 , g3.   ;    if key.work < min aux key then goto skip-return;
31821 105650       m4          ;    set aux cat;
31822 105651       m18         ;    test new catalog name:
31823 105652             g5.   ;      overlap:  goto error-return;
31824 105653             g0.   ;      exact  :  goto copy;
31825 105654  ; no entry was found: create one now
31826 105654       m55         ;    find empty entry:
31827 105655             g5.   ;      overlap or no room:  goto error-return;
31828 105656       m60         ;    clear access counters.work;
31829 105657       m125, g1.   ;    goto modify;
31830 105659  g0:              ; copy:
31831 105659       m64         ;    move statarea.entry to statarea.work;
31832 105660  g1:              ; modify:
31833 105660       m56         ;    modify cur entry;
31834 105661       m88,  g2.   ;    if size.work>=0 then
31835 105663       m62         ;      update and insert statarea;
31836 105664  g2:              ;
31837 105664       m5          ;    set main cat;
31838 105665  g3:              ; skip-return:
31839 105665       m127        ;    skip-return;
31840 105666  
31840 105666  g5:              ; error-return:
31841 105666       m5          ;    set main cat;
31842 105667       m128        ;    error-return;
31843 105668  e.               ;
31844 105668  
31844 105668  
31844 105668  
31844 105668  ; procedure delete aux entry
31845 105668  b. g10 h.
31846 105668  p1:              ;
31847 105668       m4          ;    set aux cat;
31848 105669       m18         ;    test new catalog name:
31849 105670             g5.   ;      overlap:  goto set maincat;
31850 105671             g0.   ;      exact  :  goto delete;
31851 105672  ; no entry was found, i.e. don't delete anything
31852 105672       m125, g5.   ;    goto return;
31853 105674  
31853 105674  g0:              ; delete:
31854 105674       m57         ;    delete cur entry;
31855 105675  g5:              ; return:
31856 105675       m5          ;    set main cat;
31857 105676       m126        ;    return;
31858 105677  e.               ;
31859 105678  
31859 105678  
31859 105678  
31859 105678  ; create entry
31860 105678  ;
31861 105678  ; call:
31862 105678  ;    w1.sender :  tail address
31863 105678  ;    w3.sender :  name address
31864 105678  ; return:
31865 105678  ;    w0.sender : result = 0 : entry created
31866 105678  ;                result = 1 : no room
31867 105678  ;                result = 2 : catalog io-error
31868 105678  ;                result = 2 : document not present
31869 105678  ;                result = 2 : document not ready
31870 105678  ;                result = 3 : name overlap or name already exists
31871 105678  ;                result = 4 : claims exceeded
31872 105678  ;                result = 5 : catbase.sender outside stdbase.sender
31873 105678  ;                result = 6 : nameformat (of entry-name) illegal
31874 105678  ;                result = 6 : nameformat (of document name) illegal
31875 105678  ;                result = 7 : maincat not present
31876 105678  
31876 105678  p20:             ; create entry:
31877 105678       m0  , r7.   ;    if no maincat then result 7;
31878 105680       m65         ;    move catbase,name to work;
31879 105681       m90         ;    clear first slice.work;
31880 105682       m80         ;    clear key.work;
31881 105683       m75         ;    test base,key.work:
31882 105684             r5.   ;      illegal:  result 5;
31883 105685       m15         ;    test new system name (maybe wrk-name);
31884 105686             r3.   ;      overlap:  result 3;
31885 105687             r3.   ;      exact  :  result 3;
31886 105688       m105        ;    move tail to work;
31887 105689       m35 , t3    ;    search any chains (state = ready);
31888 105691       m22 , 2.10  ;    compute slices to claim  (compute new slices);
31889 105693       m30         ;    test claims (create):
31890 105694             r4.   ;      claims exceeded:  result 4;
31891 105695       m23         ;    adjust chain to size;
31892 105696       m55         ;    find empty entry:
31893 105697             r1.   ;      no room:  result 1;
31894 105698       m56         ;    modify cur entry;
31895 105699       m101        ;    move name.work to name.sender;  (in case of wrk-name)
31896 105700       j0          ;    result ok;
31897 105701  
31897 105701  
31897 105701  
31897 105701  ; lookup entry
31898 105701  ;
31899 105701  ; call:
31900 105701  ;   w1.sender :  tail address
31901 105701  ;   w3.sender :  name address
31902 105701  ;
31903 105701  ; return:
31904 105701  ;   w0.sender :  result = 0 : entry looked up
31905 105701  ;                result = 2 : catalog io-error
31906 105701  ;                result = 3 : entry does not exist
31907 105701  ;                result = 6 : nameformat illegal
31908 105701  ;                result = 7 : maincat not present
31909 105701  
31909 105701  p21:             ; lookup entry:
31910 105701       m0  , r7.   ;    if no maincat then result 7;
31911 105703       m65         ;    move catbase,name to work;
31912 105704       m10         ;    search best catalog entry:
31913 105705             r3.   ;      not found:  result 3;
31914 105706       m106        ;    move tail.work to tail.sender;
31915 105707       j0          ;    result ok;
31916 105708  
31916 105708  
31916 105708  
31916 105708  ; lookup entry head and tail:
31917 105708  ;
31918 105708  ; call:
31919 105708  ;   w1.sender : entry address
31920 105708  ;   w3.sender : name address
31921 105708  ;
31922 105708  ; return:
31923 105708  ;   w0.sender : result  (as lookup entry)
31924 105708  
31924 105708  p38:             ; lookup entry head and tail:
31925 105708       m0 ,  r7.   ;    if no maincat then result 7;
31926 105710       m65         ;    move catbase,name to work;
31927 105711       m10         ;    search best catalog entry:
31928 105712             r3.   ;      not found:  result 3;
31929 105713       m108        ;    move entry.work to entry.sender;
31930 105714       j0          ;    result ok;
31931 105715  
31931 105715  
31931 105715  
31931 105715  ; change entry
31932 105715  ;
31933 105715  ; call:
31934 105715  ;   w1.sender :  tail address
31935 105715  ;   w3.sender :  name address
31936 105715  ;
31937 105715  ; return:
31938 105715  ;   w0.sender :  result = 0 : entry changed
31939 105715  ;                result = 2 : catalog io-error
31940 105715  ;                result = 2 : document not ready
31941 105715  ;                result = 3 : entry does not exist
31942 105715  ;                result = 4 : entry protected against calling process
31943 105715  ;                               (i.e. base.entry outside maxbase.sender)
31944 105715  ;                result = 5 : entry reserved by another process
31945 105715  ;                result = 6 : nameformat illegal
31946 105715  ;                result = 6 : new size illegal
31947 105715  ;                result = 6 : claims exceeded
31948 105715  ;                result = 7 : maincat not present
31949 105715  
31949 105715  b. g10 h.
31950 105715  
31950 105715  p22:             ; change entry:
31951 105715       m0  , r7.   ;    if no maincat then result 7;
31952 105717       m65         ;    move catbase,name to work;
31953 105718       m11 , f23   ;    search best entry and test modif allowed (no reserver);
31954 105720       m36 , t3    ;    search chain (state = ready);
31955 105722       m89         ;    move tail to work and test new size;
31956 105723       m22 , 2.11  ;    compute slices to claim  (compute new slices and count old slices);
31957 105725       m29         ;    test claims (change):
31958 105726             r6.   ;      exceeded:  result 6;
31959 105727       m7          ;     lock(monitor)
31960 105728       m23         ;    adjust chain;
31961 105729       m12         ;     unlock(monitor)
31962 105730       m88         ;    if size.work >= 0 then
31963 105731             g0.   ;      begin
31964 105732       m66         ;      move docname.curdoc to docname.entry;
31965 105733       m77 , g0.   ;      if key.work >= min aux key
31966 105735       m24         ;      and area extended then
31967 105736             m6    ;        dump chaintable;
31968 105737  g0:              ;      end;
31969 105737       m7          ;     lock(monitor)
31970 105738       m48         ;    if area process then reinit area process;
31971 105739       m12         ;      unlock(monitor)
31972 105740       m56         ;    modify cur entry;
31973 105741       m58         ;    set aux entry:
31974 105742             g1.   ;      overlap or no room:  does'nt matter
31975 105743  g1:              ;
31976 105743       j0          ;    result ok;
31977 105744  
31977 105744  e.               ;
31978 105744  
31978 105744  
31978 105744  
31978 105744  ; rename entry
31979 105744  ;
31980 105744  ; call:
31981 105744  ;   w1.sender :  new name address
31982 105744  ;   w3.sender :  name address
31983 105744  ;
31984 105744  ; return:
31985 105744  ;   w0.sender :  result = 0 : entry renamed
31986 105744  ;                result = 1 : no room
31987 105744  ;                result = 2 : catalog io-error
31988 105744  ;                result = 2 : document not ready
31989 105744  ;                result = 3 : entry not found
31990 105744  ;                result = 3 : name overlap (new name)
31991 105744  ;                result = 3 : new name exists
31992 105744  ;                result = 4 : entry protected against calling process
31993 105744  ;                               (i.e. base.entry outside maxbase.sender)
31994 105744  ;                result = 5 : entry used by another process
31995 105744  ;                result = 6 : old or new name format illegal
31996 105744  ;                result = 7 : maincat not present
31997 105744  
31997 105744  b. g10 h.
31998 105744  
31998 105744  p23:             ; rename entry:
31999 105744       m0  , r7.   ;    if no maincat then result 7;
32000 105746       m103        ;    move newname.sender to name.work;
32001 105747       m13         ;    test name format (newname);
32002 105748       m65         ;    move catbase,name to work;
32003 105749       m11 , f22   ;    search best entry and test modif allowed (no users);
32004 105751       m36 , t3    ;    search chain (state = ready);
32005 105753       m57         ;    delete cur entry;
32006 105754       m103        ;    move newname.sender to name.work;
32007 105755       m17         ;    test new system name (no wrk-name):
32008 105756             g10.  ;      overlap:  goto repair maincat;
32009 105757             g10.  ;      already:  goto repair maincat;
32010 105758       m55         ;    find empty entry:
32011 105759             g9.   ;      no room : goto repair maincat
32012 105760       m56         ;    modify cur entry;
32013 105761       m77         ;    if key.work >= min aux key then
32014 105762             g2.   ;      begin
32015 105763       m100        ;      name.work := name.sender;
32016 105764       m59         ;      delete aux entry (old name);
32017 105765       m103        ;      restore new name;
32018 105766  g2:              ;      end;
32019 105766       m58         ;    set aux entry (new name);
32020 105767             g5.   ;      overlap or no room:  goto repair auxcat;
32021 105768       m48         ;    if area process then reinit area process;
32022 105769       j0          ;    result ok;
32023 105770  
32023 105770  g5:              ; repair auxcat:
32024 105770       m100        ;    restore old name;
32025 105771       m58         ;    set aux entry:
32026 105772             g6.   ;      overlap or no room:  does'nt matter
32027 105773  g6:              ;
32028 105773       m103        ;    restore new name;
32029 105774       m18         ;    test new catalog name (new name):
32030 105775             r7.   ;      overlap:  result 7;  (not possible)
32031 105776             g7.   ;      exact  :  goto remove new name;
32032 105777       j7          ;    not found:  result 7;  (not possible)
32033 105778  g7:              ; remove new name:
32034 105778       m57         ;    delete cur entry;
32035 105779  
32035 105779  g10:             ; repair maincat:
32036 105779       m100        ;    restore old name;
32037 105780       m14         ;    compute name key;
32038 105781       m55         ;    find empty entry:
32039 105782             r7.   ;      no room:  result 7;  (not possible)
32040 105783       m56         ;    modify cur entry;
32041 105784       j3          ;    result 3;
32042 105785  g9 : m100        ;      restore oldname
32043 105786       m14         ;      compute namekey
32044 105787       m55         ;      find empty entry
32045 105788             r7.   ;      no room : not possible
32046 105789       m56         ;      modify 
32047 105790       j1          ;      goto result 1 : no room
32048 105791  
32048 105791  e.               ;
32049 105792  
32049 105792  
32049 105792  
32049 105792  ; remove entry
32050 105792  ;
32051 105792  ; call:
32052 105792  ;   w3.sender :  name address
32053 105792  ;
32054 105792  ; return:
32055 105792  ;   w0.sender :  result = 0 : entry removed
32056 105792  ;                result = 2 : catalog io-error
32057 105792  ;                result = 2 : document not ready
32058 105792  ;                result = 3 : entry not found
32059 105792  ;                result = 4 : entry protected against calling process
32060 105792  ;                               (i.e. base.entry outside maxbase.sender)
32061 105792  ;                result = 5 : entry used by another process
32062 105792  ;                result = 6 : nameformat illegal
32063 105792  ;                result = 7 : maincat not present
32064 105792  
32064 105792  b. g10 h.
32065 105792  
32065 105792  p24:             ; remove entry:
32066 105792       m0  , r7.   ;    if no maincat then result 7;
32067 105794       m65         ;    move catbase,name to work;
32068 105795       m11 , f22   ;    search best entry and test modif allowed (no users);
32069 105797       m36 , t3    ;    search chain (state = ready);
32070 105799       m22 , 2.01  ;    compute slices to claim  (count old slices);
32071 105801       m28         ;    test claims (remove);
32072 105802             r7.   ;      claims exceeded:  result 7;  (not possible)
32073 105803       m23         ;    adjust chain to size;
32074 105804       m50         ;    if areaprocess then delete areaprocess;
32075 105805       m57         ;    delete cur entry;
32076 105806       m77 , g5.   ;    if key.work >= min aux key then
32077 105808       m59         ;      delete aux entry;
32078 105809  g5:              ;
32079 105809       j0          ;    result ok;
32080 105810  
32080 105810  e.               ;
32081 105810  
32081 105810  
32081 105810  
32081 105810  ; permanent entry
32082 105810  ;
32083 105810  ; call:
32084 105810  ;   w1.sender :  permanens key
32085 105810  ;   w3.sender :  name address
32086 105810  ;
32087 105810  ; return:
32088 105810  ;   w0.sender :  result = 0 : entry-permanens changed
32089 105810  ;                result = 2 : catalog io-error
32090 105810  ;                result = 2 : document not ready
32091 105810  ;                result = 3 : entry does not exist
32092 105810  ;                result = 3 : overlap (or no room) in auxcat
32093 105810  ;                result = 4 : entry protected against calling process
32094 105810  ;                               (i.e. base.entry outside maxbase.sender)
32095 105810  ;                result = 4 : key illegal
32096 105810  ;                result = 5 : entry reserved by another process
32097 105810  ;                result = 6 : nameformat illegal
32098 105810  ;                result = 6 : claims exceeded
32099 105810  ;                result = 7 : maincat not present
32100 105810  
32100 105810  b. g20 h.
32101 105810  
32101 105810  p25:             ; permanent entry:
32102 105810       m0  , r7.   ;    if maincat not present then result 7;
32103 105812  g0:              ;
32104 105812       m65         ;    move catbase,name to work;
32105 105813       m11 , f23   ;    search best entry and test modif allowed (no reserver);
32106 105815  g1:              ; entry found:
32107 105815       m36 , t3    ;    search chain (state = ready)
32108 105817  g2:              ; chain found:
32109 105817       m78         ;    save oldkey, key.work := param, test key legal;
32110 105818       m75         ;    test base,key:
32111 105819             r4.   ;      key < minaux and base outside stdbase: result 4;
32112 105820       m22 , 2.01  ;    compute slices to claim  (count old slices);
32113 105822       m27         ;    test claims (permanent):
32114 105823             r6.   ;      exceeded:  result 6;
32115 105824       m88 , g8.   ;    if size < 0 then goto file-descriptor;
32116 105826  g4:              ; modify maincat:
32117 105826       m56         ;    modify cur entry;
32118 105827       m77         ;    if key.work >= min aux key then
32119 105828             g5.   ;      begin
32120 105829       m6          ;      dump chaintable;
32121 105830       m58         ;      set aux entry:
32122 105831             g10.  ;        overlap or no room:  goto repair maincat;
32123 105832       j0          ;      result ok;
32124 105833  g5:              ;      end;
32125 105833       m79         ;    restore old key;
32126 105834       m77 , g6.   ;    if key.work >= min aux key then
32127 105836       m59         ;      delete aux entry;
32128 105837  g6:              ;
32129 105837       j0          ;    result ok;
32130 105838  
32130 105838  g8:              ; file-descriptor:
32131 105838       m77 , g9.   ;    if key.work >= min aux key then
32132 105840       m91         ;      slice.work := docnumber;  (result 5 not possible)
32133 105841       m125, g4.   ;
32134 105843  g9:              ;    else
32135 105843       m90         ;      first slice.work := 0;
32136 105844       m125, g4.   ;    goto modify maincat;
32137 105846  
32137 105846  g10:             ; repair maincat:
32138 105846       m79         ;    restore old key;
32139 105847       m18         ;    test new catalog name:
32140 105848             r7.   ;      overlap:  result 7;  (not possible)
32141 105849             g11.  ;      exact  :  goto modify maincat entry;
32142 105850       j7          ;    not found:  result 7;  (not possible)
32143 105851  g11:             ; modify maincat entry:
32144 105851       m56         ;    modify cur entry;
32145 105852       j3          ;    result 3;
32146 105853  
32146 105853  
32146 105853  
32146 105853  
32146 105853  ; permanent entry in auxcat
32147 105853  ;
32148 105853  ; call:
32149 105853  ;   w1.sender :  permanens key
32150 105853  ;   w2.sender :  docname address
32151 105853  ;   w3.sender :  name address
32152 105853  ;
32153 105853  ; return:
32154 105853  ;   w0.sender :  result  (as permanent entry)
32155 105853  ;                result = 2 : document not found
32156 105853  ;                result = 5 : entry already permanent in another auxcat
32157 105853  ;                result = 6 : docname format illegal
32158 105853  
32158 105853  p45:             ; permanent entry in auxcat:
32159 105853       m0  , r7.   ;    if no maincat then result 7;
32160 105855       m65         ;    move catbase,name to work;
32161 105856       m78         ;    (save oldkey), key.work := param, test key;
32162 105857       m77         ;    if key.work < min aux key then
32163 105858             g0.   ;      goto permanent entry;
32164 105859       m104        ;    move docname.sender to docname.work;
32165 105860       m84         ;    (size.work := 0)
32166 105861       m36 , t3    ;    search chain (state = ready)
32167 105863       m11 , f23   ;    search best entry and test modif allowed (no reserver);
32168 105865       m88 , g20.  ;    if size.work >= 0 then
32169 105867       m125, g1.   ;      goto entry found;  (new docname irrellevant)
32170 105869  g20:             ; file-descriptor:
32171 105869       m91         ;    slice.work := docnumber;  (maybe result 5)
32172 105870       m125, g2.   ;    goto chain found;
32173 105872  
32173 105872  e.               ;
32174 105872  
32174 105872  
32174 105872  
32174 105872  ; create area process
32175 105872  ;
32176 105872  ; call:
32177 105872  ;   w3.sender :  name address
32178 105872  ;
32179 105872  ; return:
32180 105872  ;   w0.sender :  result = 0 : area process created
32181 105872  ;                result = 1 : area claims exceeded
32182 105872  ;                result = 2 : catalog io-error
32183 105872  ;                result = 2 : state of document does not permit this call
32184 105872  ;                result = 3 : entry not found
32185 105872  ;                result = 4 : entry does not describe an area
32186 105872  ;                               (i.e. size.entry < 0)
32187 105872  ;                result = 6 : nameformat illegal
32188 105872  
32188 105872  b. g10 h.
32189 105872  
32189 105872  p26:             ; create area process:
32190 105872       m0   , g5.  ;    if no maincat then goto test areaprocs;
32191 105874       m65         ;    move catbase,name to work;
32192 105875       m10         ;    search best catalog entry:
32193 105876              g5.  ;      not found:  goto test areaprocs;
32194 105877       m88  , r4.  ;    if size.work < 0 then result 4;
32195 105879  ; notice: if the document is being dismounted etc. it is not allowed
32196 105879  ; to create area processes:
32197 105879       m36  , t30  ;    search chains (state = allowed for create area process);
32198 105881       m46  , 2    ;    setup area process (sender);
32199 105883       j0          ;    result ok;
32200 105884  
32200 105884  g5:              ; test areaprocs:
32201 105884  ; remember: none of the catalogs are described in maincatalog yet,
32202 105884  ; therefor special care must be taken, when a process wants to
32203 105884  ; have an areaprocess to one of the catalogs:
32204 105884       m45         ;    search best area process:
32205 105885              r3.  ;      not found:  result 3;
32206 105886       m47 , 2     ;    include in areaprocess (sender);
32207 105888       j0          ;    result ok;
32208 105889  
32208 105889  e.               ;
32209 105890  
32209 105890  
32209 105890  
32209 105890  ; create entry lock process
32210 105890  ;
32211 105890  ; call:
32212 105890  ;   w3.sender :  name address ( with room for name table address )
32213 105890  ;
32214 105890  ; return:
32215 105890  ;   w0.sender :  result = 0 : process created
32216 105890  ;                result = 1 : area claims exceeded
32217 105890  ;                result = 2 : catalog io-error
32218 105890  ;                result = 2 : state of document does not permit this call
32219 105890  ;                result = 3 : entry not found
32220 105890  ;                result = 6 : nameformat illegal
32221 105890  ;                result = 7 : maincat not present
32222 105890  
32222 105890  p46:             ; create entry lock process:
32223 105890       m0   , r7.  ;    if no maincat then result 7;
32224 105892       m65         ;    move catbase,name to work;
32225 105893       m10         ;    search best catalog entry:
32226 105894              r3.  ;      not found:  result 3;
32227 105895  ; (see comment at create area process)
32228 105895       m36  , t30  ;    search chain (state = allowed for create area process);
32229 105897       m46  , 2    ;    setup area process (sender);
32230 105899       m83         ;    prepare for moving nametable address to sender;
32231 105900       m102        ;    move (name and) nametable address to sender;
32232 105901       j0          ;    result ok;
32233 105902  
32233 105902  
32233 105902  
32233 105902  ; create peripheral process
32234 105902  ;
32235 105902  ; call:
32236 105902  ;   w1.sender :  device number
32237 105902  ;   w3.sender :  name address
32238 105902  ;
32239 105902  ; return:
32240 105902  ;   w0.sender :  result = 0 : peripheral process created
32241 105902  ;                result = 1 : function forbidden in calling process
32242 105902  ;                result = 2 : calling process is not a user
32243 105902  ;                result = 2 : catalog io-error
32244 105902  ;                result = 3 : name overlap
32245 105902  ;                result = 3 : name already exists
32246 105902  ;                result = 3 : not same disc name
32247 105902  ;                result = 4 : device number does not exist
32248 105902  ;                result = 5 : device is reserved by another user
32249 105902  ;                result = 6 : nameformat illegal
32250 105902  
32250 105902  b. g10 h.
32251 105902  
32251 105902  p27:             ; create peripheral process:
32252 105902       m8   , f74  ;    check function mask (create peripheral process);
32253 105904       m149        ;    test device, user, reserver;
32254 105905       m65         ;    move catbase,name to work;
32255 105906       m34         ;    if not bs-device then
32256 105907              g5.  ;      goto not bs;
32257 105908  
32257 105908  ; all bs-devices will have catalog-interval, with no regard on a future
32258 105908  ;   catalog-system or not.
32259 105908  ; this ensures that all bs-devices have distinct names, and that
32260 105908  ;   that bs-documents (i.e. bs-devices included in catalog-system) may
32261 105908  ;   loose its connection to the device (e.g. the device-name is cleared
32262 105908  ;   at intervention at the disc), and later resume the connection,
32263 105908  ;   without any risk that the device-name has been occupied by another
32264 105908  ;   device.
32265 105908  
32265 105908       m70         ;    base.work := catalog interval;
32266 105909       m43         ;    compare name.work and docname.chain.proc:
32267 105910                   ;      (if connection between proc and a chain then
32268 105910                   ;      the names must agree)
32269 105910              g5.  ; no chain:  goto not bs;
32270 105911       m66         ;    docname.work := docname.chain;
32271 105912       m40         ;    reinit rest of chainhead;
32272 105913                   ;    (i.e. insert procfunc as user and reserver of disc)
32273 105913       m125 , g10. ;    goto set name and interval;
32274 105915  
32274 105915  g5:              ; not bs:
32275 105915       m15         ;    test new system name (maybe wrk-name):
32276 105916              r3.  ;      overlap:  result 3;
32277 105917              r3.  ;      exact  :  result 3;
32278 105918       m101        ;    move name.work to name.sender;  (in case of wrk-name)
32279 105919  
32279 105919  g10:             ; set name and interval:
32280 105919       m150        ;    set name and interval;
32281 105920       j0          ;    result ok;
32282 105921  e.               ;
32283 105922  
32283 105922  
32283 105922  
32283 105922  ; create internal process
32284 105922  ;
32285 105922  ; call:
32286 105922  ;   w1.sender :  parameter address
32287 105922  ;   w3.sender :  name address
32288 105922  ;
32289 105922  ; return:
32290 105922  ;   w0.sender :  result = 0 : internal process created
32291 105922  ;                result = 1 : storage area outside calling process
32292 105922  ;                result = 1 : internal claims exceeded
32293 105922  ;                result = 1 : illegal protection
32294 105922  ;                result = 1 : maxbase or stdbase not contained in
32295 105922  ;                               corresponding base of calling process
32296 105922  ;                result = 2 : catalog io-error
32297 105922  ;                result = 3 : name overlap
32298 105922  ;                result = 3 : name already exists
32299 105922  ;                result = 6 : nameformat illegal
32300 105922  
32300 105922  p28:             ; create internal process:
32301 105922       m65         ;    move catbase,name to work;
32302 105923       m15         ;    test new system name (maybe wrk-name):
32303 105924              r3.  ;      overlap:  result 3;
32304 105925              r3.  ;      exact  :  result 3;
32305 105926       m101        ;    move name.work to name.sender (in case of wrk-name);
32306 105927       m151        ;    create internal process;
32307 105928       m150        ;    set name and interval;
32308 105929       j0          ;    result ok;
32309 105930  
32309 105930  
32309 105930  
32309 105930  ; start internal process
32310 105930  ;
32311 105930  ; call:
32312 105930  ;   w3.sender :  name address
32313 105930  ;
32314 105930  ; return:
32315 105930  ;   w0.sender :  result = 0 : internal process started
32316 105930  ;              ( result = 2 : state of process does not permit start )
32317 105930  ;                result = 3 : process does not exist
32318 105930  ;                result = 3 : process is not an internal process
32319 105930  ;                result = 3 : process is not a child of calling process
32320 105930  ;                result = 6 : nameformat illegal
32321 105930  
32321 105930  p29:             ; start internal process:
32322 105930       m65         ;    move catbase,name to work;
32323 105931       m152        ;    start internal process;
32324 105932  
32324 105932  
32324 105932  
32324 105932  ; stop internal process
32325 105932  ;
32326 105932  ; call:
32327 105932  ;   w3.sender :  name address
32328 105932  ;
32329 105932  ; return:
32330 105932  ;   w0.sender :  result = 0 : stop initiated
32331 105932  ;                result = 3 : process does not exist
32332 105932  ;                result = 3 : process is not an internal process
32333 105932  ;                result = 3 : process is not a child of calling process
32334 105932  ;                result = 6 : nameformat illegal
32335 105932  ;   w2.sender :  buffer address (in case result=0)
32336 105932  
32336 105932  p30:             ; stop internal process:
32337 105932       m65         ;    move catbase,name to work;
32338 105933       m153        ;    stop internal process;
32339 105934  
32339 105934  
32339 105934  
32339 105934  ; modify internal process
32340 105934  ;
32341 105934  ; call:
32342 105934  ;   w1.sender :  register address
32343 105934  ;   w3.sender :  name address
32344 105934  ;
32345 105934  ; return:
32346 105934  ;   w0.sender :  result = 0 : internal process modified
32347 105934  ;              ( result = 2 : state of process does not permit modification )
32348 105934  ;                result = 2 : child ic outside child process
32349 105934  ;                result = 3 : process does not exist
32350 105934  ;                result = 3 : process in not an internal process
32351 105934  ;                result = 3 : process is not a child of calling process
32352 105934  ;                result = 6 : nameformat illegal
32353 105934  
32353 105934  p31:             ; modify internal process:
32354 105934       m65         ;    move catbase,name to work;
32355 105935       m154        ;    modify internal process;
32356 105936  
32356 105936  
32356 105936  
32356 105936  ; remove process
32357 105936  ;
32358 105936  ; call:
32359 105936  ;   w3.sender :  name address
32360 105936  ;
32361 105936  ; return:
32362 105936  ;   w0.sender :  result = 0 : process removed
32363 105936  ;                result = 1 : function forbidden in calling process
32364 105936  ;                result = 2 : state of process does not permit removal
32365 105936  ;                result = 2 : calling process is not a user of process
32366 105936  ;                result = 2 : claimed message to pseudo process
32367 105936  ;                result = 3 : process does not exist
32368 105936  ;                result = 3 : process is not a child of calling process
32369 105936  ;                result = 5 : peripheral process reserved by another user
32370 105936  ;                result = 6 : nameformat illegal
32371 105936  
32371 105936  p32:             ; remove process:
32372 105936       m65         ;    move catbase,name to work;
32373 105937       m155        ;    remove process;
32374 105938  
32374 105938  
32374 105938  
32374 105938  ; generate name
32375 105938  ;
32376 105938  ; call:
32377 105938  ;   w3.sender :  name address
32378 105938  ;
32379 105938  ; return:
32380 105938  ;   w0.sender :  result = 0 : wrk-name generated
32381 105938  ;                result = 2 : catalog io-error
32382 105938  
32382 105938  p34:             ; generate name:
32383 105938       m16         ;    generate wrk-name:
32384 105939             r7.   ;      (irrell)
32385 105940             r7.   ;      (irrell)
32386 105941       m101        ;    move name.work to name.sender;
32387 105942       j0          ;    result ok;
32388 105943  
32388 105943  
32388 105943  
32388 105943  ; copy
32389 105943  ;
32390 105943  ; call:
32391 105943  ;   w1.sender :  first address
32392 105943  ;   w2.sender :  buffer address
32393 105943  ;   w3.sender :  last address
32394 105943  ;
32395 105943  ; return:
32396 105943  ;   w0.sender :  result = 0 : area copied
32397 105943  ;                result = 2 : sender of buffer is stopped
32398 105943  ;                result = 3 : buffer describes input or output
32399 105943  ;                               outside senders area
32400 105943  ;                result = 3 : message regretted
32401 105943  ;                result = 3 : operation in buffer is neither input not output
32402 105943  ;   w1.sender :  bytes moved (if result=0)
32403 105943  ;   w3.sender :  characters moved (if result=0)
32404 105943  
32404 105943  p35:             ; copy:
32405 105943       m156        ;    copy message;
32406 105944  
32406 105944  
32406 105944  
32406 105944  ; set catalog base
32407 105944  ;
32408 105944  ; call:
32409 105944  ;   w0.sender :  lower base
32410 105944  ;   w1.sender :  upper base
32411 105944  ;   w3.sender :  name address
32412 105944  ;
32413 105944  ; return:
32414 105944  ;   w0.sender :  result = 0 : catalog base set
32415 105944  ;              ( result = 2 : state of process does not permit modification )
32416 105944  ;                result = 3 : process does not exist
32417 105944  ;                result = 3 : process is not an internal process
32418 105944  ;                result = 3 : process is not a child of calling process
32419 105944  ;                result = 4 : newbase illegal
32420 105944  ;                result = 6 : nameformat illegal
32421 105944  
32421 105944  p36:             ; set catalog base:
32422 105944       m65        ;    move catbase,name to work;
32423 105945       m69         ; test new catbase.internal
32424 105946       m74         ;    set catbase of internal;
32425 105947       j0          ;    result ok;
32426 105948  
32426 105948  
32426 105948  
32426 105948  ; set entry base
32427 105948  ;
32428 105948  ; call:
32429 105948  ;   w0.sender :  lower base
32430 105948  ;   w1.sender :  upper base
32431 105948  ;   w3.sender :  name address
32432 105948  ;
32433 105948  ; return:
32434 105948  ;   w0.sender :  result = 0 : entry interval set
32435 105948  ;                result = 2 : catalog io-error
32436 105948  ;                result = 2 : document not ready
32437 105948  ;                result = 3 : entry not found
32438 105948  ;                result = 3 : name overlap (at new base)
32439 105948  ;                result = 3 : name already exists (at new base)
32440 105948  ;                result = 4 : entry protected against calling process
32441 105948  ;                               (i.e. oldbase.entry outside maxbase.sender)
32442 105948  ;                result = 4 : key,newbase combination illegal
32443 105948  ;                result = 5 : entry used by another process
32444 105948  ;                result = 6 : nameformat illegal
32445 105948  ;                result = 7 : maincat not present
32446 105948  
32446 105948  b. g10 h.
32447 105948  
32447 105948  p37:             ; set entry base:
32448 105948       m0  , r7.   ;    if no maincat then result 7;
32449 105950       m65         ;    move catbase,name to work;
32450 105951       m11 , f22   ;    search best entry and test modif allowed (no users)
32451 105953       m36 , t3    ;    search chain (state = ready);
32452 105955       m71         ;    test new base;
32453 105956       m72         ;    save oldbase, base.work := newbase;
32454 105957             r0.   ;      same base:  result ok;
32455 105958       m75         ;    test base.work,key.work combination;
32456 105959             r4.   ;      error:  result 4;
32457 105960       m17         ;    test new system name (wrk-name not allowed):
32458 105961             r3.   ;      overlap:  result 3;
32459 105962             r3.   ;      exact  :  result 3;
32460 105963       m56         ;    modify cur entry;
32461 105964       m48         ;    if areaprocess then reinit area process;
32462 105965       m77 , r0.   ;    if key.work < min aux key then result ok;
32463 105967  
32463 105967       m4          ;    set aux cat;
32464 105968       m18         ;    test new catalog name:
32465 105969             g6.   ;      overlap:  goto repair maincat;
32466 105970             g8.   ;      exact  :  goto remove superfluous entry;
32467 105971  g0:              ; find old entry in auxcat:
32468 105971       m73         ;    restore oldbase;
32469 105972       m18         ;    test new catalog name:
32470 105973             g1.   ;      overlap:  goto create new;  (does'nt matter)
32471 105974             g2.   ;      exact  :  goto copy;
32472 105975  ; the entry did not exist in the auxcat
32473 105975  g1:              ; create new:
32474 105975       m55         ;    find empty entry;
32475 105976             g5.   ;      no room:  goto repair maincat;
32476 105977       m60         ;    clear access counters.work;
32477 105978       m125, g3.   ;    goto modify;
32478 105980  g2:              ; copy:
32479 105980       m64         ;    move statarea.entry to statarea.work;
32480 105981  g3:              ; modify:
32481 105981       m71         ;    (test and) get new base;
32482 105982       m72         ;    save oldbase, set newbase;
32483 105983             r7.   ;      (same base:  not possible)
32484 105984       m56         ;    modify cur entry;
32485 105985       m88,  g4.   ;    if size.work>=0 then
32486 105987       m62         ;      update and insert statarea;
32487 105988  g4:              ;
32488 105988       m5          ;    set maincat;
32489 105989       j0          ;    result ok;
32490 105990  
32490 105990  g5:              ; repair maincat:
32491 105990       m71         ;    (test and) get new base;
32492 105991       m72         ;    save oldbase, set newbase;
32493 105992             r7.   ;      (same base:  not possible)
32494 105993  g6:              ; (newbase set):
32495 105993       m5          ;    set maincat;
32496 105994       m18         ;    test new catalog name:
32497 105995             r7.   ;      overlap:  result 7;  (not possible)
32498 105996             g7.   ;      exact  :  goto change main entry;
32499 105997       j7          ;    result 7;  (not possible)
32500 105998  
32500 105998  g7:              ; change main entry:
32501 105998       m73         ;    restore oldbase;
32502 105999       m56         ;    modify cur entry;
32503 106000       j3          ;    result 3;
32504 106001  
32504 106001  g8:              ; remove superfluous entry:
32505 106001       m57         ;    delete cur entry;
32506 106002       m125, g0.   ;    goto find old entry in auxcat;
32507 106004  
32507 106004  e.               ;
32508 106004  
32508 106004  
32508 106004  
32508 106004  ; set backing storage claims
32509 106004  ;
32510 106004  ; call:
32511 106004  ;   w1.sender :  claim list address
32512 106004  ;   w2.sender :  docname address
32513 106004  ;   w3.sender :  name address
32514 106004  ;
32515 106004  ; result:
32516 106004  ;   w0.sender :  result = 0 : backing starage claims set
32517 106004  ;                result = 1 : claims exceeded (at calling process)
32518 106004  ;                result = 1 : claims exceeded (at child)
32519 106004  ;                result = 2 : document not found
32520 106004  ;                result = 3 : process does not exist
32521 106004  ;                result = 3 : process is not an internal process
32522 106004  ;                result = 3 : process is not a child of calling process
32523 106004  ;                result = 6 : nameformat (of docname) illegal
32524 106004  ;                result = 6 : nameformat (of childname) illegal
32525 106004  
32525 106004  p39:             ; set bs claims:
32526 106004       m104        ;    move docname.sender to docname.work;
32527 106005       m84         ;    (size.work := 0);
32528 106006       m36 , t29   ;    search chain (state = allowed for set bs claims);
32529 106008       m65         ;    move catbase,name to work;
32530 106009       m32         ;    set bs claims;
32531 106010  
32531 106010  
32531 106010  
32531 106010  ; create pseudo process
32532 106010  ;
32533 106010  ; call:
32534 106010  ;   w3.sender :  name address
32535 106010  ;
32536 106010  ; return:
32537 106010  ;   w0.sender :  result = 0 : pseudo process created
32538 106010  ;                result = 1 : (area) claims exceeded
32539 106010  ;                result = 2 : catalog io-error
32540 106010  ;                result = 3 : name overlap
32541 106010  ;                result = 3 : name already exists
32542 106010  ;                result = 6 : nameformat illegal
32543 106010  
32543 106010  p40:             ; create pseudo process:
32544 106010       m65         ;    move catbase,name to work;
32545 106011       m15         ;    test new system name (maybe wrk-name):
32546 106012             r3.   ;      overlap:  result 3;
32547 106013             r3.   ;      exact  :  result 3;
32548 106014       m101        ;    move name.work to name.sender (in case of wrk-name);
32549 106015       m158        ;    create pseudo process;
32550 106016       m150        ;    set name and interval;
32551 106017       j0          ;    result ok;
32552 106018  
32552 106018  ; general copy
32553 106018  ;
32554 106018  ; call:
32555 106018  ;   w1.sender:  parameter address
32556 106018  ;   w2.sender:  buffer address
32557 106018  ;
32558 106018  ; return:
32559 106018  ;   w0.sender:  result = 0 : area copied
32560 106018  ;               result - 2 : sender of buffer stopped
32561 106018  ;               result = 3 : message regretted
32562 106018  ;               result = 3 : illegal addresses in buffer
32563 106018  ;               result = 3 : operation in buffer not odd
32564 106018  
32564 106018  p42:            ; general copy:
32565 106018       m157       ;
32566 106019  
32566 106019  
32566 106019  
32566 106019  ; prepare backing storage
32567 106019  ;
32568 106019  ; call:
32569 106019  ;   w3.sender :  chainhead address
32570 106019  ;
32571 106019  ; return:
32572 106019  ;   w0.sender :  result = 0 : chaintable allocated
32573 106019  ;                result = 1 : function forbidden in calling process
32574 106019  ;                result = 1 : area claims exceeded
32575 106019  ;                result = 2 : catalog io-error
32576 106019  ;                result = 3 : auxcat name overlap
32577 106019  ;                result = 3 : auxcat name already exists
32578 106019  ;                result = 4 : document-device does not exist
32579 106019  ;                result = 4 : device is not a bs-device
32580 106019  ;                result = 4 : device not reserved by calling process
32581 106019  ;                result = 5 : auxcat size <= 0  or  auxcat size too large
32582 106019  ;                result = 5 : chainhead chain inconsistent
32583 106019  ;                result = 5 : auxcat    chain inconsistent
32584 106019  ;                result = 5 : illegal kind of chaintable
32585 106019  ;                result = 5 : key illegal
32586 106019  ;                result = 5 : too many slices
32587 106019  ;                result = 5 : claims exceeded (too few slices for chaintable)
32588 106019  ;                result = 5 : claims exceeded (auxcat too large)
32589 106019  ;                result = 5 : claims exceeded (no room in maincat)
32590 106019  ;                result = 6 : auxcat nameformat illegal
32591 106019  ;                result = 6 : docname nameformat illegal
32592 106019  ;                result = 7 : no chains idle
32593 106019  b. g10 h.
32594 106019  
32594 106019  p51:             ; prepare bs:
32595 106019       m8  , f71   ;    check function mask (aux catalog handling);
32596 106021       m86         ;    move chainhead.sender to work and test auxcat size > 0;
32597 106022             r5.   ;      auxcat size <= 0:  result 5;
32598 106023  ; test the auxcat name:
32599 106023       m70         ;    base.work := catalog interval;
32600 106024       m17         ;    test new system name (wrk-name not allowed):
32601 106025             r3.   ;      overlap:  result 3;
32602 106026             r3.   ;      exact  :  result 3;
32603 106027  ; test the document name:
32604 106027  ; notice: the reservation ensures that the document does not exist
32605 106027  ;         already in the bs-system
32606 106027       m85         ;    search bs-process and check reserved by sender:
32607 106028             r4.   ;      not found  or  not bs  or  not reserved:  result 4;
32608 106029       m70         ;    base.work := catalog interval;  (because moved again...)
32609 106030       m76         ;    test auxkey (and interval);
32610 106031  ; give all claims to sender:
32611 106031       m38         ;    find empty chain and prepare;
32612 106032       m20         ;    copy chaintable chain;
32613 106033  ; claim the slices used for chaintable:
32614 106033       m25         ;    test claims (prepare bs);
32615 106034             r5.   ;      claims exceeded:  result 5;
32616 106035       m19         ;    test chain errors;
32617 106036       m21         ;    copy chain and cut down (auxcat);
32618 106037  ; claim the slices used for auxcat:
32619 106037  ; (notice: the auxcat itself is not described in any catalog entry)
32620 106037       m25         ;    test claims (prepare bs);
32621 106038             r5.   ;      claims exceeded:  result 5;
32622 106039       m19         ;    test chain errors;
32623 106040  ; insert in maincat a description of the aux catalog
32624 106040  ; (if maincat does not exist yet, it will take place when
32625 106040  ;  the main catalog is connected)
32626 106040       m0  , g5.   ;    if no maincat yet then goto no maincat;
32627 106042       m33         ;    prepare maincat entry;
32628 106043       m30         ;    test claims (create):
32629 106044             r5.   ;      claims exceeded:  result 5;
32630 106045       m14         ;    compute namekey;
32631 106046       m55         ;    find empty entry;
32632 106047             r5.   ;      no room:  result 5;
32633 106048       m56         ;    modify cur entry;
32634 106049  g5:              ; no maincat:
32635 106049       m40         ;    terminate update of new chainhead;
32636 106050  ; notice: now the chain is included is the bs-system
32637 106050  ;         (still not ready for normal use)
32638 106050       m37 , t1    ;    state.chain := after prepare;
32639 106052       m46 , 0     ;    setup area process (procfunc) for auxcat;
32640 106054       m44         ;    set work1.area := no of keys.catalog
32641 106055       m47 , 2     ;    let sender be user and
32642 106057       m49         ;    reserver of auxcat area process;
32643 106058                   ;      (i.e. sender may now make any modifications
32644 106058                   ;      in the auxcat)
32645 106058                   ;       (hint: he could have done any damage before he
32646 106058                   ;       called ..prepare bs.. so why not let him have the
32647 106058                   ;       advantage of the area-process concept)
32648 106058       j0          ;    result ok;
32649 106059  
32649 106059  e.               ;
32650 106060  
32650 106060  
32650 106060  
32650 106060  ; insert entry
32651 106060  ;
32652 106060  ; call:
32653 106060  ;   w1.sender :  entry address
32654 106060  ;   w3.sender :  chainhead address
32655 106060  ;
32656 106060  ; return:
32657 106060  ;   w0.sender :  result = 0 : entry inserted in main catalog
32658 106060  ;                result = 1 : function forbidden in calling process
32659 106060  ;                result = 1 : no room
32660 106060  ;                result = 2 : catalog io-error
32661 106060  ;                result = 2 : document not found
32662 106060  ;                result = 2 : state of document does not permit this call
32663 106060  ;                result = 3 : name overlap
32664 106060  ;                result = 3 : name already exists
32665 106060  ;                result = 4 : calling process is not user of the device
32666 106060  ;                result = 5 : key illegal
32667 106060  ;                result = 5 : interval illegal
32668 106060  ;                result = 5 : chain overlap
32669 106060  ;                result = 5 : chain outside limits
32670 106060  ;                result = 6 : nameformat illegal
32671 106060  ;                result = 6 : docname format illegal
32672 106060  ;                result = 6 : claims exceeded
32673 106060  ;                result = 7 : maincat not present
32674 106060  ;
32675 106060  ; notice: the claims of the process are ok, when result = 0,3,(5),7
32676 106060  
32676 106060  b. g20 h.
32677 106060  
32677 106060  p52:             ; insert entry:
32678 106060       m8  , f71   ;    check function mask (aux catalog handling)
32679 106062       m109        ;    move chainhead.sender to work;
32680 106063       m84         ;    (size.work := 0;)
32681 106064       m36 , t21   ;    search chain (state = allowed for insert entry);
32682 106066       m9          ;    check privileges;
32683 106067       m37 , t2    ;    state.chain := during insert;
32684 106069       m107        ;    move entry.sender to work;
32685 106070       m76         ;    test auxkey, interval;
32686 106071  
32686 106071  ; notice: if the main catalog has been connected from this
32687 106071  ;         document, the chain has already been copied, and
32688 106071  ;         entry and slices claimed
32689 106071       m3          ;    if main-catalog entry then
32690 106072             r0.   ;      goto result ok;
32691 106073  
32691 106073       m21         ;    copy chain (entry) and cut down;
32692 106074       m0  , g20.  ;    if no maincat then goto claim slices only;
32693 106076       m30         ;    test claims (create entry):
32694 106077             r6.   ;      claims exceeded:  result 6;
32695 106078       m19         ;    test chain errors;
32696 106079       m17         ;    test new system name (wrk-name not allowed):
32697 106080             g15.   ;      overlap:  result 3;
32698 106081             g15.   ;      exact  :  result 3;
32699 106082  ; make it easy for changing the name of the document:
32700 106082       m88 , g5.   ;    if size.work >= 0 then
32701 106084       m66         ;      docname.work := docname.chain;
32702 106085       m125, g10.  ;    else
32703 106087  g5:              ;      begin
32704 106087       m90         ;      (prepare compute docnumber: prevent alarms)
32705 106088       m91         ;      first slice.work := compute docnumber;
32706 106089  g10:             ;      end;
32707 106089       m55         ;    find empty entry:
32708 106090             r1.   ;      no room:  result 1;
32709 106091       m56         ;    modify cur entry;
32710 106092       j0          ;    result ok;
32711 106093  ; 
32712 106093  ; entry cannot be inserted in maincat but the entry is already claimed.
32713 106093  ; unclaim 1 entry and 0 slices in main and auxcat and reclaim i entry in auxcat.
32714 106093  
32714 106093  g15: m280, r7.         ; unclaim entries . (hardly claims exceeded.)
32715 106095       m260, r7.         ; claim 1 aux entry.
32716 106097       j3               ; deliver result 3
32717 106098  
32717 106098  g20:             ; claim slices only:
32718 106098  ; main catalog not present, therefor don't claim a maincat entry
32719 106098       m26         ;    test claims (create aux entry);
32720 106099             r6.   ;      claims exceeded:  result 6;
32721 106100       m19         ;    test chain errors;
32722 106101       j7          ;    result 7;
32723 106102  
32723 106102  e.               ;
32724 106102  
32724 106102  
32724 106102  
32724 106102  ; insert backing storage
32725 106102  ;
32726 106102  ; call:
32727 106102  ;   w2.sender :  docname address
32728 106102  ;
32729 106102  ; return:
32730 106102  ;   w0.sender :  result = 0 : document included is bs-system
32731 106102  ;                result = 1 : function forbidden in calling process
32732 106102  ;                result = 2 : document not found
32733 106102  ;                result = 2 : state of document does not permit this call
32734 106102  ;                result = 4 : calling process is not user of device
32735 106102  ;                result = 6 : docname format illegal
32736 106102  
32736 106102  p53:             ; insert bs:
32737 106102       m8  , f71   ;    check function mask (aux catalog handling);
32738 106104       m104        ;    move docname.sender to docname.work;
32739 106105       m84         ;    (size.work := 0;)
32740 106106       m36 , t21   ;    search chain (state = allowed for insert bs);
32741 106108       m9          ;    check privileges;
32742 106109       m37 , t3    ;    state.chain := ready;
32743 106111       j0          ;    result ok;
32744 106112  
32744 106112  
32744 106112  
32744 106112  ; delete backing storage
32745 106112  ;
32746 106112  ; call:
32747 106112  ;   w2.sender :  docname address
32748 106112  ;
32749 106112  ; return:
32750 106112  ;   w0.sender :  result = 0 : document removed from bs-system
32751 106112  ;                result = 1 : function forbidden in calling process
32752 106112  ;                result = 2 : catalog io-error
32753 106112  ;                result = 2 : document not found
32754 106112  ;                result = 4 : calling process is not user of device
32755 106112  ;                result = 5 : areaprocesses exists for the document
32756 106112  ;                result = 6 : main catalog on the document
32757 106112  ;                result = 6 : docname format illegal
32758 106112  
32758 106112  p54:             ; delete bs:
32759 106112       m8  , f71   ;    check function mask (aux catalog handling);
32760 106114       m104        ;    move docname.sender to docname.work;
32761 106115       m84         ;    (size.work := 0);
32762 106116       m36 , t23   ;    search chain (state = allowed for delete bs);
32763 106118       m9          ;    check privileges;
32764 106119       m115        ;    check any area processes on document;
32765 106120       m1          ;    test main catalog not on document;
32766 106121       m116        ;    prepare catalog scan
32767 106122       m37 , t4    ;    state.chain := during delete;
32768 106124  
32768 106124       j0          ;    result ok;
32769 106125  
32769 106125  
32769 106125  
32769 106125  ; delete entries
32770 106125  ;
32771 106125  ; call:
32772 106125  ;   w2.sender :  docname address
32773 106125  ;
32774 106125  ; return:
32775 106125  ;   w0.sender :  result = 0 : all entries deleted (from main catalog)
32776 106125  ;                                 and chain released
32777 106125  ;                result = 1 : function forbidden in calling process
32778 106125  ;                result = 2 : catalog io-error
32779 106125  ;                result = 2 : document not found
32780 106125  ;                result = 2 : state of document does not permit this call
32781 106125  ;                result = 3 : not all entries deleted yet
32782 106125  ;                result = 4 : calling process is not user of device
32783 106125  ;                result = 6 : docname format illegal
32784 106125  
32784 106125  b. g10 h.
32785 106125  
32785 106125  p55:             ; delete entries:
32786 106125       m8  , f71   ;    check function mask (aux catalog handling);
32787 106127       m104        ;    move docname.sender to docname.work;
32788 106128       m84         ;    (size.work := 0;)
32789 106129       m36 , t4    ;    search chain (state = during delete);
32790 106131       m9          ;    check privileges;
32791 106132       m0          ;    if no maincat then
32792 106133             g10.  ;      goto clear up;
32793 106134  
32793 106134  ; clear a portion of the main catalog for entries belonging to curdoc
32794 106134       m118        ;    for all curkey entries in main catalog do
32795 106135             g5.   ;      begin
32796 106136       m122, g1.   ;      if entry on document then
32797 106138       m31         ;        prepare maincat entry;
32798 106139       m28         ;        test claims (remove):
32799 106140             r7.   ;          claims exceeded:  result 7;  (not possible)
32800 106141       m120        ;        delete entry;
32801 106142  g1:              ;
32802 106142       m119        ;      end for all entries;
32803 106143  g5:              ;
32804 106143       m121        ;    update entry count, if any deleted;
32805 106144       m117        ;    test more catalog segments to clean:
32806 106145             r3.   ;      more segments:  result 3;
32807 106146  
32807 106146  ; all entries, belonging to curdoc, has been removed from main catalog:
32808 106146  g10:             ; clear up:
32809 106146       m70         ;    base.work := catalog interval;
32810 106147       m67         ;    move auxcat name from chain to name.work;
32811 106148       m45         ;    search best area process:
32812 106149             r7.   ;      not found:  result 7;  (not possible)
32813 106150       m50         ;    (if area process then) delete area process;
32814 106151       m41         ;    terminate use of chain and disc;
32815 106152       m37 , t0    ;    state.chain := idle;
32816 106154       j0          ;    result ok;
32817 106155  
32817 106155  e.               ;
32818 106156  
32818 106156  
32818 106156  
32818 106156  ; connect main catalog
32819 106156  ;
32820 106156  ; call:
32821 106156  ;   w1.sender :  main catalog name address
32822 106156  ;   w3.sender :  chainhead address
32823 106156  ;
32824 106156  ; return:
32825 106156  ;   w0.sender :  result = 0 : main catalog connected
32826 106156  ;                result = 1 : function forbidden in calling process
32827 106156  ;                result = 1 : area claims exceeded
32828 106156  ;                result = 2 : catalog io-error
32829 106156  ;                result = 2 : document not found
32830 106156  ;                result = 2 : state of document does not permit this call
32831 106156  ;                result = 3 : name does not exist in auxcat
32832 106156  ;                result = 3 : name overlap
32833 106156  ;                result = 3 : name already exists
32834 106156  ;                result = 4 : calling process is not user of device
32835 106156  ;                result = 5 : maincat size <= 0  or  maincat size too large
32836 106156  ;                result = 5 : key illegal
32837 106156  ;                result = 5 : interval illegal
32838 106156  ;                result = 5 : chain overlap
32839 106156  ;                result = 5 : chain outside limits
32840 106156  ;                result = 6 : claims exceeded
32841 106156  ;                result = 6 : docname format illegal
32842 106156  ;                result = 7 : main catalog already present
32843 106156  
32843 106156  b. g10 h.
32844 106156  
32844 106156  p56:             ; connect main catalog:
32845 106156       m8  , f72   ;    check function mask (main catalog handling);
32846 106158       m0  , g1.   ;    if maincat already exists then
32847 106160       j7          ;      result 7;
32848 106161  g1:              ;
32849 106161       m109        ;    move chainhead.sender to work;
32850 106162       m84         ;    (size.work := 0;)
32851 106163       m36 , t21   ;    search chain (state = allowed for connect catalog);
32852 106165       m9          ;    check privileges;
32853 106166  ; prepare a search in auxcat for a main catalog:
32854 106166       m103        ;    move catalog name.sender to name.work;
32855 106167       m70         ;    base.work := catalog interval;
32856 106168       m17         ;    test new system name (wrk-name not allowed):
32857 106169             r3.   ;      overlap:  result 3;
32858 106170             r3.   ;      exact  :  result 3;
32859 106171       m4          ;    set auxcat;
32860 106172       m10         ;    search best entry (in aux catalog):
32861 106173             r3.   ;      not found:  result 3;
32862 106174       m87         ;    if size.work <= 0 then
32863 106175             r5.   ;      result 5;
32864 106176       m76         ;    test auxkey  (and interval);
32865 106177       m37 , t2    ;    state.chain := during insert;
32866 106179       m21         ;    copy chain and cut down;
32867 106180  ; claim an auxcat entry and the slices used for main catalog
32868 106180       m26         ;    set claims (create aux entry):
32869 106181             r6.   ;      claims exceeded :  result 6;
32870 106182       m19         ;    test chain errors;
32871 106183       m66         ;    docname.work := docname.curdoc;
32872 106184       m39         ;    set maincat and prepare claims
32873 106185       m46 , 0     ;    setup area process (procfunc) for main catalog area;
32874 106187       m44         ;    set work1.area := no of keys.catalog
32875 106188       m5          ;    set maincat;
32876 106189       m42         ;    clean main catalog;
32877 106190       m67         ;    move auxcat name from chain to name.work;
32878 106191       m70         ;    base.work := catalog interval;
32879 106192       m45         ;    search best area process:
32880 106193             r7.   ;      not found:  result 7;  (not possible)
32881 106194       m49         ;    let sender be user and  reserver of auxcat area process;
32882 106195                   ;      (see the hint in ..prepare backing storage..)
32883 106195  
32883 106195  ; insert all existing chainheads in main catalog
32884 106195       m123        ;    for all existing chaintables do
32885 106196             r0.   ;      begin
32886 106197       m31         ;      prepare maincat entry;
32887 106198       m30         ;      test claims (create);
32888 106199             r6.   ;        claims exceeded:  result 6;
32889 106200       m70         ;      base.work := catalog interval;
32890 106201       m14         ;      compute namekey;
32891 106202       m55         ;      find empty entry:
32892 106203             r6.   ;        no room:  result 6;
32893 106204       m56         ;      modify cur entry;
32894 106205       m119        ;      end for;
32895 106206                   ;    result ok;
32896 106206  
32896 106206  e.               ;
32897 106206  
32897 106206  
32897 106206  
32897 106206  ; remove main catalog
32898 106206  ;
32899 106206  ; return:
32900 106206  ;   w0.sender :  result = 0 : main catalog removed
32901 106206  ;                result = 7 : main catalog not present
32902 106206  
32902 106206  p57:             ; remove main catalog:
32903 106206       m8  , f72+f71;   check function mask (main catalog handling);
32904 106208       m0  , r7.   ;    if no maincat then result 7;
32905 106210       m68         ;    move maincat name from pseudo chainhead to name.work;
32906 106211       m70         ;    base.work := catalog interval;
32907 106212       m45         ;    search best area process:
32908 106213             r7.   ;      not found:  result 7;  (not possible)
32909 106214       m50         ;    (if area process then) delete area process;
32910 106215       m4          ;    set auxcat;  (i.e. prevent further use of main catalog)
32911 106216       m2          ;    clear maincat;
32912 106217       j0          ;    result ok;
32913 106218  
32913 106218  
32913 106218  
32913 106218  
32913 106218  ; lookup bs claims
32914 106218  ; call:
32915 106218  ; w1.sender :  claim list address
32916 106218  ; w2.sender :  document name address
32917 106218  ; w3.sender :  name address
32918 106218  
32918 106218  ; return:
32919 106218  ; w0.sender : result = 0 : bs claims looked up
32920 106218  ;             result = 2 : document not found
32921 106218  ;             result = 3 : process does not exist
32922 106218  ;             result = 6 : name format illegal
32923 106218  
32923 106218  
32923 106218  p59:                   ; lookup bs claims
32924 106218       m104              ; move docname.sender to docname.work 
32925 106219       m84               ; size.work:=0
32926 106220       m36,t22           ; search chain, state = allowed for normal use
32927 106222       m65               ; move catbase,name to work;
32928 106223       m51               ; find best internal process and move bs claims
32929 106224  
32929 106224  
32929 106224  
32929 106224  
32929 106224  ; create aux entry and area process
32930 106224  ;
32931 106224  ; call:
32932 106224  ;   w1.sender :  entry address
32933 106224  ;   w2.sender :  docname address
32934 106224  ;   w3.sender :  procname address
32935 106224  ;
32936 106224  ; return:
32937 106224  ;   w0.sender :  result = 0 : entry and areaprocess created
32938 106224  ;                result = 1 : function forbidden in calling process
32939 106224  ;                result = 1 : area claims exceeded
32940 106224  ;                result = 2 : catalog io-error
32941 106224  ;                result = 2 : document not found
32942 106224  ;                result = 2 : state of document does not permit this call
32943 106224  ;                result = 3 : procname overlap
32944 106224  ;                result = 3 : procname already exists
32945 106224  ;                result = 3 : entryname overlap (in auxcat)
32946 106224  ;                result = 3 : entryname already exists (in auxcat)
32947 106224  ;                result = 4 : calling process is not user of device
32948 106224  ;                result = 4 : claims exceeded
32949 106224  ;                result = 5 : key illegal
32950 106224  ;                result = 5 : interval illegal
32951 106224  ;                result = 6 : entryname format illegal
32952 106224  ;                result = 6 : procname  format illegal
32953 106224  ;                result = 6 : docname format illegal
32954 106224  
32954 106224  b. g10 h.
32955 106224  
32955 106224  p60:             ; create aux entry and area process:
32956 106224       m8  , f76   ;    check function mask (create aux entry);
32957 106226       m104        ;    move docname.sender to docname.work;
32958 106227       m84         ;    (size.work := 0;)
32959 106228       m36 , t28   ;    search chain (state = allowed for create aux);
32960 106230       m9          ;    check privileges;
32961 106231       m107        ;    move entry.sender to work;
32962 106232       m90         ;    first slice.work := 0;
32963 106233       m88 , g1.   ;    if size.work >= 0 then
32964 106235       m66         ;      docname.work := docname.chain;
32965 106236  g1:              ;
32966 106236       m76         ;    test auxkey and interval;
32967 106237  ; scan the auxcat to see if the new entry may be created:
32968 106237       m4          ;    set auxcat;
32969 106238       m18         ;    test new catalog name (in auxcat):
32970 106239             r3.   ;      overlap:  result 3;
32971 106240             r3.   ;      exact  :  result 3;
32972 106241       m37 , t6    ;    state.chain := during aux entry manipulation;
32973 106243       m22 , 2.10  ;    compute slices to claim  (compute new slices);
32974 106245       m26         ;    test claims (create aux entry):
32975 106246             r4.   ;      claims exceeded:  result 4;
32976 106247       m23         ;    adjust chain to size;
32977 106248       m55         ;    find empty entry:
32978 106249             r4.   ;      no room:  result 4;
32979 106250       m6          ;    dump chaintable;
32980 106251      m60          ;    clear access counters.work;
32981 106252      m56          ;    modify current entry;
32982 106253      m88 , g2.    ;    if size.work>=0 then
32983 106255      m62          ;      update and insert statarea;
32984 106256  g2:              ;
32985 106256  ; prepare for testing of the area-process name:
32986 106256       m5          ;    set maincat;
32987 106257       m100        ;    move name.sender to name.work;  (i.e. get procname)
32988 106258       m15         ;    test new system name (wrk-name allowed):
32989 106259             r3.   ;      overlap:  result 3;
32990 106260             r3.   ;      exact  :  result 3;
32991 106261       m46 , 2     ;    setup area process (sender);
32992 106263       m49         ;    let sender be reserver of the area-process;
32993 106264       m101        ;    move name.work back to name.sender (if wrk-name);
32994 106265       j0          ;    result ok;
32995 106266  
32995 106266  e.               ;
32996 106266  
32996 106266  
32996 106266  
32996 106266  ; remove aux entry
32997 106266  ;
32998 106266  ; call:
32999 106266  ;   w1.sender :  entry address
33000 106266  ;   w2.sender :  docname address
33001 106266  ;
33002 106266  ; return:
33003 106266  ;   w0.sender :  result = 0 : aux entry removed
33004 106266  ;                result = 1 : function forbidden in calling process
33005 106266  ;                result = 2 : catalog io-error
33006 106266  ;                result = 2 : document not found
33007 106266  ;                result = 2 : state of document does not permit this call
33008 106266  ;                result = 3 : entry does not exist (in auxcat)
33009 106266  ;                result = 6 : entry nameformat illegal
33010 106266  ;                result = 6 : docname format illegal
33011 106266  
33011 106266  p61:             ; remove aux entry:
33012 106266       m8  , f76   ;    check function mask (create aux);
33013 106268       m104        ;    move docname.sender to docname.work;
33014 106269       m84         ;    (size.work := 0;)
33015 106270       m36 , t28   ;    search chain (state = allowed for aux entry manipulation
33016 106272       m9          ;    test privileges;
33017 106273       m4          ;    set auxcat;
33018 106274       m107        ;    move entry.sender to work;
33019 106275  ; notice: there is no check upon legality of interval
33020 106275       m10         ;    search best entry (in auxcat):
33021 106276             r3.   ;      not found:  result 3;
33022 106277  ; notice: it is not checked that it was the rigth entry (i.e. same base)
33023 106277       m37 , t6    ;    state.chain := during aux entry manipulation;
33024 106279       m57         ;    delete cur entry;
33025 106280  ; notice: the entry- and slice-claims are not released, nor is the slice-chain
33026 106280       j0          ;    result ok;
33027 106281  
33027 106281  ; lookup aux entry
33028 106281  ; 
33029 106281  ; call:
33030 106281  ;   w1.sender : tail address
33031 106281  ;   w2.sender : docname address
33032 106281  ;   w3.sender : name address
33033 106281  ;
33034 106281  ;  return:
33035 106281  ;    w0.sender : result = 0 : entry looked up
33036 106281  ;                result = 2 : catalog input-output error
33037 106281  ;                result = 2 : document not ready( or does not exist
33038 106281  ;                result = 3 : entry not found
33039 106281  ;                result = 6 : name format illegal
33040 106281  ;                result = 7 : maincat not present
33041 106281  
33041 106281  p43:             ; lookup auxentry:
33042 106281       m0  , r7.   ;   check maincat
33043 106283       m65         ;   move catbase.name to work
33044 106284       m104        ;   move docname.sender to docname.work
33045 106285       m84         ;   size.work:=0
33046 106286       m36 , t3    ;   search chain (state ready)
33047 106288       m4          ;   set auxcat
33048 106289       m100        ;   move entry.sender to entry.work
33049 106290       m10         ;   seach best entry
33050 106291             r3.   ;   not found result 3
33051 106292       m106        ;   move tail.sender to tail.sender
33052 106293       m5          ;   set main cat
33053 106294       j0          ;   result ok
33054 106295  
33054 106295  ; clear statistics in aux entry
33055 106295  ; 
33056 106295  ;  call:
33057 106295  ;    w2.sender : dacname address
33058 106295  ;    w3.sender : name address
33059 106295  ; 
33060 106295  ;  return:
33061 106295  ;    w0.sender : result = 0 : the statistiks of the entry is initialised
33062 106295  ;                result = 2 : catalog input/output error
33063 106295  ;                result = 2 : document not ready(or does not exist)
33064 106295  ;                result = 3 : entry not found; name conflict(in auxcat)
33065 106295  ;                result = 6 : name format illegal; claims exceeded
33066 106295  ;                result = 7 : maincat not present
33067 106295  b.g10 h.
33068 106295  
33068 106295  p44:             ; 
33069 106295       m0  , r7.   ;   if no maincat then result 7
33070 106297       m65         ;   move catbase.sender to work
33071 106298       m104        ;   move docname.sender to docname.work
33072 106299       m84         ;   size.work:=0
33073 106300       m36 , t3    ;   search chain (state ready)
33074 106302       m4          ;   set aux cat
33075 106303       m100        ;   move entry.sender to entry.work
33076 106304       m10         ;   search best entry
33077 106305             r3.   ;     not found result 3
33078 106306       m88 , g0.   ;   if size.work>=0 then
33079 106308       m64         ;     move statarea.entry to statarea.work
33080 106309       m60         ;     clear access counters.work
33081 106310       m63         ;     move statarea.work to statarea.entry
33082 106311  g0:              ;
33083 106311       m5          ;   set main cat
33084 106312       j0          ;   result ok
33085 106313  e.
33086 106314  \f


33086 106314  
33086 106314  
33086 106314  
33086 106314  
33086 106314  n49:             ; start of monitor call-table:
33087 106314       p20., p21., p22., p23., p24., p25., p26., p27., p28., p29.,
33088 106324       p30., p31., p32., r7. , p34., p35., p36., p37., p38., p39.,
33089 106334       p40., r7. , p42., p43., p44. , p45., p46., r7. , r7. , r7. ,
33090 106344       r7. , p51., p52., p53., p54., p55., p56., p57., r7.,p59. ,
33091 106354       p60., p61.,
33092 106356  w.
33093 106356  
33093 106356  j0 = j0+n50 , j1 = j1+n50 , j2 = j2+n50 , j3 = j3+n50 , j4 = j4+n50 ,
33094 106356  j5 = j5+n50 , j6 = j6+n50 , j7 = j7+n50
33095 106356  
33095 106356  
33095 106356  
33095 106356  
33095 106356  ; record cat buf:
33096 106356  ;   this record holds the current catalog segment.  if its content is
33097 106356  ;   changed, then the segment is rewritten onto the backing store at
33098 106356  ;   the very end of all process function actions.
33099 106356  
33099 106356  d0: -1, r.f9>1                  ; cat buf (0:size-2);
33100 106866  d18: 0                          ;   last word of cat buf.
33101 106868  d19 = d0 - 2 + f10*f0           ;   abs addr of last word of last entry
33102 106868                                  ;      in cat buf.
33103 106868  
33103 106868  c.(:a92>22a.1:)-1
33104 106868  m.                procfunc testbuffer, start
33105 106868  d49=k, 0, r.100, d50=k
33106 106868  m.                procfunc testbuffer, top
33107 106868  z.
33108 106868  
33108 106868  ; interrupt address (used during debugging):
33109 106868  ;   proc func is entered here after programming errors.
33110 106868  
33110 106868  c.  (:a92>21a.1:) -1
33111 106868  e30: 0, r.a180>1                ; ia: save for registers;
33112 106884       jd      1<11+134  ; stop the system
33113 106886  z.c. -(:a92>21a.1:)             ;   else
33114 106886  e30 = 0,z.                      ;   ia:= 0;
33115 106886  
33115 106886  ; define the last b-names:
33116 106886  c.(:a399>23a.1:)-1
33117 106886  h.
33118 106886  0,r.(:(:(:(:k+2047:)/2048:)*2048:) - k:); (first address:=(first address+2047)//2048)*2048;
33119 106886  w.
33120 106886  z.
33121 106886  
33121 106886  b61 = k         ;   top address.proc func
33122 106886  b62 = e30       ;   interrupt address.proc func
33123 106886  b63 = j10+2     ;   waiting point
33124 106886  i.              ; id list of process functions
33125 106886  
33125 106886  ; after loading:
33126 106886  b.   g0                         ; begin
33127 106886  w.g0:al. w2   g0.               ; define last:
33128 106888       jl      x3                 ;   autoload(next segment,top proc func);
33129 106890  
33129 106890       jd.      g0.               ; after loading: goto define last;
33130 106892  e.                              ; end.  the load code is removed;
33131 106892    j21=k - b127 + 2
33132 106892  
33132 106892  k = b61         ; top proc func
33133 106886  e.              ; end proc func segment
33134 106886  
33134 106886  ; segment 7:  Initialize  process  functions
33135 106886  ;   this segment initializes the process descriptions for the first internal
33136 106886  ;   process (proc func). it is executed and then removed
33137 106886  ;   immediately after loading.
33138 106886  
33138 106886  s.   g6                      ; begin  init proc func:
33139 106886  w.b127=k, g6, k=k-2
33140 106886  
33140 106886  g0:  al. w2     g0.    ; after load: load address := top of procfunc;
33141 106888       jl      x3        ;    goto autoloader;
33142 106890       jl.        g0.    ; entry from autoloader: goto after load;
33143 106892  g6= k - b127 + 2
33144 106892  
33144 106892  k = b61                      ; k= first after proc func;
33145 106886  e.                           ; end init proc func
33146 106886  \f


33146 106886  
33146 106886  m.
33146 106886                  mons1 - operating system s, part 1 17.0 beta

33147 106886  ;88.05.06 14.30 kak   max buffer in connect dlc/ioc included
33148 106886  ;88.05.24 07.50 kak   change of cpa and address base included
33149 106886  ;88.06.07 08.00 kak   prepare dump included
33150 106886  ;88.06.14 10.00 kak   initialize main included
33151 106886  ;88 10 03 15.02 hsi   wait 1 second after each start command (c mixup)
33152 106886  ;88 10 12 09.55 kak   two new commands: privileged and unprivileged introducted
33153 106886  ;88 11 09 12.26 kak   error in find console corrected
33154 106886  ;89 01 17 13.50 kak   create child corrected: no bit 2 check if abs protection
33155 106886  ;                     description of command mask updated
33156 106886  ;89 02 27 08.30 kak   d59 insert in list of dummy names; used if ioc/lan is not included
33157 106886  ;89 03 13 14.06 kak   the last char read is saved, and may be used to detect end of line 
33158 106886  ;                     in commands with a variable number of paramters
33159 106886  ;89 05 31 13.15 hsi   set stack depth to 3, as in release 81
33160 106886  ;90 09 06 08.40 kak   *********************** RELEASE  17.0 ************************************
33161 106886  ;90 09 06 08.41 kak   procedure find parent console changed:
33162 106886  ;                     if the child is found in the coretable, the monitor procedure
33163 106886  ;                     process_description(console_name,pda) is called,
33164 106886  ;                     and the returned pda is used, if the process does not exist the main console is used.
33165 106886  ;                     the main declaration changed: g127 increased to g128
33166 106886  ;91 01 30 13.46 kak   the change from 90.09.06-08.41 is modified: the selection of the main console is moved to type_line (d23).
33167 106886  
33167 106886  
33167 106886  b.i30 w.
33168 106886  i0=91 02 01 
33169 106886  i1=11 53 00 
33170 106886  
33170 106886  ; if newtime (i0,i1) > oldtime (a133,a134) then oldtime:=newtime;
33171 106886  c.i0-a133
33172 106886  c.i0-a133-1, a133=i0, a134=i1, z.
33173 106886  c.i1-a134-1,          a134=i1, z.
33174 106886  z.
33175 106886  
33175 106886  i10=i0, i20=i1
33176 106886  
33176 106886  i15=i10/100000 , i10=i10-i15*100000 , i25=i20/100000 , i20=i20-i25*100000 
33177 106886  i14=i10/10000  , i10=i10-i14*10000  , i24=i20/10000  , i20=i20-i24*10000 
33178 106886  i13=i10/1000   , i10=i10-i13*1000   , i23=i20/1000   , i20=i20-i23*1000
33179 106886  i12=i10/100    , i10=i10-i12*100    , i22=i20/100    , i20=i20-i22*100
33180 106886  i11=i10/10     , i10=i10-i11*10     , i21=i20/10     , i20=i20-i21*10
33181 106886  
33181 106886  i2:<:                              date  :>
33182 106910  (:i15+48:)<16+(:i14+48:)<8+46
33183 106912  (:i13+48:)<16+(:i12+48:)<8+46
33184 106914  (:i11+48:)<16+(:i10+48:)<8+32
33185 106916  
33185 106916  (:i25+48:)<16+(:i24+48:)<8+46
33186 106918  (:i23+48:)<16+(:i22+48:)<8+46
33187 106920  (:i21+48:)<16+(:i20+48:)<8+ 0
33188 106922  
33188 106922  i3:  al. w0      i2.     ; write date:
33189 106924       rs  w0  x2  +0      ;   first free:=start(text);
33190 106926       al  w2       0      ;
33191 106928       jl      x3          ;   return to slang(status ok);
33192 106930  
33192 106930       jl.         i3.     ;
33193 106932  e.
33194 106932  j.
33194 106886                                date  91.02.01 11.53.00

33195 106886  
33195 106886  ; rc date
33196 106886  
33196 106886  ; segment 8: operating system s
33197 106886  
33197 106886  s. k=k, b1, h50,g128,f29,e109,d90, l90,c107,u109, v109, r105
33198 106886  w.b127=k, c70, k = k-2
33199 106886  
33199 106886  ; segment structure:
33200 106886  ;     definitions         (c names)
33201 106886  ;     utility procedures  (d names)
33202 106886  ;     variables           (e names)
33203 106886  ;     command actions     (g names)
33204 106886  ;     tables              (h names)
33205 106886  ;
33206 106886  ;     (i and j names are used locally)
33207 106886  
33207 106886  ; size options:
33208 106886  c0=k        ; first addr of s
33209 106886  ; c1=def below; size of console description
33210 106886  ; c2=def below; size of work area
33211 106886  c3=4       ; no of own work areas
33212 106886  c16= 3       ; stack depth ( of nested 'reads' )
33213 106886  c4=c3+1     ; no of own buffers
33214 106886  c5=2        ; no of own area processes
33215 106886  c7=7        ;     -    buf
33216 106886  c8=6        ;     -    area
33217 106886  c9=0        ;     -    internal
33218 106886  c10=8.7440   ;     -    function
33219 106886  ;c11=def below; size of core table entry
33220 106886  c12=12800    ; standard size
33221 106886  c.(:a399>23a.1:)-1
33222 106886  c12= 8.0003 0000  ; standard size mod 2k :=0;
33223 106886  z.
33224 106886  c13=20       ;     -    entries,perm,work device
33225 106886  c14=800      ;     -    segments,perm,work device
33226 106886  c81=a117/2    ; number of console desriptions (arbitrary choosen value)
33227 106886  c82=8.0760    ; standard mask
33228 106886  c84=-1       ; devno of 1st connection (select a free)
33229 106886  c89=8+12*a112       ; standard length of susercatentry
33230 106886  c100=1     ; number of privileged conseles
33231 106886  c.(:a399>21a.1:)-1
33232 106886  c107=162     ; min size for memory dump (prepare dump - dump)
33233 106886  z.
33234 106886  c15=k, <:disc:>,0,0   ; standard work device name
33235 106894  c36=k, <:slogarea:>, 0   ; default log-area of s
33236 106902  ; definition of chain head. chain heads may be
33237 106902  ; placed any where in the elements, but the location
33238 106902  ; must be the same in all sorts of chains
33239 106902  ;c69     ; susercatname
33240 106902  
33240 106902  c20=0        ; next chain element
33241 106902  c21=c20+2    ; last chain element
33242 106902  c23= 8.77740000       ; systemoptions: all commands, 
33243 106902                       ; terminals unblocked after start up.
33244 106902  
33244 106902  t.
33244 106902* type 

33245 106902  
33245 106902  ; options - operating system s
33246 106902  
33246 106902  m.
33246 106902    s size options

33247 106902  
33247 106902      c81 =   20  ; number of std terminals in common pool
33248 106902      c82 = 8.1760; standard mask
33249 106902      c84 =   31 ; device-no of first ida-connection
33250 106902  n.m.
33250 106902                  s size options included

33251 106902  
33251 106902  c4=c3+1; no of own buffers
33252 106902  c5=2   ; no of own area processes
33253 106902  
33253 106902  ; systemoptions:
33254 106902  ; systemoptions determine whether code is included for certain
33255 106902  ; commands. they are defined by bits in the identifier c23
33256 106902  ; as follows:
33257 106902  ;
33258 106902  ;    break:             c23=c23 o. 1<22
33259 106902  ;    include/exclude:   c23=c23 o. 1<21
33260 106902  ;    call:              c23=c23 o. 1<20
33261 106902  ;    list:              c23=c23 o. 1<19
33262 106902  ;    max:               c23=c23 o. 1<18
33263 106902  ;    replace:           c23=c23 o. 1<17
33264 106902  ;    all:               c23=c23 o. 1<16
33265 106902  ;    print:             c23=c23 o. 1<15
33266 106902  ; job:          c23=c23o.1<14
33267 106902  ;      terminals blocked after start up   c23=c23 o. 1<13
33268 106902  
33268 106902  ; testoptions:
33269 106902  ; testoptions are used during debugging of the system. they
33270 106902  ; are defined by bits in the identifier c24 as follows:
33271 106902  ;
33272 106902  ;    internal interrupt:     c24=c24 o. 1<23
33273 106902  ;    character testoutput:   c24=c24 o. 1<22
33274 106902  ;    parameter testoutput:   c24=c24 o. 1<21
33275 106902  ;    event testoutput:       c24=c24 o. 1<20
33276 106902  ;    work testoutput:        c24=c24 o. 1<19
33277 106902  ;    console testoutput:     c24=c24 o. 1<18
33278 106902  
33278 106902  c24 = a93
33279 106902  
33279 106902  ; definition of core table entry format:
33280 106902  
33280 106902  ;c20=def above; next entry
33281 106902  ;c21=def above; last entry
33282 106902  c17=c21+2    ; child
33283 106902  c18=c17+2    ; child terminal (subprocess)
33284 106902  c106=c18+2   ;  name of terminalprocess
33285 106902  c22=c106+8   ; segment no in susercat or -1
33286 106902  c19=c22+2    ; kind , name of alternative primary input
33287 106902  c93=c19+10   ; kind , name of alternative primary output
33288 106902  c11=c93+10+2 ; size of coretable entry
33289 106902  
33289 106902  ; definition of a console description format
33290 106902  ;c20=def above; next console
33291 106902  ;c21=def above; last console
33292 106902  c28=c21+2    ; access count        word
33293 106902  c25=c28+2    ; process description word
33294 106902  c26=c25+2    ; priority            halfword
33295 106902  c27=c26+1    ; command mask        halfword
33296 106902  c75=c27+1    ; terminal name       quadrouple
33297 106902  c29=c75+8    ; process name        quadrouple
33298 106902  c30=c29+8       ; first address      word
33299 106902  c31=c30+2        ; top address       word
33300 106902  c32=c31+2    ; buf claim           halfword
33301 106902  c33=c32+1    ; area claim;         halfword
33302 106902  c34=c33+1    ; internal claim;     halfword
33303 106902  c35=c34+1    ; function mask;      halfword
33304 106902  c37=c35+1    ; protection register;halfword
33305 106902  c38=c37+1    ; protection key;     halfword
33306 106902  c41=c38+1    ; max interval;       double
33307 106902  c42=c41+4    ; standard interval;  double
33308 106902  c39=c42+4    ; size;               word
33309 106902  c40=c39+2    ; program name;       quadrouble
33310 106902  c43=c40+8   ; user interval;      double
33311 106902  c95=c43+4    ; primin : kind , name
33312 106902  c96=c95+10   ; primout: kind , name
33313 106902  c97=c96+10   ; first logic address
33314 106902  c98=c97+2    ; cpa limit
33315 106902  c44=c98+2     ; entries temp oth device
33316 106902  c45=c44+2    ; segments temp oth device
33317 106902  c46=c45+2    ; entries perm oth device
33318 106902  c47=c46+2; segments perm on 0th device
33319 106902  ; ---
33320 106902  ;c44+n<3      ; entries temp nth device
33321 106902  ;c45+n<3      ; segments temp nth device
33322 106902  ;c46+n<3      ; entries perm nth device
33323 106902  ;c47+n<3      ; segments perm mth device
33324 106902  c48=c44+a112<3-2; last of console description
33325 106902  c1=c48+2       ; size of console description
33326 106902  
33326 106902  ;last part of console buffer will be cleared at each call of 
33327 106902  ; new , all , get or job.
33328 106902  c49=c95      ; first parameter to be cleared
33329 106902  
33329 106902  ; meaning of command mask:
33330 106902  ; bit  0:(not used)
33331 106902  ; bit  1:all bs resources
33332 106902  ; bit  2:mode,modify,print,date
33333 106902  ; bit  3:job,start,stop,break,dump,list,max,remove,proc,prog,load,read,unstack,i,o,get,removelink
33334 106902  ; bit  4:include,exclude
33335 106902  ; bit  5:size,pr,pk,login,user,project,,prio,base,relocate
33336 106902  ; bit  6:addr,function,buf,area,internal,key,bs,temp,perm,all,call,
33337 106902  ;       connect, disconnect, initkit, link, linkall, unlink,cpa,memdump,preparedump
33338 106902  ; bit  7:new,create,run,init,createlink
33339 106902  ; bit  8:privileged:  autorel,closec,lock,jobremove,privileged,unprivileged,cleanup,unlock
33340 106902  ; bit  9:absolute protection
33341 106902  ; bit 10:absolute address
33342 106902  ; bit 11:not used
33343 106902  
33343 106902  ; definition of work area format:
33344 106902  
33344 106902  c50=0        ; state (=0=> available: <> 0 => buff addr)
33345 106902  c51=c50+2    ; restart addr
33346 106902  ; *** start of part to be saved-restored
33347 106902  c90=c51+2      ; name area
33348 106902  c78=c90+10   ; used in list, connect, disconnect,linkall
33349 106902  c80=c78+2
33350 106902  c79=c80+2    ; segment in susercat
33351 106902  c91=c79+2    ; continue indicator
33352 106902  c83=c91+2    ; subroutine return address
33353 106902  c92=c83+4    ; cur catalogbase: lower upper limit
33354 106902  c52=c92+2    ; console
33355 106902  c53=c52+2    ; last addr
33356 106902  c54=c53+2    ; char shift
33357 106902  c55=c54+2    ; char addr
33358 106902  c56=c55+2    ; chilel
33359 106902  c74=c56+2    ; terminal address
33360 106902  c101=c74+2   ; device no of disc containing description
33361 106902  c102=c101+2  ; physical disc device no
33362 106902  c103=c102+2  ; pointer in disc description
33363 106902  c105=c103+2  ; size of log disc description
33364 106902  c57=c105+2   ; core table entry
33365 106902  ; *** end of part to be saved-restored
33366 106902  c58=c57+2    ; input stack pointer
33367 106902  c59=c58+2    ; first stack element
33368 106902    ; subformat of stack entry:
33369 106902    ; name + nta of area
33370 106902    ; cur catalog base lower limit
33371 106902    c68=12       ; upper limit
33372 106902    c60=c68+2    ; segment no
33373 106902    c61=c60+2    ; saved last addr
33374 106902    c62=c61+2    ; saved char shift
33375 106902    c63=c62+2    ; saved char addr
33376 106902    c64=c63+2    ; (size of entry)
33377 106902  c71=c16*c64+c59; (top of stack)
33378 106902  c72=c71-c64  ; last stack entry start
33379 106902  c73=c59-c64  ; base of stack
33380 106902  c65=c71+2    ; output buffer start
33381 106902  c66=c65+46   ; input buffer start; often output buffer top
33382 106902  c67=c66+52   ; last addr of buffer
33383 106902  c2=c67+2     ; size of a work area
33384 106902  ; the input buffer may be overwritten by output in certain cases
33385 106902  
33385 106902  ; meaning of work area state:
33386 106902  ; state=0           available
33387 106902  ; state=buf addr    waiting for answer
33388 106902  
33388 106902  ; procedure type internal
33389 106902  ; comment: internal interrupt procedure used during debugging
33390 106902  ; of s.
33391 106902  d0:
33392 106902  c.(:c24>23a.1:)-1       ; if internal interrupt then
33393 106902  w.    0,r.a180>1        ; begin
33394 106918  b.i24 w.
33395 106918      am        (b4)    ;
33396 106920      rl  w0     a199<1 ;
33397 106922       rs. w0     (i5.)   ;   terminal:=main console;
33398 106924       jl. w3     d24.     ;   find_and_select_console_1(mainconsole);
33399 106926       jl.          0      ;+2: not found: wait forever;
33400 106928       rs. w1     (i2.)     ;   console:=main console;
33401 106930       jl. w3     d19.     ;   init write;
33402 106932       al. w1      i0.     ;
33403 106934       jl. w3     d21.     ;   write text(<:s-break:>);
33404 106936       al. w2      d0.     ;
33405 106938  
33405 106938  i1:  al  w0      32      ; next:
33406 106940       jl. w3     d20.     ;   write char(sp);
33407 106942       rl  w1  x2          ;
33408 106944       jl. w3     d22.     ;   write integer(param);
33409 106946       al  w2  x2  +2      ;
33410 106948       se. w2      d0.+a180;   if not all printed then
33411 106950       jl.         i1.     ;     goto next;
33412 106952  
33412 106952       al  w0      10      ;
33413 106954       jl. w3     d20.     ;   writechar(nl);
33414 106956       jl. w3     d23.     ;   type line(buf);
33415 106958       al. w1     (i3.)     ;
33416 106960       jd     1<11+18      ;   wait answer(buf);
33417 106962       al  w2    -1        ;   executing reentrant code := true;
33418 106964       rs. w2    (i6.)     ;
33419 106966       jl.       (i4.)   ;   goto end line;
33420 106968  
33420 106968  i0:<:<10>s-break:<0>:>  ;
33421 106976   i2: e25
33422 106978   i3: e32
33423 106980  i4:  g30               ;
33424 106982  i5:e90
33425 106984  i6:  e89                 ;
33426 106986  e.
33427 106986  z.                      ; end
33428 106986  
33428 106986  b. i20, j20 w.
33429 106986  
33429 106986  i0:  0                 ; saved link
33430 106988  i1:  0                 ; saved w3
33431 106990  i2:  0                 ; saved w0
33432 106992  i3:0                   ; saved w1
33433 106994  
33433 106994  i5:  h20               ; first of buffer
33434 106996  
33434 106996  j0:  g3                ; end line: not allowed
33435 106998  j1:  g12               ; end line: area unknown
33436 107000  j2:  g15               ; end line: area error
33437 107002  j3:  g19               ; end line: base illegal
33438 107004  
33438 107004  j5:  e24               ; pointer to: work
33439 107006  j6:  e26               ; pointer to: last addr
33440 107008  j7:  e28               ; pointer to: char addr
33441 107010   j8: e27               ; pointer to: char shift
33442 107012  
33442 107012  j10: e47               ; pointer to: area input mess
33443 107014  j11: e49               ; pointer to: last of buffer
33444 107016  j12: e50               ; pointer to: segment number
33445 107018  j13: e32               ; pointer to: answer
33446 107020  
33446 107020  j14: e51               ; pointer to: tail
33447 107022  j15: e75               ; pointer to: cur catalogbase
33448 107024  j16: e76               ; pointer to: max catalogbase
33449 107026  
33449 107026  
33449 107026  ; procedure stack input
33450 107026  ;   stacks the input pointers and selects the given area for input
33451 107026  ;   and sets current catalogbase
33452 107026  ;
33453 107026  ; call: w0,w1=catalogbase, w2=name, w3=link
33454 107026  ; exit: all regs undef
33455 107026  
33455 107026  d79:                   ; stack input:
33456 107026       rs. w3     i0.    ;   save return;
33457 107028  
33457 107028       ds. w1      i3.   ;   save catalog base;
33458 107030       jl. w3     d84.   ;   set s-catalog base(cur catalog base);
33459 107032       jl.       (j3.)   ;+0: base illegal;
33460 107034                         ;+2: ok
33461 107034       al  w3     x2     ;   w3=name addr;
33462 107036       rl. w1     j14.   ;   w1=tail addr;
33463 107038       jd    1<11+42     ;   lookup entry(name,tail);
33464 107040       lo  w0  x1+16     ;   if result<>ok or tail.content,key<>0 <* i.e. text *>
33465 107042       se  w0     0      ;     then goto unknown;
33466 107044       jl.       i11.    ;
33467 107046                         ;
33468 107046       rl. w1    (j5.)   ;   w1 := work;
33469 107048       rl  w3  x1+c58    ;   w3 := stack pointer;
33470 107050       sn  w3  x1+c72    ;   if stack pointer = last stack entry then
33471 107052       jl.       i13.    ;     goto not allowed; (* i.e. stack overflow *)
33472 107054  
33472 107054       al  w3  x3+c64    ;   increase (stack pointer);
33473 107056       rs  w3  x1+c58    ;
33474 107058  
33474 107058       rl. w1    (j6.)   ;
33475 107060       rs  w1  x3+c61    ;   save last addr in stack entry;
33476 107062       dl. w1    (j7.)   ;
33477 107064       ds  w1  x3+c63    ;   save char shift and char addr in stack entry;
33478 107066       dl. w1    (j15.)  ;
33479 107068       ds  w1  x3+c68    ;   save cur catalog base;
33480 107070  
33480 107070  
33480 107070       dl  w1  x2+2      ;   move name to stack entry;
33481 107072       ds  w1  x3+2      ;
33482 107074       dl  w1  x2+6      ;
33483 107076       ds  w1  x3+6      ;
33484 107078  
33484 107078  ; prepare variables for immediately buffer change
33485 107078  ; and set cur catalog base
33486 107078       dl. w1      i3.   ;   set cur catalog base;
33487 107080       ds. w1    (j15.)  ;
33488 107082       al  w0    -1      ;
33489 107084       rs  w0  x3+c60    ;   segment.stack entry := -1;
33490 107086  
33490 107086       rl. w2     i0.    ;   w2 := return;
33491 107088       jl.        d82.   ;   goto next segment;
33492 107090  
33492 107090  
33492 107090  
33492 107090  ; procedure unstack input
33493 107090  ;   restores the char pointers from the stack, and maybe also the buffer
33494 107090  ;   and cur catalog base
33495 107090  ;
33496 107090  ; call: w2=link
33497 107090  ; exit: all regs undef
33498 107090  
33498 107090  d80:                   ; unstack input:
33499 107090       rl. w1    (j5.)   ;   w1 := work;
33500 107092       rl  w3  x1+c58    ;   w3 := stack pointer;
33501 107094       sn  w3  x1+c73    ;   if stack pointer = stack base then
33502 107096       jl      x2        ;     return;
33503 107098  
33503 107098       al  w0  x3-c64    ;
33504 107100       rs  w0  x1+c58    ;   decrease (stack pointer);
33505 107102  
33505 107102       dl  w1  x3+c63    ;
33506 107104       ds. w1    (j7.)   ;   restore char shift and char addr from stack entry;
33507 107106       rl  w1  x3+c61    ;
33508 107108       rs. w1    (j6.)   ;   restore last addr from stack entry;
33509 107110       dl  w1  x3+c68    ;   restore cur catalog base
33510 107112       ds. w1    (j15.)  ;
33511 107114  
33511 107114       jl.        d81.   ;   goto get segment;
33512 107116  
33512 107116  
33512 107116  
33512 107116  ; procedure get segment
33513 107116  ; 
33514 107116  ; call: w2 = link
33515 107116  ; exit: w1,w2,w3=unch, w0=undef
33516 107116  
33516 107116  d81:                   ; get segment:
33517 107116       am         0-1    ;   increment := 0;
33518 107118  
33518 107118  ; procedure get next segment
33519 107118  ;
33520 107118  ; call: w2 = link
33521 107118  ; exit: w1,w2,w3=unch, w0=undef
33522 107118  
33522 107118  d82:                   ; next segment:
33523 107118       al  w0     1      ;   increment := 1;
33524 107120  
33524 107120  ; procedure read segment
33525 107120  ;
33526 107120  ; call: w0 = increment, w2 = link
33527 107120  ; exit: w1,w2,w3=unch, w0=undef
33528 107120  
33528 107120  d83:                   ; read segment:
33529 107120       ds. w3     i1.    ;   save return, w3;
33530 107122       rs. w1     i3.    ;   save w1;
33531 107124  
33531 107124       rl. w1    (j5.)   ;   w1 := work;
33532 107126       rl  w3  x1+c58    ;   w3 := stack pointer;
33533 107128       sn  w3  x1+c73    ;   if stack pointer = stack base then
33534 107130       jl.        i10.   ;     goto return;
33535 107132  
33535 107132       rl. w1     i5.    ;   w1 := first of buffer;
33536 107134       al  w2  x1+510    ;   w2 := last of buffer;
33537 107136       ds. w2    (j11.)  ;
33538 107138  
33538 107138       sn  w0     0      ;   if increment <> 0 then
33539 107140       jl.        i8.    ;     begin
33540 107142       rs. w2    (j6.)   ;     last addr := last of buffer;
33541 107144       rs. w1    (j7.)   ;     char addr := first of buffer;
33542 107146       al  w1    -16     ;
33543 107148       rs. w1    (j8.)   ;     char shift := -16;
33544 107150  i8:                    ;     end;
33545 107150  
33545 107150       wa  w0  x3+c60    ;   segment := segment + increment;
33546 107152       rs  w0  x3+c60    ;
33547 107154       rs. w0    (j12.)  ;
33548 107156  
33548 107156       al  w2  x3        ;   save nameaddr;
33549 107158       dl. w1    (j15.)  ;
33550 107160                         ;
33551 107160       jl. w3     d84.   ;   set s-catalog base(cur catalog base);
33552 107162       jl.        (j3.)  ;+0: error: base illegal;
33553 107164                         ;+2: ok:
33554 107164       al  w3  x2        ;   restore nameaddr;
33555 107166       jd         1<11+92;   create entry lock process(area name);
33556 107168       se  w0     0      ;   if result <> ok then
33557 107170       jl.        i12.   ;     goto area error;
33558 107172  
33558 107172       al. w1    (j10.)  ;
33559 107174       jd         1<11+16;   send message (area input, area name);
33560 107176       al. w1    (j13.)  ;
33561 107178       jd         1<11+18;   wait answer(answer area);
33562 107180       rl  w1  x1        ;
33563 107182       lo  w1     0      ;   w1 := status 'or' result;
33564 107184       jd         1<11+64;   remove process (area name);
33565 107186       se  w1     1      ;   if any arror then
33566 107188       jl.        i12.   ;     goto area error;
33567 107190  
33567 107190  i10:                   ; return:
33568 107190       dl. w1    (j16.)  ;
33569 107192       jl. w3     d84.   ;   set s-catalog base(max catalog base);
33570 107194       jl.       (j3.)   ;+0: base illegal;
33571 107196                         ;+2: ok
33572 107196       al  w1       0    ;   areabuf := defined;
33573 107198       rs. w1    (u87.)  ;
33574 107200  
33574 107200       rl. w1     i3.    ;   restore regs;
33575 107202       dl. w3     i1.    ;
33576 107204       jl      x2        ;   return;
33577 107206  
33577 107206  i12: am        j2.-j1. ;error return: area error
33578 107208  i11: am        j1.-j0. ;            : area unknown
33579 107210  i13: am        j0.-j0. ;            : not allowed
33580 107212       rl. w2     j0.    ;
33581 107214       rl. w1     (j5.)  ;   stackpointer := stackbase;
33582 107216       al  w0  x1+c73    ;
33583 107218       rs  w0  x1+c58    ;
33584 107220       dl. w1    (j16.)  ;
33585 107222       jl. w3     d84.   ;   set s-catalog base(max catalog base);
33586 107224       am         0      ;+0: base illegal, ignore;
33587 107226       jl      x2        ; return
33588 107228  
33588 107228  
33588 107228  
33588 107228  e.                     ;
33589 107228  
33589 107228  ; procedure set s-catalog base(new base)
33590 107228  ;        call         return, ok: link+2,  error: link
33591 107228  ; w0: lower limit        lower limit
33592 107228  ; w1: upper limit        upper limit
33593 107228  ; w2:     -              unchange
33594 107228  ; w3: link               link
33595 107228  ;
33596 107228  
33596 107228  b. i5 w.
33597 107228  i0:  0                 ; process name = 0
33598 107230  i1:  0                 ; save w2
33599 107232  i2:  0                 ; save w3
33600 107234  
33600 107234  d84:                   ; begin
33601 107234       ds. w3     i2.    ;
33602 107236       al. w3     i0.    ;   name = 0;
33603 107238       jd      1<11+72   ;   set catalog base(name, lower, upper);
33604 107240       dl. w3     i2.    ;
33605 107242       sn  w0     0      ;   if result=ok then
33606 107244       am        +2      ;     goto link+2
33607 107246       jl      x3        ;   else goto link;
33608 107248                         ; end;
33609 107248  
33609 107248  e.
33610 107248  
33610 107248  
33610 107248  ; procedure next char(char,type)
33611 107248  ; comment: unpacks and classifies the next character from
33612 107248  ; the console buffer:
33613 107248  ;     character type:
33614 107248  ;     0   <letter>
33615 107248  ;     1   <digit>
33616 107248  ;     2   <radix point or minus sign>
33617 107248  ;     3   <space>
33618 107248  ;     4   <separator>
33619 107248  ;     5   <end line>
33620 107248  ;     6   <other graphic>
33621 107248  ;     7   <blind>
33622 107248  ;     call:     return:
33623 107248  ; w0            char
33624 107248  ; w1            type
33625 107248  ; w2            destroyed
33626 107248  ; w3  link      destroyed
33627 107248  
33627 107248  b.i24                   ; begin
33628 107248  w.d1: rs.w3      i5.   ;   save link;
33629 107250  i2:  dl. w2    (u28.)  ;
33630 107252       sh  w1       0      ;   if charshift>0 then
33631 107254       jl.         i0.     ;   begin
33632 107256       al  w1    -16     ;   char shift := -16;
33633 107258       al  w2  x2+2      ;   char addr := char addr + 2;
33634 107260       rl. w3    (u26.)  ;
33635 107262       sh  w2    x3      ;   if char addr > last addr then
33636 107264       jl.        i0.    ;     begin
33637 107266       al  w0     10     ;     char := newline;
33638 107268       rl. w1     (u24.)   ;
33639 107270       rl  w2  x1+c58    ;
33640 107272       sn  w2  x1+c73    ;     if stack pointer = stack base then
33641 107274       jl.        i1.    ;       goto classify char;  (* i.e. not end of area-read-buffer *)
33642 107276       jl. w2     d82.   ;     get next segm;
33643 107278       jl.        i2.    ;     goto next char;
33644 107280                         ;     end;
33645 107280  i0:  rl  w0  x2  +0      ;
33646 107282       ls  w0  x1  +0      ;   char:=word(charaddr) shift charshift;
33647 107284       la. w0      i3.     ;   char:=char(17:23);
33648 107286       al  w1  x1  +8      ;   charshift:=charshift+8;
33649 107288       ds. w2    (u28.)  ;
33650 107290  i1:                    ; classify char:
33651 107290       rl  w1       0      ;
33652 107292       ls  w1      -2      ;
33653 107294       wa. w1     (u5.)    ;
33654 107296       bz  w1  x1  +0      ;   entry:=byte(chartable+char/4);
33655 107298       so  w0       2.10   ;   type:=
33656 107300       ls  w1      -6      ;   if char mod 4=0 then entry(0:2) else
33657 107302       so  w0       2.01   ;   if char mod 4=1 then entry(3:5) else
33658 107304       ls  w1      -3      ;   if char mod 4=2 then entry(6:8) else
33659 107306       la. w1      i4.     ;                        entry(9:11);
33660 107308       rs. w0     (u109.)  ;   save last read char;
33661 107310       jl.         (i5.)    ;   end;
33662 107312  i3:8.177             ;
33663 107314  i4:8.7               ;
33664 107316  i5: 0                ;
33665 107318  
33665 107318  e.                      ; end
33666 107318  
33666 107318  ; procedure next param(type)
33667 107318  ; comment: converts and classifies the next parameter from
33668 107318  ; the console buffer.
33669 107318  ;      parameter type:
33670 107318  ;      0   <empty>
33671 107318  ;      1   <name>
33672 107318  ;      2   <integer>
33673 107318  ;      3   <unknown>
33674 107318  ;      call:     return:
33675 107318  ; w0             type
33676 107318  ; w1             unchanged
33677 107318  ; w2             unchanged
33678 107318  ; w3   link      link
33679 107318  
33679 107318  b.i24,j10               ; begin
33680 107318  w.d2: rs. w3   (u60.)   ;
33681 107320       ds. w2    (u59.)   ;
33682 107322       rl. w1    (u87.)   ;
33683 107324       se  w1       0     ;   if area buf undefined then
33684 107326       jl. w2     d81.   ;     get segment;
33685 107328       al  w1       0     ;
33686 107330       rs. w1    (u87.) ;   areabuf := defined;
33687 107332  
33687 107332       al  w0     0      ;   param type := 0;
33688 107334       ds. w1    (u19.)   ;   char_count:=0;
33689 107336       ds. w1    (u21.)   ;
33690 107338       ds. w1    (u23.)   ; name:=0
33691 107340       rs. w0     i5.     ; char_count:=0;
33692 107342       al  w0      10      ;
33693 107344       rl. w1    ( u6.)   ;   radix:=10;
33694 107346       ds. w1    (u57.)   ;   state:=param table;
33695 107348  
33695 107348  d3:  jl. w3      d1.     ; continue:
33696 107350       wa. w1    (u57.)    ;   next char(char,type);
33697 107352       bz  w1  x1  +0      ;   entry:=byte(state+type);
33698 107354       al  w2     0      ;
33699 107356       ld  w2      -2      ;   action:=entry(0:9);
33700 107358       ls  w2     -19      ;
33701 107360       wa. w2    ( u6.)    ;   state:=
33702 107362       rs. w2    (u57.)    ;   param table+8*entry(10:11);
33703 107364       jl.     x1 +d2.     ;   goto action;
33704 107366  
33704 107366  d4:  rl. w3    (u19.)    ; letter:
33705 107368       jl. w1     j5.      ;   insert_next_char(letter);
33706 107370       rl. w3    (u19.)    ;
33707 107372       al  w3  x3  +1      ;
33708 107374       al  w2       1      ;   char_count:=char_count+1;
33709 107376       ds. w3    (u19.)    ;   param type:=1;
33710 107378       jl.         d3.     ;   goto continue;
33711 107380  d5:  se  w0      45      ; radix or minus
33712 107382       jl.         j1.     ; if minus then
33713 107384       al  w3      -1      ;
33714 107386       rs. w3      i4.     ;
33715 107388       jl.         d3.     ;
33716 107390  
33716 107390  j1:  al  w3       0      ; 
33717 107392       rx. w3    (u19.)    ;   radix:=integer;
33718 107394       rs. w3    (u56.)    ;   integer:=0;
33719 107396       jl.         d3.     ;   goto continue;   
33720 107398  
33720 107398  d6:  rl. w3    (u19.)    ; digit:
33721 107400       wm. w3    (u56.)    ;
33722 107402       al  w3  x3 -48      ;   integer:=
33723 107404       wa  w3       0      ;   integer*radix-48+char;
33724 107406       al  w2       2      ;   param type:=2;
33725 107408       ds. w3    (u19.)    ;
33726 107410                           ;
33727 107410       rl. w3     i5.      ;
33728 107412       jl. w1     j5.      ;   insert_next_char(digit);
33729 107414       rl. w3     i5.      ;
33730 107416       al  w3  x3+1        ;
33731 107418       rs. w3     i5.      ;   char_count:=char_count+1;
33732 107420       jl.         d3.     ;   goto continue;
33733 107422  
33733 107422  d11:                     ; newline or semicolon:
33734 107422       sn  w0     10       ;
33735 107424       jl.        d8.      ;   while char <> newline do
33736 107426       jl. w3     d1.      ;     next char;
33737 107428       jl.        d11.     ;   goto delimiter;
33738 107430  
33738 107430  d13:                     ; alfa_num:
33739 107430       rl. w3     i5.      ;
33740 107432       rs. w3    (u19.)    ;   char_count.letter:=char_count.digit;
33741 107434       jl. w3     d4.      ;   goto letter;
33742 107436  
33742 107436  d7:                      ; unknown:
33743 107436       sn  w0     25       ;   if char = em then
33744 107438       jl. w2     d80.     ;     unstack input;
33745 107440       al  w2     3        ;
33746 107442       rs. w2    (u18.)    ;   param type:=3;
33747 107444  d8:  rl. w0    (u18.)    ; delimiter:
33748 107446       rl. w2    (u18.)    ;
33749 107448       se  w2       2      ;
33750 107450       jl.         j2.     ;
33751 107452       rl. w3      i4.     ;
33752 107454       sl  w3     0        ;
33753 107456       jl.        j3.      ;
33754 107458       rl. w3    (u19.)    ;
33755 107460       ac  w3  x3          ;
33756 107462  j3:  sh  w3      -1      ;
33757 107464       rs. w3    (u19.)    ;
33758 107466       rs. w2      i4.     ;
33759 107468  j2:  dl. w2    (u59.)    ;
33760 107470       rl. w3    (u60.)    ;
33761 107472       jl      x3          ; return;
33762 107474  i0:3                     ;
33763 107476  i4:0                     ; sign
33764 107478  i5:0                     ; char_count;
33765 107480  ;
33766 107480  j5:                      ; procedure insert_next_char(char);
33767 107480                           ; begin
33768 107480       sl  w3      11      ;   if char_count>=10
33769 107482       jl.         d7.     ;   then goto unknown;
33770 107484       al  w2       0      ;
33771 107486       wd. w3      i0.     ;
33772 107488       ls  w2       3      ;   char:=char shift
33773 107490       ac  w2  x2 -16      ;   (16-char_count mod 3 * 8);
33774 107492       ls  w0  x2  +0      ;
33775 107494       ls  w3       1      ;   addr:=name+char_count/3*2;
33776 107496       am.       (u20.)    ;
33777 107498       lo  w0  x3+0        ;
33778 107500       am.       (u20.)    ;
33779 107502       rs  w0  x3+0        ;   word(addr):=word(addr) or char;
33780 107504       jl      x1          ; end;
33781 107506  
33781 107506  e.                       ; end
33782 107506  
33782 107506  ; procedure next name
33783 107506  ; comment: checks that the next parameter from the console
33784 107506  ; buffer is a name:
33785 107506  ;      call:     return:
33786 107506  ; w0             type
33787 107506  ; w1             unchanged
33788 107506  ; w2             unchanged
33789 107506  ; w3   link      link
33790 107506  
33790 107506  b.i24                   ; begin
33791 107506  w.d15:rs. w3  i0.       ;
33792 107508       jl. w3      d2.     ;   next param(type);
33793 107510       se  w0       1      ;   if type<>1
33794 107512       jl.        (i2.)    ;   then goto end line;
33795 107514       jl.        (i0.)    ;
33796 107516  i0:0                 ; end
33797 107518  i2: g2
33798 107520  
33798 107520  
33798 107520  ; procedure next integer(integer)
33799 107520  ; comment: checks that the next parameter from the console
33800 107520  ; buffer is an integer.
33801 107520  ;      call:     return:
33802 107520  ; w0             integer
33803 107520  ; w1             unchanged
33804 107520  ; w2             unchanged
33805 107520  ; w3   link      link
33806 107520  
33806 107520  w.d16:rs. w3  i0.       ; begin
33807 107522       jl. w3      d2.     ;   next param(type);
33808 107524       se  w0       2      ;   if type<>2
33809 107526       jl.        (i2.)    ;   then goto end line;
33810 107528       rl. w0     (u19.)   ;
33811 107530       jl.        (i0.)    ;
33812 107532  e.                      ; end
33813 107532  
33813 107532  
33813 107532  ; procedure increase access(console)
33814 107532  ; comment sets the access counter of a given console.
33815 107532  ;
33816 107532  ;        call             return
33817 107532  ; w0:                     unchanged
33818 107532  ; w1: console             console
33819 107532  ; w2:                     unchanged
33820 107532  ; w3: link                link
33821 107532  ;
33822 107532  b. i24 w.
33823 107532  
33823 107532  d9:                      ; begin
33824 107532       rs. w0        i0.   ;
33825 107534       al  w0         1    ;   console.access count:=1;
33826 107536       rs  w0    x1+c28    ;
33827 107538       rl. w0        i0.   ;
33828 107540       jl        x3        ; end;
33829 107542  
33829 107542  
33829 107542  ; procedure decrease access(console);
33830 107542  ; comment resets the access counter of a given console.
33831 107542  ;
33832 107542  ;       call               return
33833 107542  ; w0:                      unchanged
33834 107542  ; w1: console              console
33835 107542  ; w2:                      unchanged
33836 107542  ; w3: link                 link
33837 107542  ;
33838 107542  
33838 107542  d10:                     ; begin
33839 107542       rs. w0        i0.   ;
33840 107544       al  w0         0    ;
33841 107546       rs  w0    x1+c28    ;   console.access count:=0;
33842 107548       rl. w0        i0.   ;
33843 107550       jl        x3        ; end;
33844 107552  
33844 107552  
33844 107552  i0: 0                    ; common work variables for register save
33845 107554  i1: 0                    ; in increase and decrease access.
33846 107556  
33846 107556  
33846 107556  
33846 107556  ; procedure remove element(element)
33847 107556  ; comment: removes an element from its chain and makes
33848 107556  ; it point at itself.
33849 107556  ;      call:     return:
33850 107556  ; w0             unchanged
33851 107556  ; w1   element   element
33852 107556  ; w2             old next
33853 107556  ; w3   link      old last
33854 107556  
33854 107556  d17: rs. w3      i2.     ; begin
33855 107558       dl  w3  x1+c21      ;   next(last):= next(element)
33856 107560       rs  w2  x3+c20      ;   last(next):= last(element)
33857 107562       rs  w3  x2+c21      ;   next(element):= element;
33858 107564       rs  w1  x1+c21      ;   last(element):= element;
33859 107566       rs  w1  x1+c20      ;   return;
33860 107568       jl.        (i2.)    ; end;
33861 107570  
33861 107570  ; procedure link element(element,head);
33862 107570  ; comment: links a console to the rear of the chain
33863 107570  ; defined by head. this is equivalent to linking
33864 107570  ; into a chain immediately before the element named
33865 107570  ; head.
33866 107570  ;      call:     return:
33867 107570  ; w0             unchanged
33868 107570  ; w1   element   element
33869 107570  ; w2   head      head
33870 107570  ; w3   link      old last
33871 107570  
33871 107570  d18: rs. w3      i2.     ; begin
33872 107572       rl  w3  x2+c21      ;   rear:= last(head);
33873 107574       rs  w1  x2+c21      ;   last(element):= last(head)
33874 107576       rs  w1  x3+c20      ;   next(rear):= element;
33875 107578       rs  w2  x1+c20      ;   next(element):= head;
33876 107580       rs  w3  x1+c21      ;   last(element):= rear;
33877 107582       jl.        (i2.)    ;   return;
33878 107584  ; end;
33879 107584  i2:0            ; general return for remove and link;
33880 107586  e.                      ; end
33881 107586  
33881 107586  ; procedure change write mode(mode, start, top)
33882 107586  ; note: this is only used from cat-init part of s.
33883 107586  ; mode = 0: writing to terminal buffer
33884 107586  ;      = 1: writing to memory buffer
33885 107586  ; if mode = 1 the writeaddress and lineaddress is changed to the specified
33886 107586  ; buffer and the mode indication is set accordingly.
33887 107586  ; if mode = 0 the mode switch is set to terminal (normal) and init write is
33888 107586  ; called. the start,stop parameters are not used.
33889 107586  ;
33890 107586  ; procedure init write
33891 107586  ; prepares the writing of characters in the line buffer within the current 
33892 107586  ; work area. this is not done if the mode switch = 1 i.e. memory buffer.
33893 107586  ;
33894 107586  ;         change write mode                     init write
33895 107586  ;      call          return                 call        return
33896 107586  ; w0   mode          mode                   -           unchanged
33897 107586  ; w1   top addr      destroyed              -           unchanged
33898 107586  ; w2   start addr    destroyed              -           unchanged
33899 107586  ; w3   link          link                   link        link
33900 107586  ;
33901 107586  
33901 107586  b. i10, j10 w.
33902 107586  
33902 107586  d12: rs. w0    (u53.)     ; procedure change write mode;
33903 107588       sn  w0     0         ; begin 
33904 107590       jl.        d19.      ;   write mode := mode; 
33905 107592       jl.        j1.       ;   if mode = 1 then goto init pointers
33906 107594                            ;   else goto init write;
33907 107594                            ;
33908 107594  d19:                      ; entry point: init write:
33909 107594       ds. w2     i2.       ;
33910 107596       rl. w1    (u53.)     ;   if write mode <> 0 then
33911 107598       se  w1     0         ;   return;
33912 107600       jl.        j2.       ;
33913 107602       rl. w2    (u24.)     ;   start := work.writebuf.start;
33914 107604       al  w2  x2+c65       ;   top   := work.writebuf.top;
33915 107606       al  w1  x2+c66-c65   ;
33916 107608  j1:  rs. w2    (u45.)     ; init pointers:
33917 107610       rs. w2    (u46.)     ;   write start := start;
33918 107612       rs. w1    (u42.)     ;   line start  := start;
33919 107614       al  w2     16        ;   write top   := top;
33920 107616       rs. w2    (u55.)     ;   write shift := 16;
33921 107618                            ;
33922 107618  j2:  dl. w2     i2.       ; return:
33923 107620       jl      x3           ;
33924 107622                            ;
33925 107622       0                    ;
33926 107624  i2:  0                    ;
33927 107626  
33927 107626  e.                        ; end;
33928 107626  
33928 107626  
33928 107626  
33928 107626  ; procedure writechar(char)
33929 107626  ; comment: packs the next character in the storage address
33930 107626  ; initialized by initwrite.
33931 107626  ; if a write is attempted beyond the actual write buffer (terminal- or
33932 107626  ; memory-buffer), nothing is written but normal return is used.
33933 107626  ;     call:     return:
33934 107626  ; w0  char      destroyed
33935 107626  ; w1            unchanged
33936 107626  ; w2            unchanged
33937 107626  ; w3  link      link
33938 107626  
33938 107626  b.i24                   ; begin
33939 107626  w.
33940 107626  d20: rs. w3      i3.     ;
33941 107628       rl. w3     (u42.)   ;   get writebuf.top;
33942 107630       rx. w1     (u55.)   ;   if writeshift < 0 then
33943 107632       rx. w2     (u46.)   ;   then
33944 107634       sl  w1       0      ;   begin
33945 107636       jl.         i0.     ;   writeshift:=16;
33946 107638       al  w1      16      ;   writeaddr:=writeaddr+2;
33947 107640       al  w2  x2  +2      ;   end;
33948 107642  i0:  sl  w2  x3+ 0       ;   if writeaddr >= writebuf.top  then return;
33949 107644       jl.         i1.     ;
33950 107646       ls  w0  x1  +0      ;   char:=char shift writeshift;
33951 107648       se  w1      16      ;   if writeshift<>16 then
33952 107650       lo  w0  x2  +0      ;   char:=char or word(writeaddr);
33953 107652       rs  w0  x2  +0      ;   word(writeaddr):=char;
33954 107654       al  w1  x1  -8      ;   writeshift:=writeshift-8;
33955 107656  i1:  rx. w1     (u55.)   ;
33956 107658       rx. w2     (u46.)   ;
33957 107660       jl.        (i3.)    ;   return;
33958 107662                           ;
33959 107662  i3:  0                   ; saved return;
33960 107664  e.                      ; end
33961 107664  
33961 107664  ; procedure writetext(addr)
33962 107664  ; comment: moves a textstring terminated by a null to the
33963 107664  ; storage address initialized by initwrite.
33964 107664  ;     call:     return:
33965 107664  ; w0            no of chars
33966 107664  ; w1  addr      destroyed
33967 107664  ; w2            unchanged
33968 107664  ; w3  link      link
33969 107664  
33969 107664  b.i24                   ; begin
33970 107664  w.d21:ds. w3     (u60.) ;
33971 107666       al  w3       0      ;
33972 107668  
33972 107668       al  w2  x1          ;
33973 107670  i0:  rl  w1  x2          ; next word: portion:= word(addr);
33974 107672       al  w2  x2  +2      ;   addr:= addr + 2;
33975 107674  i1:  al  w3  x3  +1      ;
33976 107676       al  w0       0      ;   repeat
33977 107678       ld  w1       8      ;     ch:= portion shift (-16);
33978 107680       sn  w0       0      ;     if ch = 0 then
33979 107682       jl.         i2.     ;     goto endtext;
33980 107684       rs. w3     (u58.)   ;
33981 107686       jl. w3     d20.     ;     write char(ch);
33982 107688       rl. w3     (u58.)   ;
33983 107690       al  w1  x1  +8.377  ;     portion:= portion shift 8 + 255;
33984 107692       sn  w1      -1      ;   until portion = 1;
33985 107694       am       i0-i1      ;
33986 107696       jl.         i1.     ;   goto next word;
33987 107698  i2:  al  w0      32      ; end text:
33988 107700       al  w1  x3          ;
33989 107702       jl. w3     d20.     ;   writechar(32);
33990 107704  i6:  rl. w1     (u58.)   ;
33991 107706  i7:  dl. w3     (u60.)   ;
33992 107708       jl      x3  +0      ; end
33993 107710  
33993 107710  ; procedure writeinteger(integer)
33994 107710  ; comment converts a positive integer to a textstring which
33995 107710  ; is moved to the storage address initialized by initwrite.
33996 107710  ;     call:     return:
33997 107710  ; w0            destroyed
33998 107710  ; w1  integer   number of digits
33999 107710  ; w2            unchanged
34000 107710  ; w3  link      link
34001 107710  i4:1 000 000         ; powers of ten:
34002 107712  100 000         ;
34003 107714  10 000         ;
34004 107716  1 000         ;
34005 107718  100         ;
34006 107720  10         ; 
34007 107722  1         ;
34008 107724  
34008 107724  d22: ds. w3     (u60.)   ; begin
34009 107726       sl  w1       0      ;   if number < 0 then
34010 107728       jl.        i10.     ;    begin
34011 107730       ac  w1  x1          ;     number:= -number;
34012 107732       am       45-32      ;     sign:= <minus>;
34013 107734  i10: al  w0      32      ;   end
34014 107736       al  w3       7      ;
34015 107738       rs. w3     i15.     ;
34016 107740       sl  w1       0      ;   else sign:= <sp>;
34017 107742       sl. w1     (i4.)    ;   if number = 1 < 23
34018 107744       jl.        i12.     ;   or number > 10 ** 6 then
34019 107746       al  w2      12      ;   divisor:= 10 ** 6;
34020 107748       al  w3       1      ;
34021 107750  i11: sl. w1 (x2 +i4.-2)  ;   else
34022 107752    jl.  +4     ;
34023 107754       jl.        i13.     ;    begin
34024 107756       al  w2  x2  -2      ;     divisor:= 1;
34025 107758       al  w3  x3  +1      ;
34026 107760       jl.        i11.     ;     while number > divisor * 10 do
34027 107762  i12: al  w2       0      ;      divisor:= divisor * 10;
34028 107764  i13: rs. w3     i15.     ;
34029 107766       jl. w3     d20.     ;    end;
34030 107768  i14: al  w0       0      ;   writechar(sign);
34031 107770       wd. w1  x2 +i4.     ;  repeat
34032 107772       al  w1  x1 +48      ;   digit:= 48 + number // divisor;
34033 107774       rx  w1       0      ;   number:= number mod divisor;
34034 107776       jl. w3     d20.     ;   writechar(digit);
34035 107778       al  w2  x2  +2      ;   divisor:= divisor // 10;
34036 107780       sh  w2      12      ;  until divisor = 0;
34037 107782       jl.        i14.     ;   comment return via
34038 107784       rl. w1     i15.     ;
34039 107786       jl.         i7.     ; end in writetext
34040 107788  i15: 0             ; number of digits
34041 107790  e.                      ; end
34042 107790  
34042 107790  
34042 107790  ; procedure writebits(integer);
34043 107790  ; comment: moves the specified integer to the storage address initialized
34044 107790  ; by initwrite. it is moved as a string of 24 bits (ones and points).
34045 107790  ;
34046 107790  ;      call                 return
34047 107790  ;  w0  -                    destroyed
34048 107790  ;  w1  integer              integer
34049 107790  ;  w2  -                    unchanged
34050 107790  ;  w3  link                 destroyed
34051 107790  ;
34052 107790  
34052 107790  b.  i5, j5  w.
34053 107790  
34053 107790  d14:                   ; writebits
34054 107790       ds. w2     i2.    ; begin
34055 107792       rs. w3     i3.    ;
34056 107794       al  w2    -1      ;
34057 107796  j1:  sl  w1     0      ;   for i:= 1 step 1 until 24 do
34058 107798       am         46-49  ;   writechar( if integer(i) = 1 then '1'
34059 107800       al  w0     49     ;                                else '.' );
34060 107802       jl. w3     d20.   ;
34061 107804       ld  w2     1      ;
34062 107806       se  w2     0      ;
34063 107808       jl.        j1.    ;
34064 107810       dl. w2     i2.    ;
34065 107812       jl.       (i3.)   ;
34066 107814                         ;
34067 107814       0                 ;
34068 107816  i2:  0                 ;
34069 107818  i3:  0                 ; 
34070 107820  e.                     ; end;
34071 107820  
34071 107820  ; procedure typeline(buf)
34072 107820  ; comment: starts the output on the current console of the line buffer
34073 107820  ; within the current work area.
34074 107820  ;     call:     return:
34075 107820  ; w0            destroyed
34076 107820  ; w1            destroyed
34077 107820  ; w2            buf
34078 107820  ; w3  link      destroyed
34079 107820  
34079 107820  ; procedure send buf (mess, buf)
34080 107820  ; (as typeline, but at call: w1=mess)
34081 107820  
34081 107820  b.i24                   ; begin
34082 107820  w.
34083 107820  d23:                   ; type line:
34084 107820       rl. w1     u44.   ;   mess := output message;
34085 107822  d26:                   ; send buf:
34086 107822       rs. w3     (u60.) ;
34087 107824       rl. w2     (u25.)   ;
34088 107826       dl  w0  x2+c75+2    ;
34089 107828       ds. w0     (u41.)   ;
34090 107830       dl  w0  x2+c75+6    ;
34091 107832       ds. w0     (u43.)   ;   receiver:=name(proc);
34092 107834       rl. w3     u40.     ;
34093 107836       zl  w0  x1+0        ;
34094 107838       se  w0     5        ;   if  op=output then
34095 107840       jl.        i2.      ;   begin
34096 107842       jd         1<11+4   ;     process_description(name,curr.pda);
34097 107844       se  w0     0        ;     if no process then
34098 107846       jl.        i2.      ;     begin
34099 107848       am          (b4)    ;
34100 107850       rl  w2     a199<1   ;       pda:=main_cosole.pda
34101 107852       dl  w0  x2+a11+2    ;
34102 107854       ds. w0     (u41.)   ;
34103 107856       dl  w0  x2+a11+6    ;
34104 107858       ds. w0     (u43.)   ;
34105 107860       rl. w3     u40.     ;
34106 107862                           ;     end; 
34107 107862                           ;   end;
34108 107862  i2:  jd     1<11+16      ;   send mess(receiver,typemess,buf);
34109 107864       rl. w3    (u60.)    ;
34110 107866       jl      x3          ;
34111 107868  e.                      ; end
34112 107868  
34112 107868  
34112 107868  ; procedure find or select console_1(name_address, console buf);
34113 107868  ; comment: search for a console buffer which has been used with the given
34114 107868  ; device name. if not found a new is selected and this will be cleared and
34115 107868  ; the name and device address are inserted.
34116 107868  ;
34117 107868  ; procedure find or select console_2(name address, console buf);
34118 107868  ; comment: search for a console buffer which has been used with the given
34119 107868  ; device name. if not found a new is selected and this will be cleared and
34120 107868  ; the name is inserted.
34121 107868  ;
34122 107868  ; procedure find console(name address, console buf);
34123 107868  ; comment: search for a console buffer which has been used with the given
34124 107868  ; device name.
34125 107868  ; name address may be an address of an external process or a core tabel element
34126 107868  ; address (+c18).
34127 107868  ;
34128 107868  ; return: link + 0: not found and no free selected
34129 107868  ;         link + 2: found
34130 107868  ;         call                return
34131 107868  ; w0: device address        device address
34132 107868  ; w1:                       console buffer   (error: destroyed)
34133 107868  ; w2:                       unchanged
34134 107868  ; w3: link                  link
34135 107868  b. i24, j24 w.
34136 107868  d64: am         2       ; find and select console_2;
34137 107870  d44: am         2       ; find console;
34138 107872  d24: al  w1     0       ; find and select console_1;
34139 107874       rs. w1     i4.     ; begin
34140 107876       ds. w3     i3.     ;
34141 107878       rl. w1     (u9.)   ;   console := first console;
34142 107880       rl  w2     0       ;
34143 107882  
34143 107882  j0:  dl  w0  x2+a11+2   ;   begin
34144 107884       sn  w3 (x1+c75+0)  ;
34145 107886       se  w0 (x1+c75+2)  ;     if device.name = consolebuf.terminalname then
34146 107888       jl.        j1.     ;     goto found;
34147 107890       dl  w0  x2+a11+6   ;
34148 107892       sn  w3 (x1+c75+4)  ;
34149 107894       se  w0 (x1+c75+6)  ;
34150 107896       jl.        j1.     ;
34151 107898       jl.        j4.     ;
34152 107900                          ;
34153 107900  j1:  al  w1  x1+c1      ; increment:
34154 107902       rl. w3    (u10.)   ;     if console<=last console then
34155 107904       sh  w1  x3         ;
34156 107906       jl.        j0.     ;      goto next;
34157 107908                          ;   end;
34158 107908       rl. w0     i4.     ;
34159 107910       sn  w0     2       ;   if not find_and_select_console then
34160 107912       jl.        j5.     ;   return;
34161 107914                          ;   else
34162 107914                          ;   begin <* select a free *>
34163 107914       rl. w1     u35.    ;     console := free list.first;
34164 107916       rl  w1  x1+c20     ;
34165 107918       sn. w1     (u35.)  ;     if console = none then 
34166 107920       jl.        j5.     ;        goto error-return;
34167 107922                          ;
34168 107922       al  w0     0       ; <* clear the free console buffer *>
34169 107924       al  w3     c29     ;
34170 107926  j3:  am      x3         ;     for field := namefield, next until
34171 107928       rs  w0  x1+0       ;                  userinterval-field do
34172 107930       al  w3  x3+2       ;     console.field := 0;
34173 107932       sh  w3     c43+2   ;
34174 107934       jl.        j3.     ;
34175 107936                          ;   end;
34176 107936       dl  w0  x2+a11+2   ; found:
34177 107938       ds  w0  x1+c75+2   ;
34178 107940       dl  w0  x2+a11+6   ;   consolebuf.terminalname := terminal name;
34179 107942       ds  w0  x1+c75+6   ;
34180 107944  j4:  rl. w0     i4.     ;
34181 107946       sn  w0     0       ;   if find_and_select_console_1 then
34182 107948       rs  w2  x1+c25     ;   consolebuf.console description := terminal address;
34183 107950       al  w0  x2         ;
34184 107952       dl. w3     i3.     ;
34185 107954       jl      x3+2       ; return ok;
34186 107956                          ;
34187 107956  j5:                     ; return not ok: <* no free console buffer or not found*>
34188 107956       dl. w3     i3.     ;
34189 107958       jl      x3+0       ;
34190 107960                          ;
34191 107960       0                  ; save w2
34192 107962  i3:  0                  ; save w3
34193 107964  i4:  0                  ; branch address
34194 107966  
34194 107966  e.
34195 107966  
34195 107966  ; common block for the procedures find parent, find size,
34196 107966  ; find addr, and max size. the procedures use the
34197 107966  ; variable core table element (e30) as work variable, and
34198 107966  ; the three first mentioned procedures leave it pointing
34199 107966  ; at a suitable element. i.e. for find parent, e30 points
34200 107966  ; at the core table element for the chilet, and for
34201 107966  ; find size and find addr, e30 points at an element
34202 107966  ; before which a suitable hole may be found.
34203 107966  
34203 107966  b. i24, j24
34204 107966  w.
34205 107966  
34205 107966  ; local sub procedures first hole and next hole(addr, size, sorry);
34206 107966  ; comment: this set of procedures perform the actual up
34207 107966  ; dating of the variable core table element.
34208 107966  ;      call:     return
34209 107966  ; w0:            hole addr
34210 107966  ; w1:            hole size
34211 107966  ; w2:            unchanged
34212 107966  ; w3:  link      link
34213 107966  
34213 107966  j0:  rs. w3     (u30.)   ; entry first hole:
34214 107968       rl. w0     (u16.)   ;   hole addr:= first core;
34215 107970       rl. w3     u15.     ;   element:= core table head;
34216 107972       jl.         j2.     ;   goto advance;
34217 107974  
34217 107974  j1:  rx. w3     (u30.)   ; entry next hole:
34218 107976       se. w3    (u15.)     ;   element := core table element;
34219 107978       jl.        j3.       ;
34220 107980       rl. w3    (u30.)     ;   if element = core table head then
34221 107982       jl      x3           ;      return sorry;
34222 107984  j3:  am     (x3+c17)     ;   ;
34223 107986       rl  w0     a18      ;   hole addr:= top addr(child(element));
34224 107988       am     (x3+c17)
34225 107990       wa  w0    a182      ; add base
34226 107992  j2:  rl  w3  x3+c20      ; advance:
34227 107994       rl  w1  x3+c17      ;   element:= next(element);
34228 107996       sn. w3     (u15.)   ;   if element = core table head
34229 107998       rl. w1      u1.     ; el then tophole=topcore
34230 108000       rs. w2      i5.
34231 108002       rl  w2  x1+a182
34232 108004       rl  w1  x1+a17      ;   else tophole:= first addr(child(element));
34233 108006       se. w3     (u15.)   ;
34234 108008       wa  w1       4      ; add base
34235 108010       ws  w1       0      ;   hole size:= top hole - hole addr;
34236 108012       rx. w3     (u30.)   ;   core table element:= element;
34237 108014       rl. w2      i5.     ;
34238 108016       jl      x3  +2      ;   return happy;
34239 108018  
34239 108018   i5: 0
34240 108020  
34240 108020  ; procedure find parent(child,terminal.pda,coretableelement,sorry);
34241 108020  ; comment: searches the parent console of a given child and
34242 108020  ; sets the variable core table element.
34243 108020  ; if the child is found, the console name is checked, if the process does not exist
34244 108020  ; the main console is selected, or if the process has got a new process description addr this is used
34245 108020  ;      call:     return:
34246 108020  ; w0:            destroyed
34247 108020  ; w1:            terminal
34248 108020  ; w2:  child     child
34249 108020  ; w3:  link      core table element
34250 108020  
34250 108020  d25: rs. w3     (u60.)   ; begin
34251 108022       am       j0-j1      ;   for i:= first hole,
34252 108024  i0:  jl. w3      j1.     ;       next hole while happy do
34253 108026       jl.         i6.     ;    begin
34254 108028       rl. w3     (u30.)   ;     if child = child(element) then
34255 108030       se  w2 (x3+c17)     ;      exit
34256 108032       jl.         i0.     ;    end;
34257 108034       rl  w1  x3+c18      ;
34258 108036       al  w3  x3+c106     ;
34259 108038       jd         1<11+4   ;    process_description(name,found.pda);
34260 108040       se  w0     0        ;    if no process then
34261 108042       rl  w1     0        ;    terminal.pda:=old.pda else terminal.pda:=found.pda
34262 108044       rl. w3     (u30.)   ;    restore core table element;
34263 108046       rs  w1  x3+c18      ;
34264 108048       am        +2        ;    ok return;
34265 108050  i6:  al  w0     0        ;    return sorry:
34266 108052       wa. w0    (u60.)    ;
34267 108054       jl        (0)       ; end;
34268 108056  
34268 108056  ; procedure find size(start,size,sorry);
34269 108056  ; comment: the core table is searched for the first
34270 108056  ; hole not less than the size given. the start address
34271 108056  ; is returned and the variable core table entry is set
34272 108056  ; to point at the element before which a hole is
34273 108056  ; found.
34274 108056  ;      call:     return:
34275 108056  ; w0:            first addr
34276 108056  ; w1:  size      size (i.e. unchanged)
34277 108056  ; w2:            destroyed
34278 108056  ; w3:  link      destroyed
34279 108056  
34279 108056  d27: rs. w1     (u37.)   ; begin
34280 108058       rs. w3     (u38.)   ;   wanted size:= size;
34281 108060       am       j0-j1      ;   for size:= first hole, next hole while happy do
34282 108062  i1:  jl. w3      j1.     ;   if size >= wanted size then
34283 108064       jl.         i7.     ;   goto found;
34284 108066       rl. w3    (u37.)    ;   goto return sorry;
34285 108068       sl  w1  x3          ;
34286 108070       jl.          4      ; found: size:= wanted size;
34287 108072       jl.         i1.     ;   first addr:= hole addr;
34288 108074       dl. w2     (u38.)   ;   return happy;
34289 108076       jl      x2  +2      ; 
34290 108078  i7:  dl. w2    (u38.)    ;   return sorry:
34291 108080       jl      x2          ; end;
34292 108082  
34292 108082  ; procedure find addr (start,size,sorry);
34293 108082  ; comment: the core table is searched for a hole with
34294 108082  ; a given start address and a size not less than given.
34295 108082  ;      call:     return:
34296 108082  ; w0:  start     start (i.e. unchanged)
34297 108082  ; w1:  size      size (i.e. unchanged)
34298 108082  ; w2:            destroyed
34299 108082  ; w3:  link      destroyed
34300 108082  
34300 108082  d28: rs. w1     (u57.)   ; begin
34301 108084       rs. w3     (u58.)   ;
34302 108086       rl  w2       0      ;
34303 108088       am       j0-j1      ;   for size:= first hole, next hole while happy do
34304 108090  i2:  jl. w3      j1.     ;    begin
34305 108092       jl.         i8.     ;     if holeaddr > start addr then
34306 108094       sl  w0  x2  +2      ;     return sorry;
34307 108096       jl.         i8.     ;     add := hole addr + hole size
34308 108098       wa  w1       0      ;            - wanted size;
34309 108100       ws. w1     (u57.)   ;     if add >= start then goto found;
34310 108102       sh  w1  x2  -2      ;    end;
34311 108104       jl.         i2.     ;   return sorry;
34312 108106       al  w0  x2          ; found:
34313 108108       dl. w2     (u58.)   ;   return happy;
34314 108110       jl      x2  +2      ; 
34315 108112  i8:  dl. w2    (u58.)    ;   return sorry;
34316 108114       jl      x2          ; end;
34317 108116  
34317 108116  ; procedure find max(size)
34318 108116  ; comment: the core table is searched for the size of the largest
34319 108116  ; hole, and the size is delivered;
34320 108116  ;      call:     return:
34321 108116  ; w0:            destroyed
34322 108116  ; w1:            size
34323 108116  ; w2:            destroyed
34324 108116  ;w3:  link      destroyed
34325 108116  
34325 108116  d29: rs. w3     (u58.)   ; begin
34326 108118       al  w2       0      ;
34327 108120       am       j0-j1      ;   max:= 0;
34328 108122  i3:  jl. w3      j1.     ;   for size:= firsthole,nexthole while happy do
34329 108124       jl.         i4.     ;    if size >= max then
34330 108126       sl  w1  x2          ;    max:= size;
34331 108128       al  w2  x1          ;
34332 108130       jl.         i3.     ;   size:= max;
34333 108132  i4:  al  w1  x2          ;   return
34334 108134  c.(:a399>22a.1:)-1
34335 108134       rl. w3      (u82.)  ;
34336 108134       sl  w1  x3          ;   if max > max r.size then
34337 108134       al  w1  x3          ;     max:= max r.size;
34338 108134  z.
34339 108134       rl. w3    (u58.)    ;
34340 108136       jl      x3          ; end;
34341 108138  
34341 108138  e.
34342 108138  
34342 108138  ; procedure reserve core(child)
34343 108138  ; comment: inserts a child in the core table just before
34344 108138  ; the element pointed at by core table entry. the variable
34345 108138  ; core table entry is updated to point at the new element;
34346 108138  ;     call:     return:
34347 108138  ; w0     child       child
34348 108138  ; w1            console
34349 108138  ; w2  console     core table element
34350 108138  ; w3  link      destroyed
34351 108138  
34351 108138  b.i24 w.                ; begin
34352 108138  d30: rs. w3    (u60.)    ;   i:= base core table;
34353 108140       rl. w1    (u33.)    ; repeat
34354 108142  i0:  al  w1  x1+c11      ;    i:= i + core table entry size;
34355 108144       se  w1 (x1+c21)     ; until
34356 108146       jl.         i0.     ;    core table entry(i) is free;
34357 108148       rs. w2     i5.     ;  save console;
34358 108150       rl. w2    (u30.)   ;  link element(coretable entry(i));
34359 108152       jl. w3     d18.     ;      core table element);
34360 108154       al  w2  x1          ;   core table element:= core table entry(i);
34361 108156       rs. w1    (u30.)    ;   core table element. child:= child;
34362 108158       rl. w1     i5.      ;
34363 108160       rl  w1  x1+c25      ;
34364 108162       ds  w1  x2+c18      ;   core table element. console:= console;
34365 108164       rl. w1     i5.      ;
34366 108166       rl. w3    (u79.)    ;
34367 108168       rs  w3  x2+c22      ; coretable element. segm:=segmentno
34368 108170       al  w3      -1      ;
34369 108172       rs. w3    (u79.)    ;
34370 108174       rl  w0  x2+c17      ;
34371 108176       rl. w3    (u60.)    ;   return;
34372 108178       jl      x3          ;
34373 108180  i5: 0                    ; saved console
34374 108182  e.                      ; end;
34375 108182  
34375 108182  ; procedure release core(child)
34376 108182  ; comment: removes a child from the core table; 
34377 108182  ;     call:     return:
34378 108182  ; w0            destroyed
34379 108182  ; w1            destroyed
34380 108182  ; w2            destroyed
34381 108182  ; w3  link      destroyed
34382 108182  
34382 108182  b.i24 w.                ; begin
34383 108182  d31: rs. w3      i1.     ;
34384 108184       rl. w1    (u30.)    ;
34385 108186       al  w2      -1      ;
34386 108188       rs  w2  x1   c22   ;
34387 108190       rl. w1    (u30.)    ;
34388 108192       jl. w3     d17.     ;   release element (core table element);
34389 108194       jl.        (i1.)    ;   return
34390 108196  i1:0
34391 108198  e.                      ; end
34392 108198  
34392 108198  ; procedure child name
34393 108198  ; comment: moves child name to receiver name.
34394 108198  ;     call:     return:
34395 108198  ; w0            destroyed
34396 108198  ; w1            destroyed
34397 108198  ; w2            child
34398 108198  ; w3  link      link
34399 108198  
34399 108198  b.i24                   ; begin
34400 108198  w.d33:rl. w2   (u29.)   ;
34401 108200       dl  w1  x2+a11+2    ;
34402 108202       ds. w1    (u41.)    ;
34403 108204       dl  w1  x2+a11+6    ;   receiver:=name(child);
34404 108206       ds. w1    (u43.)    ;
34405 108208       jl      x3  +0      ;
34406 108210  e.                      ; end
34407 108210  
34407 108210  ; procedure check child
34408 108210  ; comment: checks that the process name in the console
34409 108210  ; description refers to a child of s. the console must
34410 108210  ; either be a privileged console or the terminal from which 
34411 108210  ; the child was created.
34412 108210  ;     call:     return:
34413 108210  ; w0            destroyed
34414 108210  ; w1            console (if result ok)
34415 108210  ; w2            child       "
34416 108210  ; w3  link      destroyed
34417 108210  
34417 108210  b.i24,j2                ; begin
34418 108210  w.d34:rs. w3  i0.       ;
34419 108212       rl. w1    (u25.)    ;
34420 108214       al  w3  x1+c29      ;   process description(
34421 108216       jd      1<11+4      ;     process name(console),result);
34422 108218       rs. w0    (u29.)    ;   child:=result;
34423 108220       rl  w2       0      ;
34424 108222       rl  w1  x2  +0      ;
34425 108224       se  w2       0      ;   if child=0
34426 108226       se  w1       0      ;   or kind(child)<>0
34427 108228       jl.        (r9.)    ;   then goto end line;
34428 108230       jl. w3     d25.     ;
34429 108232       jl.        (r3.)    ;   find parent(child,parent,end line);
34430 108234       rl. w2     (u25.)   ;   w2:=current console
34431 108236       zl  w0  x2+c27      ;
34432 108238       sz  w0     1<3      ;   if privileged then
34433 108240       jl.        j0.      ;   ok return
34434 108242       dl  w1  x3+c106+2   ;
34435 108244       sn  w0  (x2+c75+0)  ;
34436 108246       se  w1  (x2+c75+2)  ;
34437 108248       jl.         (r3.)   ;
34438 108250       dl  w1  x3+c106+6   ;
34439 108252       sn  w0  (x2+c75+4)  ;   if name.core table <> name.console table
34440 108254       se  w1  (x2+c75+6)  ;   then
34441 108256       jl.         (r3.)   ;   goto end line
34442 108258  j0:  rl. w2      (u29.)  ;
34443 108260       jl.         (i0.)   ;
34444 108262  i0:0                 ;
34445 108264  e.                      ; end
34446 108264  ;
34447 108264  ; u block
34448 108264  ; indirect addressing of e-names
34449 108264  ;
34450 108264  u1:   e1
34451 108266  u5:   e5
34452 108268  
34452 108268  u6:   e6
34453 108270  u9:   e9
34454 108272  u10: e10
34455 108274  u15: e15
34456 108276  u16: e16
34457 108278  u18: e18
34458 108280  u19: e19
34459 108282  u20: e20
34460 108284  u21: e21
34461 108286  u22: e22
34462 108288  u23: e23
34463 108290  u24: e24
34464 108292  u25: e25
34465 108294  u26: e26
34466 108296  u27: e27
34467 108298  u28: e28
34468 108300  u29: e29
34469 108302  u30: e30
34470 108304  u31: e31
34471 108306  u33: e33
34472 108308  u35: e35
34473 108310  u37: e37
34474 108312  u38: e38
34475 108314  u40: e40
34476 108316  u41: e41
34477 108318  u42: e42
34478 108320  u43: e43
34479 108322  u44: e44
34480 108324  u45: e45
34481 108326  u46: e46
34482 108328  u53: e53
34483 108330  u55: e55
34484 108332  
34484 108332  u56: e56
34485 108334  u57: e57
34486 108336  u58: e58
34487 108338  u59: e59
34488 108340  u60: e60
34489 108342  u79: e79
34490 108344  c.(:a399>22a.1:)-1
34491 108344  u82: e82
34492 108344  z.
34493 108344  
34493 108344  u87: e87
34494 108346  u90: e90
34495 108348  u109:e109
34496 108350  
34496 108350  
34496 108350  ; r-block
34497 108350  ; indirect addressing of g-names
34498 108350  ;
34499 108350  
34499 108350  r3 :   g3
34500 108352  r4 :   g4
34501 108354  r5 :   g5
34502 108356  r6 :   g6
34503 108358  r7 :   g7
34504 108360  r8 :   g8
34505 108362  r9 :   g9
34506 108364  r10:  g10
34507 108366  r11:  g11
34508 108368  r18:  g18
34509 108370  r19:  g19
34510 108372  r20:  g20
34511 108374  r25:  g25
34512 108376  r27:  g27
34513 108378  r101:g101
34514 108380  
34514 108380  
34514 108380  ; stepping stones
34515 108380  ;
34516 108380  
34516 108380  jl.     (2) ,   d20 ,   d20=k-4
34517 108384  jl.     (2) ,   d22 ,   d22=k-4
34518 108388  
34518 108388  
34518 108388  
34518 108388  ; procedure create child
34519 108388  ; comment: allocates resources and creates a child process in
34520 108388  ; accordance with the console parameters. the child is included as
34521 108388  ; user of all devices in the device table, except temp links not used
34522 108388  ; by the child. finally, the identification
34523 108388  ; bit of the child is set in the description of the console.
34524 108388  ;     call:     return:
34525 108388  ; w0            destroyed
34526 108388  ; w1            destroyed
34527 108388  ; w2            destroyed
34528 108388  ; w3  link      destroyed
34529 108388  
34529 108388  b.i30, j10 w.                   ; begin
34530 108388  
34530 108388  d35:rs. w3  i2.          ; find core:
34531 108390       rl. w2     e25.     ;
34532 108392       rl  w1  x2+c39      ;   size:=size(console);
34533 108394       sn  w1     0        ;   if size = 0 then
34534 108396       jl. w3     d29.     ;      find max(size);
34535 108398       rl. w2     e25.     ;
34536 108400       rl  w0  x2+c30      ;   start := first addr(console);
34537 108402  
34537 108402       bz  w3  x2+c27      ;
34538 108404       sz  w3     1<1      ;   if abs addr(console)
34539 108406       am     d28-d27      ;   then find addr(start,size,end line)
34540 108408       jl. w3     d27.     ;   else find size(start,size,end line);
34541 108410       jl.        (r4.)    ;
34542 108412       rl. w2     e25.     ;
34543 108414       rs  w0  x2+c30      ;   first addr(console):=start;
34544 108416       wa  w0     2        ;   top addr(console):=
34545 108418       rs  w0  x2+c31      ;   start+size;
34546 108420       bz  w3  x2+c27      ; find protection:
34547 108422  c.-4000                  ; in rc4000:
34548 108422       sz  w3     1<2      ;   if not abs protection(console) then
34549 108422       jl.         i0.     ;   begin
34550 108422       bz  w2  x2+c26      ;
34551 108422  
34551 108422       jl. w3     d32.     ;   find keys(keys(console),
34552 108422       jl.         g8.     ;      new pr,new pk, end line);
34553 108422       rl. w2     e25.     ;   pr(console):=new pr;
34554 108422       hs  w0  x2+c37      ;   pk(console):=new pk;
34555 108422       hs  w1  x2+c38      ;   end;
34556 108422  i0:  bl  w0  x2+c37      ;
34557 108422       sz  w0    -1<8      ;   if pr(console)(0:3)<>0 then
34558 108422       jl.         g8.     ;   goto end line;
34559 108422  z.  
34560 108422  
34560 108422  c.8000                   ; in rc8000:
34561 108422       rl. w0  i21.        ;
34562 108424       so  w3  1<2         ; if abs protection
34563 108426       jl.         j1.     ; 
34564 108428  ;*   so  w3  1<9         ; and allowed(console)
34565 108428  ;*   jl.        (r3.)    ; 
34566 108428       al  w1      -1      ; then no relocation and
34567 108430       rs  w1  x2+c97      ;
34568 108432       al  w0       0      ;  pr,pk=0,0 else
34569 108434   j1: rs  w0  x2+c37      ; pr,pk=240<12+7 , usermode
34570 108436  z.
34571 108436       rl. w3      b1.     ; check claims:
34572 108438       bz  w0  x2+c32      ;
34573 108440       bz  w1  x3+a19      ;
34574 108442       ws. w1      e2.     ;   if buf claim(console)>
34575 108444       sl  w0  x1  +1      ;   buf claim(s)-own buf
34576 108446       jl.        (r5.)    ;   then goto end line;
34577 108448       bz  w0  x2+c33      ;
34578 108450       bz  w1  x3+a20      ;   if area claim(console)>
34579 108452       ws. w1      e3.     ;
34580 108454       sl  w0  x1  +1      ;   area claim(s)-own area
34581 108456       jl.        (r6.)    ;   then goto end line;
34582 108458       bz  w0  x2+c34      ;
34583 108460       bz  w1  x3+a21      ;   if internal claim(console)>
34584 108462       sl  w0  x1  +0      ;   internal claim(s)-1
34585 108464       jl.        (r7.)    ;   then goto end line;
34586 108466  ; test intervals:
34587 108466  ; comment: the testing that the interval limits are contained
34588 108466  ; in each other is performed as schetched below
34589 108466  ; standard:          !2!
34590 108466  ;                   4   1
34591 108466       dl  w1  x2+c42+2    ;   the numbers refer to the numbers about
34592 108468       sh  w1 (x2+c43+2)   ; 1; if cons.std.hi >= cons.user.hi
34593 108470       sl  w0  x1  +1      ;
34594 108472       jl.       (r19.)    ;    then goto base alarm;
34595 108474       rl  w1  x2+c43      ;
34596 108476       sl  w1 (x2+c41)     ; 3; if cons.user.lo < cons.max.lo
34597 108478       jl.          4      ;
34598 108480       jl.       (r19.)    ;
34599 108482       sh  w1 (x2+c42)     ;
34600 108484       sz                  ;
34601 108486       jl.       (r19.)    ;    then goto base alarm;
34602 108488       dl  w1  x2+c41+2    ;
34603 108490       al  w1  x1  +1      ;
34604 108492       sl  w0 (x3+a45-2)   ; 6; or cons.max.hi < cons.user.hi
34605 108494       sh  w1 (x2+c43+2)   ;    then goto base alarm;
34606 108496       jl.       (r19.)    ;
34607 108498       al  w1  x1  -2      ;
34608 108500       sl  w1 (x3+a45-0)   ; 7; if cons.max.hi > s.std.hi
34609 108502       jl.       (r19.)    ;    then goto base alarm
34610 108504  i25: al  w1  x2+c30      ;   create internal process(
34611 108506       al  w3  x2+c29      ;    process name(console),
34612 108508       jd     1<11+56      ;    first addr(console),result);
34613 108510       sn  w0       1      ;
34614 108512       jl.        (r4.)    ;
34615 108514       sn  w0       2      ;
34616 108516       jl.       (r11.)    ;
34617 108518       se  w0       0      ;   if result<>0 
34618 108520       jl.       (r10.)    ;   then goto end line;
34619 108522       jd      1<11+4      ;   process description(
34620 108524       rs. w0     e29.     ;     process name(console),result);
34621 108526       jl. w3     d30.     ; reserve core
34622 108528       al  w3  x1+c95     ; move kind,name of primin
34623 108530       al  w2  x2+c19     ; and primout to coretable
34624 108532  j0 : rl  w0  x3         ; (set by i and o commands )
34625 108534       rs  w0  x2         ;
34626 108536       al  w3  x3+2       ;
34627 108538       al  w2  x2+2       ;
34628 108540       se  w3  x1+c97     ;
34629 108542       jl.     j0.        ;
34630 108544       rl. w2     e30.        ;
34631 108546       dl  w0  x1+c75+2       ; move name of terminal
34632 108548       ds  w0  x2+c106+2      ; to core table
34633 108550       dl  w0  x1+c75+6       ;
34634 108552       ds  w0  x2+c106+6      ;
34635 108554       al  w3  x1+c29      ; 
34636 108556       al  w2  x1          ;
34637 108558       rl  w1  x1+c97      ; if first logic address defined then
34638 108560       sn  w1      -1      ;
34639 108562       jl.         j2.     ; begin
34640 108564       rl  w1  x2+c30      ; displacement := first address ( "physical")
34641 108566       ws  w1  x2+c97      ; - first logic address
34642 108568       jd      1<11+98     ; change address base
34643 108570       sn  w0  0           ; if not ok
34644 108572       jl.         j2.     ; then begin
34645 108574       jl. w3     d40.     ; remove process
34646 108576       jl.      (r101.)    ; write illegal relocation ; end
34647 108578  
34647 108578  
34647 108578  ; set the cpa register(child)
34648 108578  
34648 108578  j2 : rl  w1  x2+c98      ; if cpa < > initial cpa then
34649 108580       sn  w1       1      ; begin
34650 108582       jl.         j3.     ;
34651 108584       sn  w1      -1      ; if cpa(console) = -1 (default)
34652 108586       rl. w1     e16.     ; then cpa(child) = top of s own area
34653 108588       jd      1<11+126    ; set cpa 
34654 108590       sn  w0       0      ; if not ok then
34655 108592       jl.         j3.     ; begin
34656 108594       jl. w3     d40.     ; remove process
34657 108596       jl.        (r8.)    ; write illegal cpa
34658 108598  ; set the priority of the process
34659 108598  ; if the priority differs from default. (0)
34660 108598  j3:  zl  w1  x2+c26      ; prio=prio.console
34661 108600       sn  w1       0      ; if prio<> 0 then 
34662 108602       jl.       i19.      ; 
34663 108604       jd    1<11+94       ; set priority
34664 108606       sn  w0      0       ; if result <> 0 then
34665 108608       jl.       i19.      ;
34666 108610       jl. w3    d40.      ; remove process
34667 108612       jl.      (r27.)     ; goto end line
34668 108614  ; include process as user of all peripheral devices except those listed
34669 108614  ; in the s device exception tablr.
34670 108614  ; process will not be included as user of temp links
34671 108614  ; execpt the temp link for the process' console.
34672 108614  
34672 108614  i19: rl. w2     e25.     ;
34673 108616       rl  w2  x2+c25      ;
34674 108618       rs. w2     i26.     ;   save child.console;
34675 108620       rl. w2     e11.     ;   addr:=start(exception table);
34676 108622       al  w1     0        ;   devno:=0;
34677 108624  i1:  bz  w0  x2          ; include:
34678 108626       se  w0  x1          ;   if devno:=devno(addr) then
34679 108628       jl.        i3.      ;     addr:=addr+1;
34680 108630       al  w2  x2+1        ;   else
34681 108632       jl.        i4.      ;
34682 108634  i3:  rs. w2     i28.     ;     save exception table address.
34683 108636       al  w2  x1          ;   next device := 2 * deviceno + first device;
34684 108638       ls  w2       1      ;
34685 108640       wa  w2      b4      ;
34686 108642       rl  w2  x2          ;   if next device.kind <> temp link or
34687 108644       rl  w0  x2          ;     (next device.kind =  temp link and
34688 108646       sn  w0      85      ;      next device = child.console) then
34689 108648       sn. w2    (i26.)    ;
34690 108650       jd     1<11+12      ;      include user(device,name addr);
34691 108652       rl. w2     i28.     ;   restore exception table address;
34692 108654  i4:  al  w1  x1+1        ;   devno:=devno+1;
34693 108656       se  w1     a127     ;   if devno<>number of peripheral processes then
34694 108658       jl.        i1.      ;     goto include;
34695 108660  
34695 108660  ; give the child the required backing storage claims
34696 108660  ; if claims cannot be granted, the process is
34697 108660  ; removed and an alarm message is issued
34698 108660       rl. w2     e25.     ;
34699 108662       al  w3      -1      ;
34700 108664       rs. w3     e79.     ;
34701 108666       bz  w0  x2+c27      ;
34702 108668       so  w0    1<10      ;   if all bs (console)
34703 108670       jl.         i8.     ;   then begin
34704 108672  c.(:c23>16 a.1:)-1
34705 108672       rl  w3     b22      ;  
34706 108674  i5:  rs. w3     i11.     ;   next device:
34707 108676       rl  w3  x3          ;   w3:= chaintable
34708 108678       rl  w0  x3-a88+16   ;  
34709 108680       sn  w0       0      ;   if chaintable <> free
34710 108682       jl.         i7.     ;   then begin
34711 108684       dl  w1  x3-a88+18   ;
34712 108686       ds. w1     e21.     ;
34713 108688  
34713 108688       dl  w1  x3-a88+22   ;
34714 108690       ds. w1     e23.     ;   work device:= docname(chaintab)
34715 108692       al. w2  e20.         ;
34716 108694       jl. w1  d73.         ; lookup bs claims(device,s)
34717 108696       rl. w3  e25.         ;
34718 108698       al  w3  x3+c29       ;
34719 108700       jd     1<11+78      ;
34720 108702       se  w0       0      ; if result<>0
34721 108704       jl.       (r20.)    ;
34722 108706  
34722 108706  i7:  rl. w3     i11.     ;  
34723 108708       al  w3  x3  +2      ;   chaintab:= chaintab + 2
34724 108710       se  w3    (b24)     ;   if chain <> chain end
34725 108712       jl.         i5.     ;   then goto next device
34726 108714       jl.        (i2.)    ;   return
34727 108716  i12:0                 ;  
34728 108718  i11:0                 ;   end
34729 108720  z.                      ;
34730 108720       jl.       (r18.)    ;
34731 108722  i21: 240<12 + 7       ; pr,pk usermode
34732 108724  
34732 108724  ; transfer claims to child,
34733 108724  ; the claimlist in the console-description
34734 108724  
34734 108724  i8:                    ; not 'all' bs (console):
34735 108724       rl. w3     e25.   ;   w3 := claimbase := console;
34736 108726  i13:                   ; next chaintable:
34737 108726       rs. w3     i22.   ;   save claimbase;
34738 108728  
34738 108728       dl  w1  x3+c44+6  ;   perm claim := claimlist(claimbase);
34739 108730       ds. w1     i24.   ;
34740 108732       wa  w0  x3+c44+0  ;   temp entries := temp+perm entry claim;
34741 108734       wa  w1  x3+c44+2  ;   temp segms   := temp+perm segm  claim;
34742 108736       rs. w0     i23.   ;   main entries := temp entries;
34743 108738       al  w0     0      ;   temp entries := 0;
34744 108740  
34744 108740       ws. w3     e25.   ;   w3 := index in claimlist;
34745 108742       ls  w3    -2      ;
34746 108744       wa  w3     b22    ;   w3 := chain table number;
34747 108746       sl  w3    (b24)   ;   if all chains handled then
34748 108748       jl.       (i2.)   ;     return;
34749 108750       rl  w3  x3        ;   w3 := chain table addr;
34750 108752  
34750 108752       rl. w2     r20.   ;   error addr := claims exceeded;
34751 108754  
34751 108754  i14:                   ; transfer claim:
34752 108754  ; w0=temp entries, w1=temp segments
34753 108754  ; w2=error address
34754 108754  ; w3=chaintable address
34755 108754       rs. w2     i20.   ;   save(error addr);
34756 108756       al  w2     0      ;   key := 0;
34757 108758  i15:                   ; next key:
34758 108758       ds. w1  x2+e52.   ;   claim(key) := entries,segments;
34759 108760       al  w2  x2+4      ;   increase(key);
34760 108762       sn  w2     a109*4 ;   if key = min aux key then
34761 108764       dl. w1     i24.   ;     entries,segments := perm claim;
34762 108766       sh  w2     a110*4 ;   if key <= max cat key then
34763 108768       jl.        i15.   ;     goto next key;
34764 108770  
34764 108770       dl  w1  x3-a88+18 ;   name := docname.chaintable;
34765 108772       ds. w1     e21.   ;
34766 108774       dl  w1  x3-a88+22 ;
34767 108776       ds. w1     e23.   ;
34768 108778  
34768 108778       rl. w3     e25.   ;   w3 := proc name;
34769 108780       al  w3  x3+c29    ;
34770 108782       al. w2     e20.   ;   w2 := docname;
34771 108784       al. w1     e51.   ;   w1 := claim;
34772 108786       jd         1<11+78;   set bs claim;
34773 108788       sn  w0     0      ;   if result = ok then
34774 108790       jl.        i16.   ;     goto maincat entries;
34775 108792       se  w0     1      ;   if result <> claims exceeded then
34776 108794       jl.        i17.   ;     goto next entry;
34777 108796       jl. w3     d40.   ;   remove child;
34778 108798       jl.       (i20.)  ;   goto error;
34779 108800  
34779 108800  i16:                   ; maincat entries:
34780 108800       ld  w1    -100    ;   perm claim := 0,0;
34781 108802       ds. w1     i24.   ;
34782 108804       rx. w0     i23.   ;   w0 := main entries; main entries := 0;
34783 108806       rl  w3     b25    ;   w3 := main catalog chain table;
34784 108808       rl. w2     r25.   ;   w2 := error addr := no maincat entries;
34785 108810       se  w0     0      ;   if main entries <> 0 then
34786 108812       jl.        i14.   ;     goto transfer claim;
34787 108814  
34787 108814  i17:                   ; next entry:
34788 108814       rl. w3     i22.   ;   increase (claimbase);
34789 108816       al  w3  x3+8      ;
34790 108818       jl.        i13.   ;   goto next chaintable;
34791 108820  
34791 108820  i20: 0                 ; error addr
34792 108822  i22: 0                 ; claimbase
34793 108824  i23: 0                 ; main entries;
34794 108826  i24=k+2, 0,0           ; perm claim (entries, segments)
34795 108830  
34795 108830  i2:0                 ;   end
34796 108832  i26: 0                    ; child.console
34797 108834  i28: 0                    ; save exception table addr.
34798 108836  
34798 108836  e.                      ; end
34799 108836  
34799 108836  ; procedure modify child(addr)
34800 108836  ; comment: modifies the registers of the current child as follows:
34801 108836  ;     child w0 = 0 or process description of parent console
34802 108836  ;     child w1 = process description of s
34803 108836  ;     child w2 = process description of parent console
34804 108836  ;     child w3 = process description of child
34805 108836  ;     child ex = 0
34806 108836  ;     child ic = addr
34807 108836  ;     call:     return:
34808 108836  ; w0  addr      destroyed
34809 108836  ; w1            destroyed
34810 108836  ; w2            destroyed
34811 108836  ; w3  link      destroyed
34812 108836  
34812 108836  b.i24                   ; begin
34813 108836  w.d36:rs. w3  i0.       ;
34814 108838       rs. w0     e66.     ;   child ic:=addr;
34815 108840       rl. w0      b1.     ;
34816 108842       rs. w0     e62.     ;   child w1:=s;
34817 108844       jl. w3     d33.     ;   child name;
34818 108846       jl. w3     d25.     ;   find parent(child,terminal,coretableelement,
34819 108848       am           0      ;               irrelevant);
34820 108850       rs. w1     e61.     ;   child w0:= child w2;
34821 108852       ds. w2     e64.     ;   child w3:=child;
34822 108854  ; override these default w0 and w2 assignments,
34823 108854  ; in case of user-defined primary input (or -output) names
34824 108854       al  w1  x3+c19    ;   w1 := addr of primary input descr;
34825 108856       rl  w0  x1+2      ;
34826 108858       se  w0     0      ;   if name defined then
34827 108860       rs. w1     e61.   ;     child w0 := primary input descr;
34828 108862       al  w1  x3+c93    ;   w1 := addr of primary output descr;
34829 108864       rl  w0  x1+2      ;
34830 108866       se  w0     0      ;   if name defined then
34831 108868       rs. w1     e63.   ;     child w2 := primary output descr;
34832 108870  
34832 108870       al. w1     e61.     ;
34833 108872       al. w3     e40.     ;   modify internal process(
34834 108874       jd     1<11+62      ;       receiver, child w0);
34835 108876       jl.        (i0.)    ;
34836 108878  i0:0                 ;
34837 108880  e.                      ; end
34838 108880  
34838 108880  ; procedure load child
34839 108880  ; comment: loads a program from backing store into
34840 108880  ; a child process in accordance with the console parameters.
34841 108880  ; the program must be described as follows in the catalog:
34842 108880  ;            <size of area>
34843 108880  ;            <6 irrelevant words>
34844 108880  ;            <first segment to load>
34845 108880  ;            <content=3><instruction counter>
34846 108880  ;            <bytes to load>
34847 108880  ;     call:     return:
34848 108880  ; w0            destroyed
34849 108880  ; w1            destroyed
34850 108880  ; w2            destroyed
34851 108880  ; w3  link      destroyed
34852 108880  
34852 108880  b.i24                   ; begin
34853 108880  w.d37:                  ; create and look up:
34854 108880       rl. w1      e29.    ; if state.process <> wait start 
34855 108882       zl  w1  x1+a13      ; then goto error
34856 108884       so  w1  2.100000    ; 
34857 108886       jl.         g3.     ;
34858 108888       rl. w2     e25.     ;
34859 108890       dl  w1  x2+c40+2    ;
34860 108892       ds. w1     e41.     ;
34861 108894       dl  w1  x2+c40+6    ;
34862 108896       ds. w1     e43.     ;   receiver:=prog(console);
34863 108898       rs. w3     i20.     ;
34864 108900       dl  w1  x2+c43+2    ; get catbase of console.(child)
34865 108902       al. w3      i1.     ; name=0
34866 108904       jd     1<11+72      ; catbase(s)=catbase(child)
34867 108906       se  w0       0      ; if not ok then
34868 108908       jl.        g19.     ; goto end line base illegal
34869 108910       al. w3     e40.     ;
34870 108912       jd     1<11+52      ; create area process(prog)
34871 108914       al. w3      i1.     ; prevent remove of process
34872 108916       sn  w0       2      ; if result=2 or
34873 108918       jl.        i10.     ;
34874 108920       sn  w0       3      ; result=3 or
34875 108922       jl.         i9.
34876 108924       se  w0       0      ; result<>0 then
34877 108926       jl.        i11.     ; goto give up
34878 108928       al. w3      e40.    ; 
34879 108930       al. w1     e51.     ;   look up entry(
34880 108932       jd     1<11+42      ;     receiver,tail,result);
34881 108934       sn  w0       2      ;   if result=2
34882 108936       jl.         i10.     ;   then goto give up 0;
34883 108938       rl. w2     e29.     ; check description:
34884 108940       bz. w0     e59.     ;
34885 108942       se  w0       3      ;   if content(tail)<>3
34886 108944       sn  w0       8      ;   and content(tail)<>8
34887 108946       sz                  ;
34888 108948       jl.         i11.     ;   then goto give up 0;
34889 108950       rl  w0  x2+a17      ;   first addr(area mess):=
34890 108952       wa  w0  x2+a182
34891 108954       zl. w1     e67.     ; child ic:= first addr(child) (logical) +
34892 108956       wa  w1  x2+a17      ; ic(tail)
34893 108958       rs. w1     e66.     ;
34894 108960       sl  w1  (x2+a18)    ; if ic > top addr(child) then
34895 108962       jl.        i13.     ; give up
34896 108964       rl  w1  x2+a18      ; save physical top(child)
34897 108966       wa  w1  x2+a182     ;
34898 108968       al  w2  x1          ;
34899 108970       rl. w1     e60.     ;   first addr(child);
34900 108972       al  w1  x1+511      ;
34901 108974       as  w1      -9      ;   load size:=
34902 108976       as  w1       9      ;   (bytes(tail)+511)/512*512;
34903 108978       wa  w1       0      ;   last addr(area mess):=
34904 108980       al  w1  x1  -2      ;   first addr(child)+load size-2;
34905 108982       sl  w1  x2          ;   if last addr(area mess)>=
34906 108984       jl.         i13.     ;     top addr(child)
34907 108986       ds. w1     e49.     ;     then goto give up 0;
34908 108988       rl. w1     e58.     ;   segment(area mess):=
34909 108990       rs. w1     e50.     ;   segment(tail);
34910 108992       al. w1     e47.     ; load program:
34911 108994       jd     1<11+16      ;   send mess(receiver,area mess,buf);
34912 108996       al. w1     e51.     ;
34913 108998       jd     1<11+18      ;   wait answer(buf,answer,result);
34914 109000  
34914 109000       rl. w1     e51.     ;
34915 109002       sn  w0       1      ;   if result<>1 
34916 109004       se  w1       0      ;   or status(answer)<>0
34917 109006       jl.         i14.     ;   then goto give up 0;
34918 109008       al. w3     e40.     ;
34919 109010       jd     1<11+64      ;   remove process(receiver,result);
34920 109012       rl. w0     e66.     ;
34921 109014       jl. w3     d36.     ;   modify child(child ic);
34922 109016       rl. w2     e25.     ;
34923 109018       dl  w1  x2+c43+2    ; set catalog base
34924 109020       al. w3     e40.     ; set catalog base(version,result)
34925 109022       jd     1<11+72      ;
34926 109024       al. w3     i1.      ; (prevent remove process(proc)
34927 109026       sn  w0      0       ; if not ok then
34928 109028       jl.        i15.     ; goto restore base(s)
34929 109030       am          2       ; base illegal
34930 109032   i9:  am      2          ; 
34931 109034  i10:  am      2          ;
34932 109036  i11:  am      2          ;
34933 109038  i12: am           2      ; area reserved
34934 109040  i13: am           2      ; program too big
34935 109042  i14: rl. w2     i16.     ; area error
34936 109044       rs. w2     i20.     ; store exit
34937 109046       jd     1<11+64      ; remove process(prog)
34938 109048  i15: dl. w1      i2.     ; restore base(s)
34939 109050       al. w3      i1.     ;
34940 109052       jd     1<11+72      ;
34941 109054       jl.       (i20.)    ; exit
34942 109056  i1: 0
34943 109058      a107
34944 109060  i2: a108-1
34945 109062   i3 : 2.100000            ; state bit : wait for stop or start
34946 109064  i20: 0
34947 109066  i16: g15                 ; 0
34948 109068       g14                 ; +2
34949 109070       g13                 ; +4
34950 109072       g12                 ; +6
34951 109074       g11                 ; +8
34952 109076       g29                 ; +10
34953 109078       g19                 ; +12
34954 109080  e.
34955 109080  
34955 109080  ; procedure start child
34956 109080  ; comment: starts a child process.
34957 109080  ;     call:     return:
34958 109080  ; w0            destroyed
34959 109080  ; w1            destroyed
34960 109080  ; w2            destroyed
34961 109080  ; w3  link      destroyed
34962 109080  
34962 109080  b.i24                   ; begin
34963 109080  w.
34964 109080  d38: rs. w3  i0.       ;
34965 109082       jl. w3     d33.     ;   child name;
34966 109084       al. w3     e40.     ;
34967 109086       jd     1<11+58      ;   start internal process(receiver,result);
34968 109088       al. w3  i10.        ; wait:
34969 109090       al. w1  i11.        ;
34970 109092       jd      1<11+16     ;   send message(clock,wait);
34971 109094       al. w1  i12.        ;
34972 109096       jd      1<11+18     ;   wait answer(answer area);
34973 109098       jl.        (i0.)    ;
34974 109100  
34974 109100  i0:0                     ;
34975 109102  i10: <:clock:>,0,0,0   ;   clock-name and name table entry
34976 109112  
34976 109112  i11: 0<12              ;   delay message
34977 109114       1                 ;   time (in seconds) 
34978 109116  i12: 0,r.8             ;   answer area
34979 109132  e.                      ; end
34980 109132  
34980 109132  
34980 109132  ; procedure stop child
34981 109132  ; comment: stops a child process.
34982 109132  ;     call:     return:
34983 109132  ; w0            destroyed
34984 109132  ; w1            destroyed
34985 109132  ; w2            destroyed
34986 109132  ; w3  link      destroyed
34987 109132  
34987 109132  b.i24                   ; begin
34988 109132  w.d39:rs. w3  i0.       ;
34989 109134       jl. w3     d33.     ;   child name;
34990 109136       al. w3     e40.     ;
34991 109138       jd     1<11+60      ;   stop internal process(receiver,buf,result);
34992 109140       al. w1     e51.     ;
34993 109142       jd     1<11+18      ;   wait answer(buf,answer,result);
34994 109144       jl.        (i0.)    ;
34995 109146  i0:0                 ;
34996 109148  e.                      ; end
34997 109148  
34997 109148  ; procedure remove child
34998 109148  ; comment: excludes a child as a user of all devices and
34999 109148  ; removes it.
35000 109148  ;     call:     return:
35001 109148  ; w0            destroyed
35002 109148  ; w1            destroyed
35003 109148  ; w2            destroyed
35004 109148  ; w3  link      destroyed
35005 109148  
35005 109148  b.i24                   ; begin
35006 109148  w.d40:rs. w3  i1.       ;
35007 109150       jl. w3     d33.     ;   child name;
35008 109152       jl. w3     d25.     ;   find parent(child,console,
35009 109154       am           0      ;               irrelevant);
35010 109156       al. w3     e40.     ;
35011 109158       jd     1<11+64      ;
35012 109160       se  w0        0     ; if result not ok then
35013 109162       jl.         g11.    ; write out catalog error
35014 109164       jl. w3      d31.    ; release core
35015 109166       jl.        (i1.)    ;
35016 109168  i1:0                 ;
35017 109170  e.                      ; end
35018 109170  
35018 109170  ; procedure find work(state,work)
35019 109170  ; comment: searches a work area in a given state.
35020 109170  ; return: link + 0: not found
35021 109170  ;         link + 2: found
35022 109170  ;     call:     return:
35023 109170  ; w0            unchanged
35024 109170  ; w1            work
35025 109170  ; w2  state     state
35026 109170  ; w3  link      link
35027 109170  
35027 109170  b.i24                   ; begin
35028 109170  w.
35029 109170  d41:                   ; find work:
35030 109170       rl. w1     e13.   ;   work := first work;
35031 109172  i0:                    ; loop:
35032 109172       rs. w1     e24.   ;
35033 109174       sn  w2 (x1+c50)   ;   if state(work) = state then
35034 109176       jl      x3+2      ;     return ok;
35035 109178       al  w1  x1+c2     ;   increase(work);
35036 109180       sh. w1    (e14.)  ;   if work <= last work then
35037 109182       jl.        i0.    ;     goto loop;
35038 109184       jl         x3     ;   return sorry
35039 109186  e.                      ; found:
35040 109186  ; end;
35041 109186  
35041 109186  
35041 109186  ; procedure save work(state)
35042 109186  ; comment: saves a state and a number of variables in the
35043 109186  ; current work area and proceeds to examine the event queue.
35044 109186  ;     call:     return:
35045 109186  ; w0            destroyed
35046 109186  ; w1            work
35047 109186  ; w2  state     destroyed
35048 109186  ; w3  link      link
35049 109186  
35049 109186  b.i24                   ; begin
35050 109186  w.d42:rl. w1  e24.      ;   state(work):=state;
35051 109188       ds  w3  x1+c51      ;   interrupt addr(work):=link;
35052 109190       rs. w2     e88.   ;   expected answer := state;
35053 109192       al. w2  e20.      ;
35054 109194  i0:  rl  w0  x2  +0      ;
35055 109196       rs  w0  x1+c90      ;   save(console)
35056 109198       al  w1  x1  +2      ;   to(core addr)
35057 109200       al  w2  x2  +2      ;   in(work);
35058 109202       sh. w2     e30.     ;
35059 109204       jl.         i0.     ;
35060 109206       rl. w3      e2.     ;
35061 109208       al  w3  x3  -1      ;   own buf:= own buf-1
35062 109210       rs. w3      e2.     ;
35063 109212       jl.        g30.     ;   goto exam first;
35064 109214  e.                      ; end
35065 109214  
35065 109214  ; procedure restore work(work, state)
35066 109214  ; comment: restores a number of variables from a work area
35067 109214  ; and jumps to the interrupt address.
35068 109214  ;     call:     return:
35069 109214  ; w0            logical status
35070 109214  ; w1            work
35071 109214  ; w2            state
35072 109214  ; w3  link
35073 109214  ;
35074 109214  ; return address: link + 0 :  status <> 0
35075 109214  ;                 link + 2 :  status =  0
35076 109214  
35076 109214  b.i24                   ; begin
35077 109214  w.d43:rl. w1  e24.      ;
35078 109216       al. w2     e20.     ;
35079 109218       rs. w2     e87.   ;   areabuf := undef;
35080 109220  i0:  rl  w0  x1+c90      ;
35081 109222       rs  w0  x2  +0      ;   restore(console)
35082 109224       al  w1  x1  +2      ;   to(core addr)
35083 109226       al  w2  x2  +2      ;   from(work);
35084 109228       sh. w2     e30.     ;
35085 109230       jl.         i0.     ;
35086 109232       rl. w1     e24.     ;   state:=state(work);
35087 109234       al  w2       0      ;   state(work):=0;
35088 109236       rx  w2  x1+c50      ;
35089 109238       rl. w3      e2.     ;
35090 109240       al  w3  x3  +1      ;   own buf:= own buf+1
35091 109242       rs. w3      e2.     ;
35092 109244       rl. w0     e59.     ;   w0 := logical status;
35093 109246       se  w0     1<1      ;   if status <> 0 then
35094 109248       jl     (x1+c51)     ;     goto interrupt addr(work);
35095 109250       am     (x1+c51)     ;   goto 2 + interrupt addr(work);
35096 109252       jl          +2      ;
35097 109254  e.                      ; end
35098 109254  
35098 109254  ; procedure next bitnumbers(bits, type)
35099 109254  ; comment: converts a sequence of integers from the console buffer
35100 109254  ; and sets the corresponding bits in a word equal to one.
35101 109254  ;     call:     return:
35102 109254  ; w0            type
35103 109254  ; w1            unchanged
35104 109254  ; w2            bits
35105 109254  ; w3  link      link
35106 109254  
35106 109254  b.i24                   ; begin
35107 109254  w.d45:rs. w3  i1.       ;
35108 109256       al  w2       0      ;   bits:=0;
35109 109258  i0:  jl. w3      d2.     ; next bit:
35110 109260       se  w0       2      ;   next param(type);
35111 109262       jl.        (i1.)    ;   if type=2 then
35112 109264       ac. w3    (e19.)    ;   begin
35113 109266       al  w0       1      ;
35114 109268       ls  w0  x3 +23      ;   bits(23-integer):=1;
35115 109270       lo  w2       0      ;   goto next bit;
35116 109272       jl.         i0.     ;   end;
35117 109274  i1:0                 ;
35118 109276  e.                      ; end
35119 109276  
35119 109276  ; procedure  reset last part of console
35120 109276  ; comment sets zeroes in whole claimlist of console descr
35121 109276  ; and in primin and primout.
35122 109276  ; initialize first logic address to standart value.
35123 109276  ;
35124 109276  ; call: w3 = link
35125 109276  ; exit: all regs undef
35126 109276  
35126 109276  b. i10 w.
35127 109276  d46:                   ; clear claimlist:
35128 109276       rl. w1     e25.   ;   w1 := console;
35129 109278       al  w2  x1+c48-c49+2;   w2 := rel top of area to be cleared;
35130 109280       al  w0     0      ;
35131 109282  i0:                    ; rep:
35132 109282       sl  w1  x2        ;   if pointer <= start of console then
35133 109284       jl.       i1.
35134 109286       al  w2  x2-2      ; decrease pointer
35135 109288       rs  w0  x2+c49    ;   claimlist(pointer) := 0;
35136 109290       jl.        i0.    ;   goto rep;
35137 109292  i1:  rl. w0     e72.   ; set first logic address
35138 109294       rs  w0  x1+c97    ; and cpa
35139 109296       al  w0     -1     ; return
35140 109298       rs  w0  x1+c98    ;
35141 109300       jl      x3        ;
35142 109302  
35142 109302  e.
35143 109302  
35143 109302  
35143 109302  ; procedure release temp link(console addr);
35144 109302  ; comment if the console is a temp link it will be removed.
35145 109302  ; (if s is the only user 'remove process' will remove the link.)
35146 109302  ;
35147 109302  ;         call           return
35148 109302  ;                        link+2: ok     link: error
35149 109302  ; w0:                    destroyed
35150 109302  ; w1:                    destroyed
35151 109302  ; w2: console addr       console addr
35152 109302  ; w3: link               link
35153 109302  ;
35154 109302  b. i10 w.
35155 109302  
35155 109302  d48:                       ; begin
35156 109302       rl. w1     e25.         ;   w1:=curr console
35157 109304       zl  w0  x1+c27          ;
35158 109306       sz  w0     1<3          ;   if privileged console then
35159 109308       jl      x3              ;   return
35160 109310       rl  w1  x2+  a10      ;   if console.kind<>temp link
35161 109312       se  w1        85      ;
35162 109314       sn  w1     q8           ;   or console.kind<>csp terminal then
35163 109316       sz                      ;
35164 109318       jl      x3            ;     error return;
35165 109320  
35165 109320       rs. w3        i3.     ;
35166 109322       dl  w1  x2+a11+2      ;   <* get and move name of link *>
35167 109324       ds. w1        i1.     ;
35168 109326       dl  w1  x2+a11+6      ;
35169 109328       ds. w1        i2.     ;
35170 109330       al. w3        i0.     ;
35171 109332       jd      1<11+64       ;   remove process(temp link);
35172 109334       rl. w3        i3.     ;   if result = ok then
35173 109336       sn  w0         0      ;
35174 109338       am            +2      ;     ok return
35175 109340       jl      x3            ;   else error return;
35176 109342                             ;
35177 109342  i0: 0                      ; name area
35178 109344  i1: 0,0                    ;
35179 109348  i2: 0                      ;
35180 109350  i3: 0                      ; save link
35181 109352  
35181 109352  e.
35182 109352  c. (:a80>16a.1:)-1     ; if itc included
35183 109352  
35183 109352  
35183 109352  b. m0 , n2   w.        ; block including procedures used by itc controller commands
35184 109352  
35184 109352  m0:  0,0,0,0,0         ; save name area + name table address
35185 109362  
35185 109362  
35185 109362  
35185 109362  ; procedure connect(name address, param address, devno, log status);
35186 109362  ;
35187 109362  ; procedure initalize_main(name address,buffers,log status);
35188 109362  ;
35189 109362  ; a connect operation (specified by the parameters) is send to the
35190 109362  ; itc main process specified by name. if the connection is made the
35191 109362  ; rc8000 devno is returned else logical status is returned.
35192 109362  ; format of the param area must be:
35193 109362  ;
35194 109362  ;         connect                                  initialize
35195 109362  ;  + 0: control module or formatter number         max buffs
35196 109362  ;  + 2: disc unit or station number
35197 109362  ;  + 4: wanted rc8000 devno of connection or
35198 109362  ;       -1 if no specific devno is wanted
35199 109362  ;  + 6: device kind, device type
35200 109362  ;
35201 109362  ;               call                     return
35202 109362  ;       connect           initialize
35203 109362  ;  w0   -                                logical status
35204 109362  ;  w1   name address      name address   destroyed
35205 109362  ;  w2   param address     buffers        devno
35206 109362  ;  w3   link              link           destroyed
35207 109362  ;
35208 109362  ;  return: link + 0: error (devno not valid)
35209 109362  ;          link + 2: ok
35210 109362  ;
35211 109362  
35211 109362  b.  i5, j5  w.
35212 109362  
35212 109362  d59: am         16     ; procedure inittialize_main
35213 109364  d51: al  w0     6      ; procedure connect
35214 109366       rs. w0     i0.    ;
35215 109368       rs. w3     e83.   ; begin
35216 109370       dl  w0  x1+2      ;   <* save return in stack part of work area *>
35217 109372       ds. w0     m0.+2  ;   <* move name to name area *>
35218 109374       dl  w0  x1+6      ;
35219 109376       ds. w0     m0.+6  ;
35220 109378       al. w1     e32.   ;   <* move parameters to message area *>
35221 109380       rl. w0     i0.    ;   message.operation := connect/initialize;
35222 109382       hs  w0  x1+0      ;
35223 109384       se  w0     6      ;   if connect then
35224 109386       jl.        j2.    ;   begin
35225 109388       al  w0     1      ;   message.mode := include all users;
35226 109390       hs  w0  x1+1      ;
35227 109392       dl  w0  x2+2      ;     message.cm := param.cm;
35228 109394       ds  w0  x1+4      ;     message.unit := param.unit;
35229 109396       dl  w0  x2+6      ;     message.devno:= param.devno;
35230 109398       ds  w0  x1+8      ;     message.devkind, type := param.devkind, type;
35231 109400       rl  w0  x2+8      ;
35232 109402       rs  w0  x1+10     ;     message.count:=max buffer
35233 109404       jl.        j3.    ;   end else
35234 109406  j2:  rs  w2  x1+2      ;   message.buffs:=param.buffres;
35235 109408  j3:  al. w3     m0.    ;
35236 109410       jd      1<11+16   ;   send message(connect message, itcmain);
35237 109412       jl. w3     d42.   ;   save work;
35238 109414       jl.        j1.    ;   +0: error: goto error;
35239 109416                         ;   +2: ok:
35240 109416  j0:  rl. w2     e52.   ;   devno := answer.devno;
35241 109418       am.       (e83.)  ;
35242 109420       jl        +2      ;   ok-return;
35243 109422                         ;
35244 109422  j1:  sz  w0   2.111101 ; error:
35245 109424       jl.       (e83.)  ;   if not result-error then
35246 109426       rl  w1     0      ;   begin
35247 109428       ls  w1    -8      ;     if status.result = 0 then
35248 109430       sz  w1   2.111111 ;          goto ok-return
35249 109432       jl.       (e83.)  ;     else error-return;
35250 109434       al  w0     1<1    ;     <it is assumed that status.result=0 =>
35251 109436       jl.        j0.    ;      device description=1!>
35252 109438                         ;   end else error-return;
35253 109438  i0:  0                 ;   link kind;
35254 109440  e.                     ; end;
35255 109440  
35255 109440  
35255 109440  
35255 109440  ; procedure disconnect(device number);
35256 109440  ;
35257 109440  ; a disconnect operation is send to the itc main process which is 
35258 109440  ; supervisor for the specified device.
35259 109440  ;
35260 109440  ;       call              return
35261 109440  ;  w0   device number     logical status
35262 109440  ;  w1   -                 destroyed
35263 109440  ;  w2   -                 destroyed
35264 109440  ;  w3   link              destroyed
35265 109440  ;
35266 109440  ;  return: link + 0: error - w0 contains logical status.
35267 109440  ;          link + 2: ok -    w0 is undefined.
35268 109440  ;
35269 109440  
35269 109440  b. i5, j5  w.
35270 109440  
35270 109440  d52:                   ; disconnect
35271 109440       rs. w3     e83.   ; begin
35272 109442       al. w1     e32.   ;
35273 109444       rs  w0  x1+2      ;   message.rc8000 devno := device number;
35274 109446       al  w2     10     ;
35275 109448       ls  w2    +12     ;   message.operation, mode :=
35276 109450       rs  w2  x1+0      ;   disconnect, 0;
35277 109452       rl  w1     0      ;
35278 109454       jl. w3     d56.   ;   check device(devno);
35279 109456       jl.        j3.    ;   +0: error: goto simulate result 3;
35280 109458       al  w2  x2+a11    ;   +2: ok:
35281 109460       al. w3     e20.   ;
35282 109462       jl. w1     n2.    ;   move name(itcmain.name, name area);
35283 109464                         ;
35284 109464       al. w1     e32.   ;
35285 109466       jd      1<11+16   ;   send message(disconnect mess, itcmain.name);
35286 109468       jl. w3     d42.   ;   save work(buffer);
35287 109470       jl.        j4.    ;   +0: error:
35288 109472                         ;   +2: ok:
35289 109472  j0:  am.       (e83.)  ;   ok-return;
35290 109474       jl        +2      ;
35291 109476                         ;   else
35292 109476                         ;   error-return:
35293 109476  j3:  al  w0     1<3    ;   simulate result 3;
35294 109478  j4:  jl.       (e83.)  ;   error return;
35295 109480                         ;
35296 109480  e.                     ; end;
35297 109480  
35297 109480  
35297 109480  ; procedure link(param,devno,logical status);
35298 109480  ;
35299 109480  ; a link operation is send to the ida main process which supervice the
35300 109480  ; physical disc stated in the param area.
35301 109480  ;
35302 109480  ;      call               return
35303 109480  ;  w0: -                  logical status
35304 109480  ;  w1: -                  destroyed
35305 109480  ;  w2: param address      device no of logical disc 
35306 109480  ;  w3: link               destroyed
35307 109480  ;
35308 109480  ;  return: link + 0: error: result or status error
35309 109480  ;          link + 2: ok:    w2 contains device number of logical disc
35310 109480  ;
35311 109480  ;      format of param area:
35312 109480  ;  +0: devno of logical disc or -1
35313 109480  ;  +2: devno of physical disc
35314 109480  ;  +4: first segment
35315 109480  ;  +6: no of segments
35316 109480  ;
35317 109480  
35317 109480  b.  i5, j5  w.
35318 109480  
35318 109480  d53:                   ; procedure link
35319 109480       rs. w3     i3.    ; begin
35320 109482       al. w1     e32.   ;   
35321 109484       dl  w0  x2+2      ;   <*.move param to message area *>
35322 109486       ds  w0  x1+4      ;
35323 109488       dl  w0  x2+6      ;
35324 109490       ds  w0  x1+8      ;
35325 109492       al  w0     16     ;   message.operation, mode :=
35326 109494       ls  w0    +12     ;   link logical disc, include all users;
35327 109496       ba. w0     1      ;
35328 109498       rs  w0  x1+0      ;
35329 109500                         ;
35330 109500       rl  w1  x1+4      ;
35331 109502       jl. w3     d56.   ;   check device(devno);
35332 109504       jl.        j3.    ;   +0: error: goto simulate result 3;
35333 109506                         ;   +2: ok:
35334 109506       al  w2  x2+a11    ;
35335 109508       al. w3     m0.    ;
35336 109510       jl. w1     n2.    ;   move name(idamain, name area);
35337 109512       al. w1     e32.   ;
35338 109514       jd      1<11+16   ;   send message(link message, idamain.name);
35339 109516       al. w1     e51.   ;
35340 109518       jd      1<11+18   ;   wait answer(answer, result);
35341 109520       jl.        j1.    ;
35342 109522                         ;
35343 109522  j3:  al  w0     3      ;   simulate result 3:
35344 109524       sz                ;
35345 109526  j1:                    ;   return:
35346 109526       rl. w2     e52.   ;   devno of link := answer.devno of logical disc;
35347 109528       rl. w3     i3.    ;
35348 109530       jl.        n1.    ;   compute logical status and return;
35349 109532                         ;
35350 109532  i3:  0                 ;   link
35351 109534                         ;
35352 109534  e.                     ; end;
35353 109534  
35353 109534  
35353 109534  ; procedure unlink(devno);
35354 109534  ;
35355 109534  ; a unlink logical disc operation is send to the ida main process which
35356 109534  ; supervise the stated logical disc.
35357 109534  ;
35358 109534  ;      call                return
35359 109534  ;  w0  devno of log disc   logical status
35360 109534  ;  w1  -                   logical status
35361 109534  ;  w2  -                   destroyed
35362 109534  ;  w3  link                destroyed
35363 109534  ;
35364 109534  ;  return: link + 0: error
35365 109534  ;          link + 2: ok
35366 109534  ;
35367 109534  
35367 109534  b. i5, j5  w.
35368 109534  
35368 109534  d54:                   ; procedure unlink
35369 109534       rs. w3     i3.    ; begin
35370 109536       al. w3     e32.   ;
35371 109538       rs  w0  x3+2      ;   message.devno := devno;
35372 109540       al  w1     18     ;
35373 109542       ls  w1    +12     ;   message.operation, mode := 
35374 109544       rs  w1  x3+0      ;   unlink, 0;
35375 109546       rl  w1     0      ;
35376 109548       jl. w3     d56.   ;   check device(devno);
35377 109550       jl.        j3.    ;   +0: error: goto simulate result 3;
35378 109552       se  w0     6      ;   +2: ok
35379 109554       jl.        j3.    ;   if device.kind <> idadisc then
35380 109556                         ;   goto simulate result 3;
35381 109556       al  w2  x2+a11    ;
35382 109558       al. w3     e20.   ;   move name(idamain, name area);
35383 109560       jl. w1     n2.    ;
35384 109562       al. w1     e32.   ;
35385 109564       jd      1<11+16   ;   send message(unlink mess, idamain.name);
35386 109566                         ;
35387 109566       al. w1     e51.   ;
35388 109568       jd      1<11+18   ;   wait answer(answer, result);
35389 109570       jl.        j1.    ;
35390 109572                         ; return answer:
35391 109572  j3:  al  w0     3      ;   simulate result 3:
35392 109574  j1:  rl. w3     i3.    ; return:
35393 109576       jl.        n1.    ;   compute logical status and return;
35394 109578                         ;
35395 109578  i3:  0                 ;   saved link
35396 109580                         ;
35397 109580  e.                     ; end;
35398 109580  
35398 109580  
35398 109580  ; procedure read segment(segment, devno);
35399 109580  ; procedure write segment(segment, devno);
35400 109580  ;
35401 109580  ; the specified segment is input to the disc description buffer or the
35402 109580  ; buffer is output to the disc with the specified device no.
35403 109580  ;
35404 109580  ;      call                return
35405 109580  ;  w0  segment             logical status
35406 109580  ;  w1  devno               logical status
35407 109580  ;  w2  -                   destroyed
35408 109580  ;  w3  link                destroyed
35409 109580  ;
35410 109580  ;  return: link + 0: disc error
35411 109580  ;          link + 2: ok
35412 109580  ;
35413 109580  
35413 109580  b.  i10, j10  w.
35414 109580  d55: am        -2      ; read segment
35415 109582  d57: al  w2     5      ; write segment
35416 109584       ls  w2    +12     ; begin
35417 109586       rs. w3     i3.    ;
35418 109588       rs. w3     i4.    ;   wrkname := undefined;
35419 109590       rs. w1     i1.    ;
35420 109592       al. w3     e32.   ;
35421 109594       rs  w2  x3+0      ;   message.operation := read or write;
35422 109596       rs  w0  x3+6      ;   message.segment := segment;
35423 109598       dl. w1     i5.    ;   message.first add := buffer.first;
35424 109600       ds  w1  x3+4      ;   message.last  add := buffer.last;
35425 109602       rl. w1     i1.    ;
35426 109604                         ;
35427 109604       jl. w3     d56.   ;   check device(devno, device);
35428 109606       jl.        j4.    ;   +0: if error then goto error return;
35429 109608                         ;   +2:
35430 109608       al  w2  x1+a11    ;
35431 109610       al. w3     m0.    ;
35432 109612       jl. w1     n2.    ;   move name(device.name, name save area);
35433 109614                         ;
35434 109614  j1:  al. w1     e32.   ; reserve and send:
35435 109616       zl  w0  x1+0      ;   if operation = output then
35436 109618       sn  w0     5      ;   reserve process(disc name);
35437 109620       jd      1<11+8    ;
35438 109622       jd      1<11+16   ;   send message(messagearea, device);
35439 109624       al. w1     e51.   ;
35440 109626       jd      1<11+18   ;   wait answer(message, answer);
35441 109628       se  w0     5      ;   if result <> 5 then 
35442 109630       jl.        j2.    ;   return;
35443 109632                         ;   < result = 5 i.e. unknown >
35444 109632       al  w0     0      ;
35445 109634       rs  w0  x3+0      ;   name(0) := 0;
35446 109636       rl. w1     i1.    ;   
35447 109638       jd      1<11+54   ;   create peripheral process(name, devno);
35448 109640       se  w0     0      ;   if result <> ok then
35449 109642       jl.        j2.    ;       return;
35450 109644       rs. w0     i4.    ;   wrkname := defined;
35451 109646       jl.        j1.    ;   goto send;
35452 109648                         ;
35453 109648  j4:  al  w0     3      ; simulate result 3:
35454 109650       jl.        j3.    ;
35455 109652  j2:                    ; return:
35456 109652       rl  w2     0      ;   <save result>
35457 109654       jd      1<11+10   ;   release process(disc);
35458 109656       rl. w1     i4.    ;   if wrkname = defined then
35459 109658       sn  w1     0      ;   remove process(disc);
35460 109660       jd      1<11+64   ;
35461 109662       al  w0  x2        ;
35462 109664  j3:  rl. w3     i3.    ;
35463 109666       jl.        n1.    ;   compute logical status and return;
35464 109668                         ;
35465 109668  i1:  0                 ; devno
35466 109670  i3:  0                 ; link
35467 109672  i4:  0                 ; wrkname defined (0=defined)
35468 109674       h23               ; disc description buffer: first
35469 109676  i5:  h24               ;          --- " ---     : last
35470 109678                         ;
35471 109678  e.                     ; end;
35472 109678  
35472 109678  
35472 109678  ; procedure check device(devno);
35473 109678  ;
35474 109678  ; checks that the specified devno is legal and that the device is an
35475 109678  ; idadisc, ida mag tape or ifp gsd device.
35476 109678  ; the process description addresses of the device and the itc main process
35477 109678  ; for the device is returned.
35478 109678  ;
35479 109678  ;        call                  return
35480 109678  ;  w0    -                     kind of device
35481 109678  ;  w1    devno                 proc addr of device
35482 109678  ;  w2    -                     proc addr of itcmain of device
35483 109678  ;  w3    link                  type of device
35484 109678  ;
35485 109678  ;  return: link + 0: not an itcdevice
35486 109678  ;          link + 2: ok
35487 109678  ;
35488 109678  
35488 109678  b. i5, j5  w.
35489 109678  
35489 109678  d56:                   ; procedure check device
35490 109678       rs. w3     i3.    ; begin
35491 109680       ls  w1    +1      ;
35492 109682       wa  w1     b4     ;   device := nametable(devno);
35493 109684       sl  w1    (b4)    ;   if not device = external then
35494 109686       sl  w1    (b5)    ;   error-return;
35495 109688       jl      x3        ;
35496 109690       rl  w1  x1        ;
35497 109692       rl  w0  x1+a10    ;   if device.kind <> idadisc and
35498 109694       se  w0     6      ;      device.kind <> idamt and
35499 109696       sn  w0     18     ;      device.kind <> ifpgsd and
35500 109698       jl.        j1.    ;   ;
35501 109700       se  w0     28     ;
35502 109702       sn  w0     8      ;      device.kind <> csp_terminal then
35503 109704       jl.        j1.    ;   error return;
35504 109706       jl      x3        ;   error return;
35505 109708  j1:                    ;
35506 109708       rl  w2  x1+a50    ;   itcmain := device.main.main;
35507 109710       rl  w2  x2+a50    ;   < second load only needed for an ida logical disc >
35508 109712       zl  w3  x1+a57    ;   type := device.type;
35509 109714       am.       (i3.)   ;
35510 109716       jl        +2      ;   ok-return;
35511 109718                         ;
35512 109718  i3:  0                 ;   saved link
35513 109720                         ;
35514 109720  e.                     ; end;
35515 109720  c.(:a399>21a.1:)-1
35516 109720  ; procedure prepare dump(pda of external_proc/area_proc,address_buff);
35517 109720  ; a prepare dump is sent to the mainprocess associated with the ext/area proc
35518 109720  ;
35519 109720  ; reg    call            return
35520 109720  ; w0      -              undef
35521 109720  ; w1     pda               -
35522 109720  ; w2     address buff      -
35523 109720  ; w3     link              -
35524 109720  ;        return: link+0: not ok
35525 109720  ;                link+2  ok
35526 109720  
35526 109720  b. i5,j5 w.
35527 109720  d58: ds. w2     i2.    ;
35528 109720       rs. w3     i3.    ;
35529 109720       al. w3     m0.    ;
35530 109720       al  w2  x1+a11    ;
35531 109720       jl. w1     n2.    ; move_name(proc.name,name save area);
35532 109720       jd         1<11+8 ; reserve process
35533 109720       se  w0     0      ; if reserve ok then
35534 109720       jl.        j2.    ; begin
35535 109720       rl. w1     i1.    ;
35536 109720  j0:  rl  w1  x1+a50    ;
35537 109720       rl  w0  x1+a10    ;
35538 109720       sn  w0     q6     ;   while kind=disc kind do
35539 109720       jl.        j0.    ;   goto inspect next
35540 109720       se  w0     q20    ;   if kind=ida kind then
35541 109720       jl.        j2.    ;   begin
35542 109720       al. w3     m0.    ;
35543 109720       al  w2  x1        ;
35544 109720       jl. w1     n2.    ;     move_name(proc.name,name save area);
35545 109720       rl. w2     e106.  ;
35546 109720       se  w2     0      ;     if pp_buff sent then
35547 109720       jd         1<11+82;     regret message
35548 109720       al. w1     e32.   ;
35549 109720       rl. w2     i2.    ;
35550 109720       dl  w0  x2+2      ;
35551 109720       ds  w0  x1+4      ;     mess.low:=addres_buff.low
35552 109720       dl  w0  x2+6      ;
35553 109720       ds  w0  x1+8      ;     mess.high:=address_buff.high
35554 109720       rl. w0     i1.    ;
35555 109720       rs  w0  x1+10     ;     mess.pda:=ext_proc/area_proc
35556 109720       al  w0     2      ; 
35557 109720       hs  w0  x1+0      ;     mess.op:=prepare dump
35558 109720       jd         1<11+16;     send message
35559 109720       rs. w2     e106.  ;     pp_buff:=buffer addresss
35560 109720       am         2      ;     return ok
35561 109720  j2:  al  w0     0      ;     return not ok
35562 109720       jd         1<11+10;     release process
35563 109720       rl. w3     i3.    ;   end;
35564 109720       am         (0)    ;
35565 109720       jl      x3        ; end;
35566 109720  i1:  0                 ; saved w1
35567 109720  i2:  0                 ;   -   w2
35568 109720  i3:  0                 ;   -   w3
35569 109720  e.
35570 109720  
35570 109720  z.
35571 109720  c.-(:a399>21a.1:)
35572 109720  d58: jl      x3         ;
35573 109722  z.
35574 109722  ; procedure compute logical status and return(result, error return address)
35575 109722  ;
35576 109722  ; the logical status is created. if it signals ok status return is made to
35577 109722  ; error return + 2 else return is made to error return address.
35578 109722  ; it is assumed that e51 contains status.
35579 109722  ;
35580 109722  ;      call           return is made with
35581 109722  ;  w0  result         logical status
35582 109722  ;  w1  -              logical status
35583 109722  ;  w2  -              unchanged
35584 109722  ;  w3  error link     destroyed
35585 109722  ;
35586 109722  
35586 109722  n1:                    ; compute logical status and return
35587 109722       al  w1     1      ; begin
35588 109724       ls  w1    (0)     ;   logical status := if result error then
35589 109726       sn  w1     1<1    ;        set result error
35590 109728       lo. w1     e51.   ;   else set status error;
35591 109730       al  w0  x1        ;
35592 109732       sn  w0     1<1    ;   if logical status = ok then
35593 109734       am        +2      ;        return ok
35594 109736       jl      x3        ;   else return error;
35595 109738                         ; end;
35596 109738  
35596 109738  
35596 109738  ; procedure move name(name address, destination address);
35597 109738  ;
35598 109738  ;       call          return
35599 109738  ;  w0   -             unchanged
35600 109738  ;  w1  link           destroyed
35601 109738  ;  w2  name address   name address
35602 109738  ;  w3  destination    destination
35603 109738  ;
35604 109738  
35604 109738  b.  i5, j5  w.
35605 109738  
35605 109738  n2:                    ; procedure move name
35606 109738       ds. w1     i1.    ; begin
35607 109740       dl  w1  x2+2      ;   move the name;
35608 109742       ds  w1  x3+2      ;
35609 109744       dl  w1  x2+6      ;
35610 109746       ds  w1  x3+6      ;
35611 109748       rl. w0     i0.    ;
35612 109750       jl.       (i1.)   ; 
35613 109752                         ;
35614 109752  i0:  0                 ;
35615 109754  i1:  0                 ;
35616 109756  e.                     ; end;
35617 109756  
35617 109756  e.                     ; end of block for itc controller commands
35618 109756  z.
35619 109756  c.-(:a80>16a.1:)       ; if itc not included then insert dummy procedures
35620 109756  d51:                   ;
35621 109756  d52:                   ;
35622 109756  d53:                   ;
35623 109756  d54:                   ;
35624 109756  d55:                   ;
35625 109756  d56:                   ;
35626 109756  d57:                   ;
35627 109756  d58:                   ;
35628 109756  d59:                   ;
35629 109756       jl      x3        ;
35630 109756                         ;
35631 109756  z.                     ; end itc not included;
35632 109756  
35632 109756  ; procedure devno(name adr. , devno*8, sorry)
35633 109756  ; comment: search the chaintable for a given name and
35634 109756  ; returns deviceno.*8 (relative adr. for claim list in console table )
35635 109756  ; and chaintable address ,
35636 109756  ; or returns sorry if name not found.
35637 109756  ;     call:       return:
35638 109756  ; w0              destroyed
35639 109756  ; w1              destroyed
35640 109756  ; w2 name adr.    deviceno.*8
35641 109756  ; w3 link         chaintable adr.
35642 109756  ;
35643 109756  b. i10, j10
35644 109756  w. 
35645 109756  d61: rs. w3      i0.     ;
35646 109758       al  w1      -2      ;
35647 109760       rs. w1      i1.     ;
35648 109762   j1: rl. w3      i1.     ; next chaintable
35649 109764       al  w3  x3+2        ;
35650 109766       rs. w3      i1.     ;
35651 109768       wa  w3     b22      ; get adr of next chaintable
35652 109770                           ; if adr. of next chaintable
35653 109770       sl  w3    (b24)     ; >= top of chaintable then
35654 109772       jl.        (i0.)    ; return sorry
35655 109774       rl  w3  x3          ; begin compare  names
35656 109776       dl  w1  x3-a88+18   ; if name(chaintable)
35657 109778       sn  w0    (x2)      ; = name(adr.)
35658 109780       se  w1    (x2+2)    ; then return happy
35659 109782       jl.         j1.     ; else  get next chaintable
35660 109784       dl  w1  x3-a88+22   ;
35661 109786       sn  w0    (x2+4)    ;
35662 109788       se  w1    (x2+6)    ;
35663 109790       jl.         j1.     ;
35664 109792       rl. w2      i1.     ;
35665 109794       ls  w2       2      ;
35666 109796       rl. w1      i0. 
35667 109798       jl      x1+2
35668 109800   i0: 0
35669 109802   i1: 0
35670 109804  e.
35671 109804  c.(: c23>19 a.1:) -1                ; if list option then
35672 109804  b.i24                               ; begin
35673 109804  ; block for the list option
35674 109804  ;
35675 109804  ; procedure writespace(no of spaces)
35676 109804  ; comment this procedure writes out a number of spaces <32>
35677 109804  ;             call             return
35678 109804  ; w0                           destroyed
35679 109804  ; w1 c        no of spaces 
35680 109804  ; w2                           unchanged
35681 109804  ; w3         link              link
35682 109804  ;
35683 109804  w. d70:   rs. w3  i1.         ;
35684 109806  i10: al  w0      32      ; while no of spaces>=0
35685 109808       jl. w3     d20.     ; do
35686 109810       al  w1  x1  -1      ;
35687 109812       se  w1       0      ; writechar space
35688 109814       jl.        i10.     ;
35689 109816       jl.        (i1.)    ;
35690 109818  ;
35691 109818  ;
35692 109818  ; procedure writeint(integer,type)
35693 109818  ; comment this procedure left justify an integer in
35694 109818  ; a 8 or 4 chars space filled field, according to type
35695 109818  ;             call               return
35696 109818  ;w0           type               destroyed
35697 109818  ;w1           integer            no of positions
35698 109818  ;w2                              unchanged
35699 109818  ;w3           link               link
35700 109818  ;
35701 109818  d71: ds. w0      i0.     ; save registers
35702 109820       jl. w3     d22.     ; writeinteger(integer)
35703 109822       ws. w1      i0.     ;
35704 109824       sl  w1       0      ; fill with spaces
35705 109826       jl.        (i1.)    ; according to type
35706 109828       ac  w1  x1          ;
35707 109830       jl.        i10.     ; return through writespace
35708 109832  i1:0
35709 109834  i0:0
35710 109836  e.z.
35711 109836  c.(:c23>14a.1:)-1
35712 109836  
35712 109836  b. i24
35713 109836  ;
35714 109836  ; procedure get_segment(segno)
35715 109836  ; comment: performs the transport of the stated segment
35716 109836  ; from <:susercat:>
35717 109836  ;      call:     return
35718 109836  ; w0             destroyed
35719 109836  ; w1   segno     destroyed
35720 109836  ; w2   address   destroyed
35721 109836  ; w3   link      destroyed
35722 109836  w.d77:                   ; get_segment:
35723 109836       rs. w3     i10.     ;
35724 109838       al. w3     c69.     ;
35725 109840       jd     1<11+52      ; create areaprocess(susercat)
35726 109842       sl  w0       2      ; if result <> 0
35727 109844       jl.        g12.     ; then goto end line
35728 109846       se  w0       0      ;
35729 109848       jl.         g6.     ;
35730 109850  i22: rs. w1     e50.     ;
35731 109852       al. w1     e47.     ;
35732 109854       rs. w2     e48.     ;
35733 109856       al  w2  x2+512      ; prepare inputmessage
35734 109858       rs. w2     e49.     ;
35735 109860       jd     1<11+16      ; send message
35736 109862       al. w1     e51.     ; 
35737 109864       jd      1<11+18     ; 
35738 109866       lo. w0     e51.     ; 'or' status and result
35739 109868       rl  w1       0      ; save result
35740 109870       jd     1<11+64      ; remove area.susercat
35741 109872       se  w1       1      ; if <>1 then
35742 109874       jl.        g11.     ; error goto end line
35743 109876       jl.       (i10.)    ;
35744 109878  i10:0
35745 109880  
35745 109880  ; procedure find_entry(name)
35746 109880  ; comment: finds the entry identified by the given name
35747 109880  ; returns with the value -10 if entry not found in this segment or -1 if entry not exist
35748 109880  ;       call:     return:
35749 109880  ; w0              destroyed
35750 109880  ; w1              destroyed
35751 109880  ; w2              entry address or -10 or -1
35752 109880  ; w3    link      destroyed
35753 109880  w. d78:                  ; find_entry:
35754 109880       rs. w3     i10.     ;
35755 109882       rl. w1     e71.     ;
35756 109884  i0:  rl  w2  x1          ; if entry not exsist
35757 109886       sn  w2      -1      ;
35758 109888       jl.       (i10.)    ; then return
35759 109890       sn  w2      -2      ; if entry deleted then
35760 109892       jl.        i1.      ; try next entry
35761 109894       al  w2  x1          ;
35762 109896       dl  w0  x1  +6      ;
35763 109898       sn. w3    (e20.)    ; compare names
35764 109900       se. w0    (e21.)    ;
35765 109902       jl.         i1.     ; if names unequal then
35766 109904       dl  w0  x1+10       ; try next entry
35767 109906       sn. w3    (e22.)    ; else return
35768 109908       se. w0    (e23.)    ;
35769 109910       jl.         i1.
35770 109912       jl.       (i10.)    ; entry found
35771 109914  i1:  rl. w2     e70.     ;
35772 109916       al  w2  x2  +2      ;
35773 109918       rl. w3     e71.     ;
35774 109920       wa  w1  x2          ;
35775 109922       am.       (e85.     ;
35776 109924       sl  w3  x1          ;
35777 109926       jl.         i0.     ;
35778 109928       al  w2     -10      ; entry not found
35779 109930       jl.       (i10.)    ;
35780 109932  e.z.
35781 109932  ; procedure lookup bs claims(device,process);
35782 109932  ;  comment the bs-claims for the process is looked up on the given device;
35783 109932  ;      call:        return:
35784 109932  ;w0      -          result
35785 109932  ;w1   return       addr. of bs-claims
35786 109932  ;w2   device        unchanged
35787 109932  ;w3   process            -
35788 109932  b.  i2  w.
35789 109932  d73: al. w3     i2.       ; entry0: w3:=addr('s');
35790 109934  d74: rs. w1    i0.        ; entry2: store(w1);
35791 109936       rl. w1     i1.       ; w1:= addr(bs claim store);
35792 109938       jd         1<11+118  ; lookup bs-claims
35793 109940       jl.        (i0.)     ; return;
35794 109942  i0:  0                    ;
35795 109944  i1:  e86                  ; addr of bs claims
35796 109946  i2:  <:s:>,0,0,0          ; current process
35797 109954  e.
35798 109954  
35798 109954  ; parameter table:
35799 109954  ; contains a byte for each character type in the follwoing states:
35800 109954  ;     0   initial state
35801 109954  ;     1   after letter
35802 109954  ;     2   after digit
35803 109954  ; each entry defines the address of an action (relative to the
35804 109954  ; procedure next param) and a new state:
35805 109954  ;     entry=action<2 + new state
35806 109954  
35806 109954  b.i24
35807 109954  i0=(:d3-d2:)<2+0,  i1=i0+1,           i2=i0+2
35808 109954  i3=(:d4-d2:)<2+1,  i4=(:d5-d2:)<2+2,  i5=(:d6-d2:)<2+2
35809 109954  i6=(:d7-d2:)<2+0,  i7=(:d8-d2:)<2+0
35810 109954  i9=(:d11-d2:)<2+0,i10=(:d13-d2:)<2+1
35811 109954  
35811 109954  h.h1:
35812 109954  ; initial state:
35813 109954   i3, i5, i4, i0    ;   letter   1, digit   2, unknown 0, continue 0
35814 109958   i6, i9, i6, i0    ;   unknown  0, endline 0, unknown 0, continue 0
35815 109962  ; after letter:
35816 109962   i3, i3, i6, i7    ;   letter   1, letter  1, radix   0, delimit  0
35817 109966   i7, i9, i6, i1    ;   delimit  0, endline 0, unknown 0, continue 1
35818 109970  ; after digit:
35819 109970  i10, i5, i4, i7    ;   alfa num 0, digit   2, radix   2, delimit  0
35820 109974   i7, i9, i6, i2    ;   delimit  0, endline 0, unknown 0, continue 2
35821 109978  e.
35822 109978  
35822 109978  ;
35823 109978  ; assignment of d-names to l-names used in all following stepping stone blocks
35824 109978  ;
35825 109978  
35825 109978  l0  =  d0,   l1  =  d1,   l2  =  d2,   l3  =  d3,   l4  =  d4,   l5  =  d5
35826 109978  l6  =  d6,   l7  =  d7,   l8  =  d8,   l9  =  d9,   l10 = d10,   l11 = d11
35827 109978  l12 = d12
35828 109978  l14 = d14,   l15 = d15,   l16 = d16,   l17 = d17,   l18 = d18,   l19 = d19
35829 109978  l20 = d20,   l21 = d21,   l22 = d22,   l23 = d23,   l24 = d24,   l25 = d25
35830 109978  l26 = d26,   l27 = d27,   l28 = d28,   l29 = d29,   l30 = d30,   l31 = d31
35831 109978               l33 = d33,   l34 = d34,   l35 = d35,   l36 = d36,   l37 = d37
35832 109978  l38 = d38,   l39 = d39,   l40 = d40,   l41 = d41,   l42 = d42,   l43 = d43
35833 109978  l44 = d44,   l45 = d45,   l46 = d46,   l48 = d48,   l51 = d51,   l52 = d52
35834 109978  l53 = d53,   l54 = d54,   l55 = d55,   l56 = d56,   l57 = d57,   l58 = d58
35835 109978  l59 = d59,   l61 = d61,   l64 = d64,   l70 = d70,   l71 = d71,   l73 = d73
35836 109978  l74 = d74,   l77 = d77,   l78 = d78,   l79 = d79,   l80 = d80,   l81 = d81
35837 109978  l82 = d82,   l83 = d83,   l84 = d84
35838 109978  
35838 109978  
35838 109978  ;
35839 109978  ; stepping stones
35840 109978  ;
35841 109978  
35841 109978  jl.   (2) ,   l2 ,  d2 = k-4
35842 109982  jl.   (2) ,   l9 ,  d9 = k-4
35843 109986  jl.   (2) ,  l10 , d10 = k-4
35844 109990  jl.   (2) ,  l12 , d12 = k-4
35845 109994  jl.   (2) ,  l14 , d14 = k-4
35846 109998  jl.   (2) ,  l15 , d15 = k-4
35847 110002  jl.   (2) ,  l16 , d16 = k-4
35848 110006  jl.   (2) ,  l17 , d17 = k-4
35849 110010  jl.   (2) ,  l18 , d18 = k-4
35850 110014  jl.   (2) ,  l19 , d19 = k-4
35851 110018  jl.   (2) ,  l20 , d20 = k-4
35852 110022  jl.   (2) ,  l21 , d21 = k-4
35853 110026  jl.   (2) ,  l22 , d22 = k-4
35854 110030  jl.   (2) ,  l23 , d23 = k-4
35855 110034  jl.   (2) ,  l24 , d24 = k-4
35856 110038  jl.   (2) ,  l25 , d25 = k-4
35857 110042  jl.   (2) ,  l26 , d26 = k-4
35858 110046  jl.   (2) ,  l27 , d27 = k-4
35859 110050  jl.   (2) ,  l29 , d29 = k-4
35860 110054  jl.   (2) ,  l34 , d34 = k-4
35861 110058  jl.   (2) ,  l35 , d35 = k-4
35862 110062  jl.   (2) ,  l36 , d36 = k-4
35863 110066  jl.   (2) ,  l37 , d37 = k-4
35864 110070  jl.   (2) ,  l38 , d38 = k-4
35865 110074  jl.   (2) ,  l39 , d39 = k-4
35866 110078  jl.   (2) ,  l40 , d40 = k-4
35867 110082  jl.   (2) ,  l41 , d41 = k-4
35868 110086  jl.   (2) ,  l42 , d42 = k-4
35869 110090  jl.   (2) ,  l44 , d44 = k-4
35870 110094  jl.   (2) ,  l45 , d45 = k-4
35871 110098  jl.   (2) ,  l46 , d46 = k-4
35872 110102  jl.   (2) ,  l51 , d51 = k-4
35873 110106  jl.   (2) ,  l52 , d52 = k-4
35874 110110  jl.   (2) ,  l53 , d53 = k-4
35875 110114  jl.   (2) ,  l54 , d54 = k-4
35876 110118  jl.   (2) ,  l55 , d55 = k-4
35877 110122  jl.   (2) ,  l56 , d56 = k-4
35878 110126  jl.   (2) ,  l57 , d57 = k-4
35879 110130  jl.   (2) ,  l58 , d58 = k-4
35880 110134  jl.   (2) ,  l61 , d61 = k-4
35881 110138  jl.   (2) ,  l64 , d64 = k-4
35882 110142  jl.   (2) ,  l70 , d70 = k-4
35883 110146  jl.   (2) ,  l71 , d71 = k-4
35884 110150  jl.   (2) ,  l77 , d77 = k-4
35885 110154  jl.   (2) ,  l78 , d78 = k-4
35886 110158  jl.   (2) ,  l79 , d79 = k-4
35887 110162  jl.   (2) ,  l80 , d80 = k-4
35888 110166  
35888 110166  
35888 110166  
35888 110166  c69:<:susercat:>,  0, 0   ; name of s-usercat, incl. name table table entry
35889 110176  \f


35889 110176  
35889 110176  m.
35889 110176                  mons2 - monitor operatins system s, part 2 17.0 beta

35890 110176  ;
35891 110176  ;88.05.11 15.45   kak connect ida changed
35892 110176  ;88.05.20 15.11   kak new text output in connect (g112);
35893 110176  ;88.05.24 09.30   kak change of cpa and address base included
35894 110176  ;88.06.07 10.20   kak prepare dump and dump commands included
35895 110176  ;88.08.16 11.38   kak connect/disconnect changed to createlink/removelink
35896 110176  ;                     including a new param format
35897 110176  ;88 09 19 17.39   hsi error in createlink spec for floppy (h15:)
35898 110176  ;88 10 12 09.55   kak two new commands: privileged and unprivileged introducted
35899 110176  ;                     and including privileged consoles from options is removed
35900 110176  ;88 11 09 08.02   kak error in linkall corrected
35901 110176  ;88 11 25 11.27   kak protection against unprivileged mainconsole
35902 110176  ;89 01 27 13.00   kak removelink corrected
35903 110176  ;89 02 22 12.52   kak accepting of capitol letters included
35904 110176  ;89 03 14 08.50 kak   the last char read is saved, and may be used to detect end of line 
35905 110176  ;                     in commands with a variable number of paramters
35906 110176  ;                     the last name read in createlink is saved in work, to prevent overwrite
35907 110176  ;89 03 15 16.22 kak   driverproc is started locked
35908 110176  ;                     and inserted in running queue
35909 110176  ;89 03 30 12.00 kak   stepping stone (step 2) out of conditional block
35910 110176  ;--------------------------------------------------------------------------
35911 110176  ;                        START OF RELEASE 16.0
35912 110176  ;89 04 11 14.12 hsi   unlink: reset output buffer after each parameter
35913 110176  ;89 05 25 15.06 kak   the last free consolebuffer cannot be privileged
35914 110176  ;--------------------------------------------------------------------------
35915 110176  ;                        START OF RELEASE 17.0
35916 110176  ;90 10 23 12.34 kak   a new s-command: setprio introducted
35917 110176  ;                     who did it possible to changed the priority of a running child
35918 110176  ;91 01 15 14.00 kak   ths s-command create child is changed:  in the monitor call
35919 110176  ;                     modify child the first logical addr is used as IC (before it was the physical addr)
35920 110176  ;91 01 30 13.51 kak   message received from internal process changed:
35921 110176  ;                     the device address is replaced with the core table address at the call of find console.
35922 110176  
35922 110176  b.i30 w.
35923 110176  i0=91 01 30 , i1=13 51 00
35924 110176  
35924 110176  ; if newtime (i0,i1) > oldtime (a133,a134) then oldtime:=newtime;
35925 110176  c.i0-a133
35926 110176  c.i0-a133-1, a133=i0, a134=i1, z.
35927 110176  c.i1-a134-1,          a134=i1, z.
35928 110176  z.
35929 110176  
35929 110176  i10=i0, i20=i1
35930 110176  
35930 110176  i15=i10/100000 , i10=i10-i15*100000 , i25=i20/100000 , i20=i20-i25*100000 
35931 110176  i14=i10/10000  , i10=i10-i14*10000  , i24=i20/10000  , i20=i20-i24*10000 
35932 110176  i13=i10/1000   , i10=i10-i13*1000   , i23=i20/1000   , i20=i20-i23*1000
35933 110176  i12=i10/100    , i10=i10-i12*100    , i22=i20/100    , i20=i20-i22*100
35934 110176  i11=i10/10     , i10=i10-i11*10     , i21=i20/10     , i20=i20-i21*10
35935 110176  
35935 110176  i2:<:                              date  :>
35936 110200  (:i15+48:)<16+(:i14+48:)<8+46
35937 110202  (:i13+48:)<16+(:i12+48:)<8+46
35938 110204  (:i11+48:)<16+(:i10+48:)<8+32
35939 110206  
35939 110206  (:i25+48:)<16+(:i24+48:)<8+46
35940 110208  (:i23+48:)<16+(:i22+48:)<8+46
35941 110210  (:i21+48:)<16+(:i20+48:)<8+ 0
35942 110212  
35942 110212  i3:  al. w0      i2.     ; write date:
35943 110214       rs  w0  x2  +0      ;   first free:=start(text);
35944 110216       al  w2       0      ;
35945 110218       jl      x3          ;   return to slang(status ok);
35946 110220  
35946 110220       jl.         i3.     ;
35947 110222  e.
35948 110222  j.
35948 110176                                date  91.01.30 13.51.00

35949 110176  
35949 110176  w.
35950 110176  e0: c0     ; <first addr>
35951 110178  ;e1        ; defined below
35952 110178  
35952 110178  e2:c4     ; <own buf>
35953 110180  e3:c5     ; <own area>
35954 110182  e4:0      ; <max device>
35955 110184  e5:h0     ; <char table>
35956 110186  e6:h1     ; <param table>
35957 110188  e7:h2     ; <first command>
35958 110190  e12:h3    ; <top command table>
35959 110192  e9:h4     ; <first console>
35960 110194  e10:h5     ; <last console>
35961 110196  e11:h6     ; <first device>
35962 110198  e13:h8     ; <first work>
35963 110200  e14:h9     ; <last work>
35964 110202  e33:h10    ; fictive element before first core table
35965 110204  e15=k-c20
35966 110204  e15,e15
35967 110208  e16:0-0-0  ; <first core - last of init cat code>
35968 110210  e17:0      ; <top core>
35969 110212  e18:0      ; <param type>
35970 110214  e19:0      ; <integer>
35971 110216  e24:h8     ; <work>  ( initially: first work )
35972 110218  ; *** the following variables must match part of work-area
35973 110218  e20:0      ; <name>
35974 110220  e21:0      ;
35975 110222  e22:0      ;
35976 110224  e23:0      ;
35977 110226  0
35978 110228  e78:0      ; used in list and link and removelink and initkit 
35979 110230  e79:-1     ; segment in susercat or -1
35980 110232  e81:0      ;continue indicator 
35981 110234             ;  text addr: odd = continue,  even = no continue
35982 110234  e83:0      ; <subroutine return address>
35983 110236      0      ; <cur catalog base, lower limit >
35984 110238  e75:0      ; <                  upper limit >
35985 110240  e25:h21    ; <console>  ( initially: first console )
35986 110242  e26:0      ; <console buf> or <last addr>
35987 110244  e27:8      ; <char shift>  (initially: prepared for empty char buf)
35988 110246  e28:0      ; <char addr>
35989 110248  e29:0      ; <child>
35990 110250  e90:0      ; <terminal address>
35991 110252  e101:0     ; <device no of disc containing description>
35992 110254  e102:0     ; <device no of physical disc>
35993 110256  e103:0     ; <pointer in disc description>
35994 110258  e105:0     ; <size of logical disc description>
35995 110260  e30:0      ; <core addr>
35996 110262  ; *** end of work-area match
35997 110262  e104:0     ; <user of disc description buffer identified by work>
35998 110264  e31:h21
35999 110266  
35999 110266  e34:0
36000 110268  e35=k-c20
36001 110268  h4,h22
36002 110272  e36:
36003 110272  e37:0
36004 110274  e38:0
36005 110276  e32:0,r.8  ; <message>
36006 110292  
36006 110292  e88:0      ; expected answer
36007 110294  e89:0      ; executing reentrant code: 0=false, -1=true (initially = false)
36008 110296  c.(:a399>21a.1:)-1
36009 110296  e106:0     ; pp_buff: buffer addres from prepare dump
36010 110296  z.
36011 110296  e109:      ; last char read;
36012 110296  
36012 110296  e39:0      ; <event>
36013 110298  e40:0      ; <receiver>
36014 110300  e41:0      ;
36015 110302      0      ;
36016 110304  e43:0,0    ; 
36017 110308  e55:0      ; <write shift>
36018 110310  e44:5<12   ; <type mess>
36019 110312  e45:0      ; <line addr>
36020 110314  e46:0      ; <write addr>
36021 110316      0      ; <segment or unused>
36022 110318  e42:0      ; <top of writebuffer>
36023 110320  e53:0      ; <write mode: 0=terminal, 1=memory>
36024 110322  e47:3<12   ; <area mess> or <input mess>
36025 110324  e48:0      ; <first addr>
36026 110326  e49:0      ; <last addr>
36027 110328  e50:0      ; <segment>
36028 110330  e87: 0                  ; areabuf state: 0=defined, else undef (initially defined)
36029 110332  e51:0      ; <entry tail> or <answer> or <message>
36030 110334  e52:0      ;
36031 110336      0      ;
36032 110338  e54:0      ; <convert area>
36033 110340  0
36034 110342  e56:0      ; <read shift> or <radix> or <start>
36035 110344  e57:0      ; <read addr> or <state> or <size>
36036 110346  e58:0      ; <save w1> or <first segment>
36037 110348  e59:0      ; <save w2> or <content> or <keys> or <result>
36038 110350  e60:0      ; <link> or <bytes to load>
36039 110352  e61:0      ; <child w0>
36040 110354  e62:0      ; <child w1>
36041 110356  e63:0      ; <child w2>
36042 110358  e64:0      ; <child w3>
36043 110360  e65:0      ; <child ex>
36044 110362  e66:0      ; <child ic>
36045 110364  e67=e59+1  ; <ic in entry>
36046 110364  e68=e66+2
36047 110364  0,0
36048 110368  e69:0     ;jobcount
36049 110370      a107   ;<max catalog base, lower limit>
36050 110372  e76:a108-1 ;<                  upper limit>
36051 110374  e77: 0     ; increase access indicator
36052 110376  e70:h19
36053 110378  e71:h20
36054 110380  e72: -1     ; first logic address (default value)
36055 110382  m.
36055 110382           s lock indicator.

36056 110382  c.(:c23>13 a.1:)-1     ; if teminals shal be blocked after start up
36057 110382  e80: -1                ; then e80=-1, else
36058 110382  z.
36059 110382  c.-(:c23>13 a.1:)      ;
36060 110382  e80: 0                 ; e80=0
36061 110384  z.
36062 110384  c.(:a399>22a.1:)-1
36063 110384  e82: 0                 ; max r.size : max space between monitor table and start of process description
36064 110384  z.
36065 110384  e85:0   ; used in job command
36066 110386  b1: b29+1*a4   ; own process description (second internal)
36067 110388  
36067 110388  ; end line:
36068 110388  e1=e17-a17;********************
36069 110388  g1:  jl. w1     g28.     ;
36070 110390  g48=k+4
36071 110390  <:ready  **date not initialized <0>:>   ; text until date initialized  
36072 110412  g2:  jl. w1     g28.  , <:syntax error:<0>:>
36073 110424  g3:  jl. w1     g28.  , <:not allowed<0>:>
36074 110434  g4:  jl. w1     g103. , <:no core<0>:>
36075 110442  g5:  jl. w1     g103. , <:no buffers<0>:>
36076 110452  g6:  jl. w1     g103. , <:no areas<0>:>
36077 110460  g7:  jl. w1     g103. , <:no internals<0>:>
36078 110472  g8:  jl. w1     g28.  , <:illegal cpa<0>:>
36079 110482  g9:  jl. w1     g103. , <:process unknown<0>:>
36080 110496  g10: jl. w1     g103. , <:process exists<0>:>
36081 110508  g11: jl. w1     g28.  , <:catalog error<0>:>
36082 110520  g12: jl. w1     g28.  , <:area unknown<0>:>
36083 110532  g13: jl. w1     g28.  , <:area reserved<0>:>
36084 110544  g14: jl. w1     g103. , <:program too big<0>:>
36085 110558  g15: jl. w1     g28.  , <:area error<0>:>
36086 110568  g16: jl. w1     g103. , <:device unknown<0>:>
36087 110580  g17: jl. w1     g103. , <:device reserved<0>:>
36088 110594  g18: jl. w1     g28.  , <:not implemented<0>:>
36089 110608  g19: jl. w1     g103. , <:base illegal<0>:>
36090 110620  g20: jl. w1     g103. , <:bs claims exceeded<0>:>
36091 110636  g21: jl. w1     g103. , <:bs device unknown<0>:>
36092 110650  g22: jl. w1     g103. , <:unknown<0>:>
36093 110658  g23:                    <:message<0>:>
36094 110664  g24:                    <:pause<0>:>
36095 110668  g25: jl. w1     g103. , <:no entries in maincat<0>:>
36096 110686  g26:                    <:max<0>:>
36097 110690  g27: jl. w1     g103. , <:illegal priority<0>:>
36098 110704  g29: jl. w1     g103. , <:prog name unknown<0>:>
36099 110718  g47: jl. w1     g28.  , <:input aborted<0>:>
36100 110730  g101:jl. w1     g103. , <:illegal relocation<0>:>
36101 110746  g111:jl. w1     g103. , <:illegal old contents<0>:>
36102 110762  g126:jl. w1     g103. , <:no consol buffers<0>:>
36103 110776  g120:                   <:warning: susercat not updated<0>:>
36104 110796  
36104 110796  g105:                    ; write message: (w1 text addr, w3 link)
36105 110796  b. i10 w.                ;  local write routine used after endline or error.
36106 110796       rs. w3      i1.     ;
36107 110798       al  w2  x1          ;  save textaddr;
36108 110800       jl. w3     d19.     ;  init write;
36109 110802       jl. w3     d21.     ;  write text;
36110 110804       se. w2   g2.+2      ;  if syntax error then
36111 110806       jl.         i5.     ;
36112 110808       al. w1     e20.     ;    write last read parameter;
36113 110810       jl. w3     d21.     ;
36114 110812       rl. w1     e19.     ;
36115 110814       rl. w0     e20.     ;
36116 110816       sn  w0       0      ;
36117 110818       jl. w3     d22.     ;
36118 110820                           ;
36119 110820  i5:  al  w0      10      ;  write newline;
36120 110822       jl. w3     d20.     ;
36121 110824       jl. w3     d23.     ;  type line;
36122 110826       jl.        (i1.)    ;  return;
36123 110828                           ;
36124 110828  i1: 0                    ;save return addr
36125 110830  
36125 110830  e.
36126 110830                           ;
36127 110830                           ;
36128 110830  g110:                    ;test area and continue indicator;
36129 110830  b. i10 w.                ; local procedure used to test if continuation
36130 110830                           ; can take place (only after error and when
36131 110830                           ; reading from an area).
36132 110830                           ; return: 
36133 110830                           ;        link   : continue and reading from area
36134 110830                           ;        link+2 : no continue and reading from area
36135 110830                           ;        link+4 : not reading from area
36136 110830                           ; w0, w1, w2: unchanged
36137 110830       ds. w1      i5.     ;
36138 110832       rs. w2      i6.     ;
36139 110834       rl. w2     e81.     ;
36140 110836       rl. w1     e24.     ;
36141 110838       rl  w0  x1+c58      ;  if inputstack = stack base then
36142 110840       sn  w0  x1+c73      ;
36143 110842       jl.         i4.     ;    goto not reading from area;
36144 110844                           ;
36145 110844       so  w2       1      ;  if continue = false then
36146 110846       jl.         i2.     ;    goto no continue and reading from area
36147 110848       jl.         i0.     ;  else goto continue and reading from area;
36148 110850                           ;
36149 110850  i4:  am         4-2      ;not reading from area:
36150 110852  i2:  am         2-0      ;no continue but reading from area:
36151 110854  i0:  al  w3  x3+0        ;continue and reading from area:
36152 110856       dl. w1      i5.     ;
36153 110858       rl. w2      i6.     ;
36154 110860       jl      x3          ; return;
36155 110862  
36155 110862      0                    ;
36156 110864  i5: 0                    ;
36157 110866  i6: 0                    ;
36158 110868  
36158 110868  
36158 110868  e.
36159 110868  
36159 110868  
36159 110868  g103:                    ; continue command interpretation:
36160 110868       am         1        ;   continue:= true;
36161 110870  g28:                     ; terminate command interpretation:
36162 110870       al  w2  x1          ;   continue:= false; (w2 := text address, even or odd)
36163 110872       rs. w2     e81.     ;
36164 110874       al  w3     0        ;
36165 110876       rs. w3     e77.     ;   increase access indicator := false;
36166 110878                           ;    <* true after error in all, get or new commands *>;
36167 110878  
36167 110878       se  w3    (b13)     ;   if high part of clock <> 0 then
36168 110880       rs. w3     g48.     ;     remove warning;
36169 110882       al  w3      -1      ;
36170 110884       rs. w3     e89.   ;   executing reentrant code := true;
36171 110886       rs. w3     e79.     ; reset segment no in susercat
36172 110888  
36172 110888       rl. w3     e25.     ;
36173 110890       rl  w3  x3+c28      ; if access count = 0 then
36174 110892       se  w3       0      ;
36175 110894       jl.       g106.     ;
36176 110896                           ; begin
36177 110896       jl. w3    g105.     ;   write message(message);
36178 110898       jl. w3     d42.     ;   save work;
36179 110900       jl.       g108.     ;+0: error: goto release link
36180 110902                           ;+2: ok:
36181 110902       jl. w3    g110.     ;   test area and continue indicator;
36182 110904       jl.        g35.     ;+0: area and continue: goto next command;
36183 110906       jl.          2      ;+2: area and no continue: 
36184 110908       jl.       g108.     ;+4: no area: goto release link;
36185 110910                           ; end
36186 110910  g106:                    ; else begin <* access count = 1 *>
36187 110910       sn. w1    g1.+2     ;   if text = 'ready' then
36188 110912       jl.        g46.     ;     goto send input;
36189 110914                           ;
36190 110914       jl. w3    g105.     ;   write message;
36191 110916       jl. w3     d42.     ;   save work;
36192 110918       jl.       g107.     ;+0: error: goto decrease access, release link;
36193 110920                           ;+2: ok:
36194 110920       jl. w3     g110.    ;   test area and continue indicator;
36195 110922       jl.         g35.    ;+0: area and continue: goto next command;
36196 110924       jl.        g107.    ;+2: area and no continue: goto decrease acces, release
36197 110926       jl.         g46.    ;+4: no area: send input;
36198 110928                           ; end;
36199 110928                           ;
36200 110928                           ;
36201 110928  g107:                    ; decrease access:
36202 110928       rl. w1      e25.    ;
36203 110930       jl. w3      d10.    ;   decrease access(console);
36204 110932                           ;
36205 110932                           ;
36206 110932  g108:                    ; release link:
36207 110932       rl. w2      e25.    ;
36208 110934       rl  w2  x2+c25      ;
36209 110936       jl. w3      d48.    ;   release temp link(console);
36210 110938       am            0     ;+0: error: ignore (usually privileged consoles);
36211 110940                           ;+2: ok:
36212 110940                           ;
36213 110940  g109:                    ; link console buffer:
36214 110940       rl. w1      e25.    ;   if console buffer<>privileged then
36215 110942       al. w2      e35.    ;   link element(console, free chain);
36216 110944       zl  w0  x1+c27      ;
36217 110946       so  w0      1<3     ;
36218 110948       jl. w3      d18.    ;
36219 110950                           ;
36220 110950                           ;
36221 110950  
36221 110950  g30: al  w2       0      ; exam first:
36222 110952       jl.        g32.     ;   event:=0;
36223 110954  g31: rl. w2     e39.     ; exam next:
36224 110956  g32: jd     1<11+24      ;   wait event(event,next,result);
36225 110958       rs. w2     e39.     ;   event:=next;
36226 110960       rl  w1  x2  +6      ;   sender:=word(event+6);
36227 110962       sz. w2    (e89.)    ;   if executing non-reentrant code
36228 110964       jl.        g41.     ;     and
36229 110966       se. w2    (e88.)    ;     event <> expected answer then
36230 110968       jl.        g32.     ;     goto exam next;
36231 110970  g41:                     ;
36232 110970       sn  w0       0      ;   if result=0 then
36233 110972       jl.        g34.     ;   goto message received;
36234 110974       jl. w3     d41.     ;   find work(event,old work);
36235 110976       jl.        g31.     ;+0: not found: let the answer be - should not happened
36236 110978                           ;+2: found:
36237 110978       al. w1     e51.     ; answer received:
36238 110980       jd     1<11+18      ;   wait answer(event,answer,result)
36239 110982       al  w3       1      ;   w1 := logical status
36240 110984       ls  w3      (0)     ;      := 1 shift result
36241 110986       sn  w3     1<1      ;       + maybe status.answer;
36242 110988       lo  w3  x1          ;
36243 110990       rs. w3     e59.     ;
36244 110992       jl. w3     d43.     ;   restore work(work,event);
36245 110994  
36245 110994  g33: rl. w2     e39.     ; reject message:
36246 110996       jd     1<11+26      ;   get event(event);
36247 110998       al  w0       2      ;
36248 111000       al. w1     e51.     ;
36249 111002       jd     1<11+22      ;   send answer(event,answer,2);
36250 111004       jl.        g30.     ;   goto exam first;
36251 111006  
36251 111006  g34: rl. w3      e2.     ; message received:
36252 111008       sh  w3       1      ;   if own buf<=1
36253 111010       jl.        g31.     ;   then goto exam next;
36254 111012       sh  w1      -1      ;   if sender<0
36255 111014       jl.        g33.     ;   then goto reject message;
36256 111016       sn  w0 (x1  +0)     ;   if kind(sender)=0
36257 111018       jl.        g50.     ;   then goto internal message;
36258 111020       rs. w1     e90.     ;   terminal:= sender;
36259 111022       al  w0  x1          ;
36260 111024       jl. w3     d24.     ;   find_and_select_console_1(device,console,
36261 111026       jl.        g33.     ;                reject message);
36262 111028       rs. w1     e25.     ;   console:= new console
36263 111030       al  w0  x2          ;   save w2 (buffer address);
36264 111032       jl. w3      d17.    ;   remove element(console);
36265 111034                           ;    <* maybe the console was in the free chain *>
36266 111034       al  w2       (0)    ;   restore w2
36267 111036  
36267 111036  
36267 111036  
36267 111036       jd     1<11+26      ;   get event(console buf);
36268 111038       al  w0       1      ;
36269 111040       al. w1     e51.     ;
36270 111042       jd     1<11+22      ;   send answer(console)
36271 111044  g46: al  w2       0      ;
36272 111046       jl. w3     d41.     ;   find work(0,new work);
36273 111048       jl.       g108.     ;+0: not found: goto release link, link console;
36274 111050                           ;+2: found:
36275 111050       al  w0  x1+c73      ;   input stack pointer := stack base;
36276 111052       rs  w0  x1+c58      ;
36277 111054  g39:                     ;     end;
36278 111054       al  w2  x1+c66      ;   first addr:= work+linebuf;
36279 111056       al  w3  x1+c67      ;   last addr:= work+outputlinebuf-2;
36280 111058       ds. w3     e49.     ;
36281 111060       al. w1     e47.     ;
36282 111062       jl. w3     d26.     ;   send buf (input mess, buf);
36283 111064       jl. w3     d42.     ;   save work(buf);
36284 111066       jl.       g107.     ;+2:  error:  goto decrease access and release link;
36285 111068       al  w2  x1+c66-2    ;   char shift := > 0; (* i.e. change word *)
36286 111070       ds. w2     e28.     ;   char addr := work + linebuf - 2;
36287 111072       wa. w2     e52.     ;
36288 111074       rs. w2     e26.     ;   last addr := char addr + bytes;
36289 111076  ; next command:
36290 111076  g35: jl. w3      d2.     ;   next param(type);
36291 111078  g36:                     ; exam command:
36292 111078       rl. w1      e25.    ;   if increase access indicator then
36293 111080       rl. w3      e77.    ;     <* after a call of new, all or get *>
36294 111082       sn  w3        1     ;
36295 111084       jl. w3       d9.    ;     increase access(console);
36296 111086                           ;
36297 111086       al  w3        0     ;
36298 111088       rs. w3      e77.    ;   increase access indicator := false;
36299 111090                           ;
36300 111090       sn  w0        0     ;   <* w0: type of next item *>
36301 111092       jl.         g98.    ;   if type=0
36302 111094       se  w0       1      ;   or type<>1
36303 111096       jl.         g2.     ;   then goto end line;
36304 111098  
36304 111098       jl. w3     d19.     ;   init write;
36305 111100       al  w3    -1        ;
36306 111102       rs. w3     e89.     ;   executing reentrant code := true;
36307 111104  
36307 111104       rl. w3      e7.     ;   w3 := base of command table;
36308 111106  g37:; next command:
36309 111106       al  w3  x3  +6      ;   increase (command pointer);
36310 111108       dl  w2  x3  +2      ;   w1w2 := command name;
36311 111110       sh  w1       0      ;   if first of command <= 0 then
36312 111112       jl.        g38.     ;     goto test end;
36313 111114       sn. w1    (e20.)    ;   if command.table <> name then
36314 111116       se. w2    (e21.)    ;
36315 111118       jl.        g37.     ;     goto next command;
36316 111120  ; notice:  only 6 first characters tested
36317 111120  
36317 111120  ; command found in table:
36318 111120  ; test that it is allowed to call this command from this console
36319 111120  
36319 111120       al  w2       0      ;
36320 111122       rl  w3  x3  +4      ;
36321 111124  
36321 111124       ld  w3      10      ; w0:= command mask.console
36322 111126       ls  w3     -10      ; w1:= console
36323 111128       rl. w1     e25.     ; w2:= command bits.command table
36324 111130       bz  w0  x1+c27      ; w3:= relative command address
36325 111132       ls  w2      -1      ;
36326 111134       ls  w2       3      ;
36327 111136       sz  w0     1<3      ; if console privileged then
36328 111138       jl.        g40.     ; goto command base
36329 111140       so  w0  x2          ; if command not allowed(console) then
36330 111142       jl.         g3.     ; goto end line
36331 111144       so. w2    (e80.)    ; if locked and not a bit 3 command then
36332 111146       jl.         g3.     ; goto end line
36333 111148  
36333 111148  g40: jl.     x3+g45.     ;   goto command-action;
36334 111150  ; init write has been called
36335 111150  ; w0 = command mask(console)
36336 111150  ; w1 = console
36337 111150  
36337 111150  g38:                     ; test found:
36338 111150       sn  w1       0      ;   if continuation = 0 then
36339 111152       jl.         g2.     ;     goto end line;  i.e. all commands tested
36340 111154  
36340 111154  ; all commands, not contained in primary part of command table, are
36341 111154  ; considered non-reentrant
36342 111154  
36342 111154       al  w3     0        ;
36343 111156       rs. w3     e89.     ;   executing reentrant code := false;
36344 111158  
36344 111158  
36344 111158       ac  w3  x1  +6      ;   w3 := continuation address for more commands;
36345 111160  ;   (notice w3 = base of commands)
36346 111160       jl.        g37.     ;   goto next command;
36347 111162  
36347 111162  g98: rl. w1     e24.      ; if stack=stackbase then
36348 111164       rl  w2  x1+c58       ; goto endline else
36349 111166       sn  w2  x1+c73       ; goto next command
36350 111168       jl.         g1.      ;
36351 111170       jl.        g35.      ;
36352 111172  ; 
36353 111172  b.  i5  w.
36354 111172  
36354 111172  g50:                     ; message:
36355 111172                           ; ---------
36356 111172       dl  w0  x2 +10      ;
36357 111174       ds. w0     e32.+2   ;   move message from buffer to <message>;
36358 111176       dl  w0  x2 +14      ;
36359 111178       ds. w0     e32.+6   ;
36360 111180       dl  w0  x2 +18      ;
36361 111182       ds. w0     e32.+10  ;
36362 111184       dl  w0  x2 +22      ;
36363 111186       ds. w0     e32.+14  ;
36364 111188       al  w2  x1  +0      ;
36365 111190       jl. w3     d25.     ;   find parent(sender,parent,
36366 111192       jl.        g33.     ;                  reject message);
36367 111194       rs. w1     e90.     ;   terminal:=child.terminal;
36368 111196       al  w0  x3+c18      ;
36369 111198       jl. w3     d24.     ;   find_and_select_console_1(terminal_name.core_table, console);
36370 111200       jl.        g33.     ;+0: error: reject message;
36371 111202       rs. w1     e25.     ;+2: ok:    console:=new or old console;
36372 111204       rs. w2     e29.     ;   child:= sender;
36373 111206       dl  w0  x2+a43      ;   cur catalogbase:=child.catalogbase;
36374 111208       ds. w0     e75.     ;   <* save in case of newjob or replace *>;
36375 111210       jl. w3     d17.     ;   remove element(console);
36376 111212       al  w2       0      ;
36377 111214       jl. w3     d41.     ;   find work(0,new work);
36378 111216       jl.        g31.     ;+0: not found:
36379 111218                           ;    <* let the message be - try to find an answer which
36380 111218                           ;       will release a workarea *>
36381 111218                           ;+2: found:
36382 111218       jl. w3     d19.     ;   init write;
36383 111220       rl. w3     e32.     ;   if message(0)(23)=1 then
36384 111222       so  w3       2.1    ;     begin stop child;
36385 111224       am     d33-d39      ;       writetext(<:pause:>)
36386 111226       jl. w3     d39.     ;     end
36387 111228       se. w3       0      ;   else
36388 111230       am     g24-g23      ;     begin child name;
36389 111232       al. w1     g23.     ;       writetext(<:message:>)
36390 111234       jl. w3     d21.     ;     end;
36391 111236       rl. w2     e39.     ;
36392 111238       jd     1<11+26      ;   get event(event);
36393 111240       al  w0       1      ;
36394 111242       al. w1     e32.     ;
36395 111244       jd     1<11+22      ;   send answer(event,message,1);
36396 111246       al. w1     e40.     ;
36397 111248       jl. w3     d21.     ;   writetext(receiver);
36398 111250       al. w2     e32.+2   ;   index:= 2;
36399 111252  g43: rl  w1  x2  +0      ; next word:
36400 111254       bl. w3     e32.+1   ;   word:= message(index);
36401 111256       ls  w3       1      ;   bits:= message(1);
36402 111258       hs. w3     e32.+1   ;   message(1):= bits shift 1;
36403 111260       sh  w3      -1      ;   if bits(0)=1 then
36404 111262       jl.        g44.     ;   goto number;
36405 111264       sn  w1       0      ;   if word=0 then
36406 111266       jl.        g42.     ;   goto test more;
36407 111268       al  w0       0      ;   char:= word(0:7);
36408 111270       ld  w1       8      ;   word:= word shift 8;
36409 111272       jl. w3     d20.     ;   writechar(char);
36410 111274       al  w0       0      ;   char:= word(0:7);
36411 111276       ld  w1       8      ;   word:= word shift 8;
36412 111278       jl. w3     d20.     ;   writechar(char);
36413 111280       al  w0       0      ;   char:= word(0:7);
36414 111282       ld  w1       8      ;   word:= word shift 8;
36415 111284       am     d20-d22      ;   writechar(char);
36416 111286  ;   goto test more;
36417 111286  ; number:
36418 111286  ;   writeinteger(word);
36419 111286  g44: jl. w3     d22.     ; test more:
36420 111288  g42: al  w2  x2  +2      ;   index:= index+2;
36421 111290       sh. w2     e32.+14  ;   if index<=14 then
36422 111292       jl.        g43.     ;   goto next word;
36423 111294       al  w0      10      ;
36424 111296       jl. w3     d20.     ;   writechar(10);
36425 111298       jl. w3     d23.     ;   typeline(buf);
36426 111300       zl. w1     e32.     ; save function
36427 111302       rs. w1     e23.+2   ;
36428 111304       rl. w3     e24.     ; save name in input buffer
36429 111306       al  w3  x3+c66      ;
36430 111308       dl. w1     e32.+10  ;
36431 111310       ds  w1  x3+2        ;
36432 111312       dl. w1     e32.+14  ;
36433 111314       ds  w1  x3+6        ; end
36434 111316       dl. w1     e26.     ; simulate empty input string
36435 111318       ds. w1     e28.     ; ( after unstack command)
36436 111320       jl. w3     d42.     ; save work
36437 111322       am          0       ; +2 error (dont care)
36438 111324  
36438 111324       rl. w3     e23.+2   ; if function = newjob then
36439 111326       sn  w3     12       ;   goto stack-input
36440 111328       jl.        g97.     ; else
36441 111330       se  w3     10       ; if function = finis or replace then
36442 111332  
36442 111332       sn  w3      2       ; 
36443 111334       sz                  ;
36444 111336       jl.        g108.    ;
36445 111338       jl. w3     d39.     ;   stop process(child); c. if stopbit was off;
36446 111340       jl. w3     (i0.)    ; adjust bs claim
36447 111342       jl. w3     d40.     ; remove process
36448 111344       rl. w3     e23.+2   ; if function =replace then
36449 111346       se  w3     10       ;
36450 111348       jl.        g108.    ;
36451 111350  g97: rl. w2     e24.     ; 
36452 111352       al  w2  x2+c66      ;
36453 111354       dl. w1     e75.     ;   stack input(child.catalogbase, areaname);
36454 111356       jl. w3     d79.     ; goto next command
36455 111358       jl.        g35.     ;
36456 111360                           ;
36457 111360  i0: d76                  ; adjust bs-claims
36458 111362  e.                       ; end message;
36459 111362  
36459 111362  
36459 111362  
36459 111362  g45: ; base for command-relatives
36460 111362  
36460 111362       ; define pseudo-entries for conditinally-assembled commands
36461 111362  g70: ; break
36462 111362  g72: ; include
36463 111362  g73: ; exclude
36464 111362  g74: ; call
36465 111362  g75: ; list
36466 111362  g76: ; max
36467 111362  g77: ; replace
36468 111362  g83: ; all
36469 111362  g89: ; job
36470 111362  g90: ; print
36471 111362  g91: ; modify
36472 111362       jl.        g18.   ;   goto not implemented;
36473 111364  
36473 111364  
36473 111364  
36473 111364  ; command syntax:  read <area name>
36474 111364  ; ---------------------------------
36475 111364  g57:                   ; read:
36476 111364       jl. w3     d15.   ;   next name;
36477 111366       al. w2     e20.   ;
36478 111368       dl. w1     e76.   ;   catalogbase := max catalogbase;
36479 111370       jl. w3     d79.   ;   stack input (name);
36480 111372       jl.        g35.   ;   goto next command;
36481 111374  
36481 111374  
36481 111374  ; command syntax:  unstack
36482 111374  ; ------------------------
36483 111374  g58:                   ; unstack:
36484 111374       jl. w2     d80.   ;   unstack input;
36485 111376       jl.        g35.   ;   goto next command;
36486 111378  
36486 111378  
36486 111378  ; command syntax:  date <year> <month> <date> <hour> <min> <sec>
36487 111378  ; --------------------------------------------------------------
36488 111378  b. i20, j30 w.         ;
36489 111378  j0:                    ; minimum values:
36490 111378       82  ,  1  ,  1  ,  0  ,  0  ,  0
36491 111390  j1:                    ; top values:
36492 111390       99+1, 12+1, 31+1, 23+1, 59+1, 59+1
36493 111402  j2:                    ; year,month,day,hour,min,sec
36494 111402        0  ,  0  ,  0  ,  0  ,  0  ,  0
36495 111414  j5:                    ; month table: jan, ..., dec
36496 111414  h. 365, 396, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334
36497 111426  w.
36498 111426  j11: 4                 ; minutes per four minutes
36499 111428  j13: 24                ; hours per day
36500 111430  j14: 60                ; minutes per hour
36501 111432  j17: 365*3+366         ; days per four years (inclusive leap year)
36502 111434  j18: 10000             ; units per second
36503 111436  j20: 60*4 * 10000      ; units per four minutes
36504 111438  
36504 111438  j30: <:oldcat:>        ; name of successor-command
36505 111442  
36505 111442  g49:                   ; date:
36506 111442       al  w1     0      ;   for i := 0 step 2 until 10 do
36507 111444  i0:                    ;     begin
36508 111444       jl. w3     d16.   ;     next integer;
36509 111446       sl. w0 (x1+j0.)   ;     if number < min value
36510 111448       sl. w0 (x1+j1.)   ;     or number >= top value then
36511 111450       jl.        g2.    ;       goto syntax error; (* i.e. illegal date *)
36512 111452       rs. w0  x1+j2.    ;     save number;
36513 111454       al  w1  x1+2      ;
36514 111456       se  w1     12     ;
36515 111458       jl.        i0.    ;     end;
36516 111460  
36516 111460       dl. w2     j2.+2  ;   w1 := year; w2 := month;
36517 111462       sh  w2     2      ;   if month > february then
36518 111464       al  w1  x1-1      ;     year := year - 1;
36519 111466  
36519 111466       al  w1  x1-68     ;   days := (year - 68)
36520 111468       wm. w1     j17.   ;     * days in four years
36521 111470       as  w1    -2      ;     / 4
36522 111472       ba. w1  x2+j5.-1  ;     + month table (month)
36523 111474       wa. w1     j2.+4  ;     + day;
36524 111476  
36524 111476       wm. w1     j13.   ;   w1 := hours := days * 24
36525 111478       wa. w1     j2.+6  ;     + hour;
36526 111480  
36526 111480       al  w2     0      ;   w2w3 := min;
36527 111482       rl. w3     j2.+8  ;
36528 111484  
36528 111484       wm. w1     j14.   ;   w0w1 := minutes := hours * 60
36529 111486       aa  w1     6      ;     + min;
36530 111488  
36530 111488       wd. w1     j11.   ;   w1 := fourmin := minutes / 4;
36531 111490       wm. w0     j14.   ;   seconds := minutes mod 4 * 60
36532 111492       wa. w0     j2.+10 ;     + sec;
36533 111494  
36533 111494       wm. w0     j18.   ;   msec := seconds * 10000;
36534 111496       rl  w3     0      ;   (w2=0) w3 := msec;
36535 111498  
36535 111498       wm. w1     j20.   ;   clock := fourmin * 2400000
36536 111500       aa  w1     6      ;     + msec;
36537 111502       jd         1<11+38;   set clock (clock);
36538 111504  
36538 111504       dl. w1     j30.+2 ;   name := successor command name;
36539 111506       ds. w1     e21.   ;
36540 111508       al  w0     1      ;   type := 1;  <* i.e. pretend that 'oldcat' has been read *>
36541 111510       sl  w0    (b25)   ;   if maincat not defined yet then
36542 111512       jl.        g36.   ;     goto next command; <* i.e. interpret 'oldcat' *>
36543 111514  
36543 111514       jl.        g35.   ;   goto next command;
36544 111516  
36544 111516  e.                     ;
36545 111516  
36545 111516  
36545 111516  b.i30 w.                ; new:
36546 111516                          ; --------
36547 111516  g51:
36548 111516       la. w0      i0.     ;   abs addr(console):= all bs(console):=
36549 111518                           ;   abs protection(console):=false;
36550 111518       rs  w0  x1+c26      ;   prio(console):= 0;
36551 111520       hs  w0  x1+c37      ;   pr(console):=illegal pr;
36552 111522       dl. w3      i2.     ;   buf claim(console):=standard buf;
36553 111524       ds  w3  x1+c34      ;   area claim(console):=standard area;
36554 111526       rl. w3      i3.     ;   internal claim(console):=standard int;
36555 111528       rs  w3  x1+c39      ;   cat mask(console):=standard cat;
36556 111530       rl. w0      i9.     ;
36557 111532       rl. w3      i9.     ;
36558 111534       ds  w0  x1+c41+2    ; max interval(console):=max interval(s)
36559 111536       ds  w0  x1+c42+2    ; standard interval(s)
36560 111538       ds  w0  x1+c43+2    ;
36561 111540       jl. w3     d46.     ;   reset last of console;
36562 111542       rl. w2     i25.     ; get work device name
36563 111544       jl. w3     d61.     ; get devno*8
36564 111546       jl.        g16.     ; sorry goto end line
36565 111548       wa. w2     e25.     ;
36566 111550       dl. w0     i6.      ;   perm claim(work device) :=
36567 111552       ds  w0  x2+c44+6    ;     standard segment,entries;
36568 111554  i10: dl. w3      i4.     ;   size(console):=standard size;
36569 111556       rl. w1     e25.     ;
36570 111558       ds  w3  x1+c40+2    ;
36571 111560       dl. w3      i5.     ;
36572 111562       ds  w3  x1+c40+6    ;   prog(console):=standard prog;
36573 111564       al  w3       1      ;   <* for both 'new' and 'all' *>
36574 111566       rs. w3     e77.     ;   increase access indicator := true;
36575 111568       jl.        g52.     ;   goto process;
36576 111570  i0:8.1771                ;
36577 111572  c7<12+c8                 ; standard buf and area:
36578 111574  i2:c9<12+c10             ; standard int and func:
36579 111576  i3:c12                   ; standard size:
36580 111578  i4=k+2, i5=k+6           ; standard prog:
36581 111578  <:fp:>,0,0,0             ;
36582 111586  c13                      ; standard segment claim
36583 111588  i6:c14                   ; standard entry claim
36584 111590  i8:8.2000                ; all bs resources bit
36585 111592  i9:8388605
36586 111594  i25:   c15               ; work device name
36587 111596  c.    (:c23>16a.1:)-1    ;
36588 111596  
36588 111596  g83 = k                  ; all:
36589 111596                           ; ---------
36590 111596       la. w0      i0.     ; abs addr(console):=
36591 111598       lo. w0      i8.     ; abs prot(console):= false
36592 111600       rs  w0  x1+c26      ; all bs(console):= true
36593 111602       rl. w2      b1.     ;
36594 111604       dl  w0  x2+a45      ;
36595 111606       ds  w0  x1+c41+2    ; maxbase:=standardbase(s)
36596 111608       ds  w0  x1+c42+2    ; standardbase:=  ------
36597 111610       ds  w0  x1+c43+2    ; userbase:=  -------
36598 111612       bz  w0  x2+a19      ; bufclaims(s)
36599 111614       ws. w0      e2.     ; - ownbuf
36600 111616       hs  w0  x1+c32      ; =: bufclaims(console)
36601 111618       bz  w0  x2+a20      ; areaclaims(s)
36602 111620       ws. w0      e3.     ; - own area
36603 111622       hs  w0  x1+c33      ; =: areaclaims(console)
36604 111624       bz  w0  x2+a21      ; internalclaims(s)
36605 111626       bs. w0       1      ; -1
36606 111628       hs  w0  x1+c34      ; =:internalclaims(console)
36607 111630       bz  w0  x2+a22      ; functionmask(s)
36608 111632       hs  w0  x1+c35      ; =: functionmask(console)
36609 111634       al  w0     0        ; size(console) := 0; <* i.e. max, see create child *>
36610 111636       rs  w0  x1+c39      ;
36611 111638       jl. w3      d46.    ;   clear claimlist;
36612 111640       jl.        i10.     ;
36613 111642  z.                       ;
36614 111642  e.
36615 111642  b. j5 w.
36616 111642  g94: am  c95-c96        ; i:
36617 111644                          ; -------
36618 111644  g95: al  w1  x1+c96+2   ; o:
36619 111646                          ; -------
36620 111646       jl. w3  d16.       ; get kind
36621 111648       rs  w0  x1-2       ;
36622 111650       jl.     j1.        ; continue with get name
36623 111652  
36623 111652  g52: am     c29-c40     ; process:
36624 111654                          ; ---------
36625 111654  g53: al  w1  x1+c40     ; program:
36626 111656                          ; ---------
36627 111656  j1:  jl. w3     d15.     ;   next name;
36628 111658       rl. w3      j2.     ; test name
36629 111660       sn. w3    ( e20.)   ; if name="s"
36630 111662       jl.          g3.    ; then goto error : not allowed
36631 111664       dl. w3     e21.     ; 
36632 111666       ds  w3  x1  +2      ;
36633 111668       dl. w3     e23.     ;
36634 111670       ds  w3  x1  +6      ;   name(console):=name;
36635 111672       jl.         g35.        ;   goto next command;
36636 111674   j2: <:s<0>:>            ; (prevent blocking communication with s)
36637 111676  e.
36638 111676  ;
36639 111676  m.
36639 111676                  step 1

36640 111676  ;
36641 111676  ; stepping stones
36642 111676  ; ---------------
36643 111676  ;
36644 111676  
36644 111676  jl.   (2) ,  l2 ,  d2 = k-4
36645 111680  jl.   (2) , l15 , d15 = k-4
36646 111684  jl.   (2) , l14 , d14 = k-4
36647 111688  jl.   (2) , l16 , d16 = k-4
36648 111692  jl.   (2) , l17 , d17 = k-4
36649 111696  jl.   (2) , l18 , d18 = k-4
36650 111700  jl.   (2) , l19 , d19 = k-4
36651 111704  jl.   (2) , l20 , d20 = k-4
36652 111708  jl.   (2) , l21 , d21 = k-4
36653 111712  jl.   (2) , l22 , d22 = k-4
36654 111716  jl.   (2) , l23 , d23 = k-4
36655 111720  jl.   (2) , l24 , d24 = k-4
36656 111724  jl.   (2) , l27 , d27 = k-4
36657 111728  jl.   (2) , l34 , d34 = k-4
36658 111732  jl.   (2) , l39 , d39 = k-4
36659 111736  jl.   (2) , l41 , d41 = k-4
36660 111740  jl.   (2) , l42 , d42 = k-4
36661 111744  jl.   (2) , l44 , d44 = k-4
36662 111748  jl.   (2) , l46 , d46 = k-4
36663 111752  jl.   (2) , l51 , d51 = k-4
36664 111756  jl.   (2) , l52 , d52 = k-4
36665 111760  jl.   (2) , l53 , d53 = k-4
36666 111764  jl.   (2) , l54 , d54 = k-4
36667 111768  jl.   (2) , l55 , d55 = k-4
36668 111772  jl.   (2) , l56 , d56 = k-4
36669 111776  jl.   (2) , l57 , d57 = k-4
36670 111780  jl.   (2) , l58 , d58 = k-4
36671 111784  jl.   (2) , l61 , d61 = k-4
36672 111788  jl.   (2) , l64 , d64 = k-4
36673 111792  jl.   (2) , l74 , d74 = k-4
36674 111796  jl.   (2) , l77 , d77 = k-4
36675 111800  jl.   (2) , l78 , d78 = k-4
36676 111804  
36676 111804  jl.   (2) , g1  , g1  = k-4
36677 111808  jl.   (2) , g3  , g3  = k-4
36678 111812  
36678 111812  b.i24
36679 111812  w.g54:lo. w0  i0.        ; address:
36680 111814                           ; ---------
36681 111814       hs  w0  x1+c27      ;   abs addr(console):=true;
36682 111816       am     c30-c39      ;
36683 111818  g56: al  w2  x1+c39      ; size:
36684 111820                           ; ---------
36685 111820       jl. w3     d16.     ;   next integer(integer);
36686 111822       sz  w0       2.1    ;
36687 111824       bs. w0       1      ;   integer(23):= 0;
36688 111826  c.(:a399>23a.1:)-1
36689 111826       al  w1     0        ;
36690 111826       ld  w0    -11       ;
36691 111826       se  w1     0        ;   if integer mod 2k <>0 then
36692 111826       ea. w0     1        ;     round up
36693 111826       ls  w0     11       ;
36694 111826  z.
36695 111826       rs  w0  x2  +0      ;   word param(console):=integer;
36696 111828       jl.         g35.    ;   goto next command;
36697 111830  i0:1<1
36698 111832  e.
36699 111832  b.i10
36700 111832  w.
36701 111832                           ; mode :
36702 111832                           ; ----------
36703 111832                           ; syntax mode <short integer>
36704 111832  
36704 111832  g55: la. w0      i2.     ; abs protection=false
36705 111834       rs  w0       4      ; w2=command mask
36706 111836       jl. w3     d16.     ; next integer
36707 111838       sn  w0       0      ; if mode=0 then
36708 111840       lo. w2      i3.     ; abs protection=true
36709 111842       rs  w2  x1+c26      ; 
36710 111844       jl.        g35.     ; next command
36711 111846  
36711 111846  g60: am     c32-c33      ; buffer claim:
36712 111848                           ; -------------
36713 111848  g61: am     c33-c34      ; area claim:
36714 111850                           ; -------------
36715 111850  g62: al  w2  x1+c34      ; internal claim:
36716 111852                           ; ---------------
36717 111852  i1:  jl. w3     d16.     ;   next integer(integer);
36718 111854       hs  w0  x2  +0      ;   byte param(console):=integer;
36719 111856       jl.         g35.    ;   goto next command;
36720 111858  i2:8.7773
36721 111860  i3:1<2
36722 111862  e.
36723 111862  
36723 111862  
36723 111862  ; cpa <cpavalue> or 0 or 1 :
36724 111862  ; --------------------------
36725 111862  g59: jl. w3     d16.     ; next integer
36726 111864       sh  w0      -1      ; if < 0 then
36727 111866       jl.         g8.     ; write : illegal cpa
36728 111868  c.(:a399>23a.1:)-1
36729 111868       sz  w0      (b216)  ; if new cpa mod 2k<>0 then
36730 111868       jl.         g8.     ; write: illegal cpa
36731 111868  z.
36732 111868       rs  w0  x1+c98      ;
36733 111870       jl.        g35.     ; goto next command
36734 111872  
36734 111872  
36734 111872  ; function mask:
36735 111872  ; --------------
36736 111872  g63: jl. w3     d45.     ;   next bitnumbers(bits, type);
36737 111874       ls  w2     -12      ;
36738 111876       hs  w2  x1+c35      ;   function mask(console):=bits(0:11);
36739 111878       jl.         g36.    ;   goto exam command;
36740 111880                         
36740 111880  ; create:
36741 111880  ; --------
36742 111880  b. i5  w.
36743 111880  i0:  <:link<0>:>
36744 111884  g64: rl. w3     e22.     ;
36745 111886       sn. w3     (i0.)    ; if command=createlink then
36746 111888       jl.        g112.    ; goto createlink
36747 111890  
36747 111890       jl. w3     d35.     ;
36748 111892       rl. w2     e29.     ;   create child;
36749 111894       rl  w0  x2+a17      ;
36750 111896  ;    wa  w0  x2+a182
36751 111896       jl. w3     d36.     ;   modify child(first addr(child));
36752 111898       jl.         g35.    ;   goto next command;
36753 111900  e.
36754 111900  ; init:
36755 111900  ; -------
36756 111900  g65: jl. w3     d35.     ;   create child;
36757 111902       jl. w3     d37.     ;   load child;
36758 111904       jl.        g35.     ;   goto next command;
36759 111906  
36759 111906  ; run:
36760 111906  ; -------
36761 111906  g66: rl. w1     e25.     ;
36762 111908       jl. w3     d10.     ;   decrease access(console);
36763 111910       jl. w3     d35.     ;   create child;
36764 111912       jl. w3     d37.     ;   load child;
36765 111914       jl. w3     d38.     ;   start child;
36766 111916       jl.        g35.     ;   goto next command;
36767 111918  
36767 111918  ; load:
36768 111918  ; --------
36769 111918  g67: jl. w3     d34.     ;   check child;
36770 111920       jl. w3     d37.     ;   load child;
36771 111922       jl.        g35.     ;   goto next command;
36772 111924  
36772 111924  ; start:
36773 111924  ; ---------
36774 111924  g68: rl. w1     e25.     ;
36775 111926       jl. w3     d10.     ;   decrease access(console);
36776 111928       jl. w3     d34.     ;   check child;
36777 111930       jl. w3     d38.     ;   start child;
36778 111932       jl.        g35.     ;   goto next command;
36779 111934  
36779 111934  ; stop:
36780 111934  ; --------
36781 111934  g69: jl. w3     d34.     ;   check child;
36782 111936       jl. w3     d39.     ;   stop child;
36783 111938       jl.        g35.     ;   goto next command;
36784 111940  
36784 111940  
36784 111940  c.(:c23>22a.1:)-1        ; if break option then
36785 111940  g70 = k                  ; break:
36786 111940                           ; ---------
36787 111940       jl. w3  d34.        ; begin check child;
36788 111942       jl. w3     d39.     ;   stop child;
36789 111944       rl. w2     e29.     ;
36790 111946       rl  w3  x2+a27      ;   addr:=interrupt addr(child);
36791 111948       sn  w3       0      ;   if addr<>0 then
36792 111950       jl.        g35.     ;   begin
36793 111952       wa  w3  x2+a182     ; addr:=addr + base (physical)
36794 111954       dl  w1  x2+a29      ;   word(addr):=save w0(child);
36795 111956       ds  w1  x3  +2      ;   word(addr+2):=save w1(child);
36796 111958       dl  w1  x2+a31      ;   word(addr+4):=save w2(child);
36797 111960       ds  w1  x3  +6      ;   word(addr+6):=save w3(child);
36798 111962       dl  w1  x2+a33      ;   word(addr+8):=save ex(child);
36799 111964       ds  w1  x3 +10      ;   word(addr+10):=save ic(child);
36800 111966       al  w1       8      ;   word(addr+12):=8;
36801 111968       rs  w1  x3 +12      ;
36802 111970       ws  w3  x2+a182     ; addr:=addr - base (logical)
36803 111972       al  w0  x3+a180     ;   modify child(addr+a180);
36804 111974       jl. w3     d36.     ;   start child;
36805 111976       jl. w3     d38.     ;   end;
36806 111978       jl.        g35.     ;   goto next command;
36807 111980  z.
36808 111980  
36808 111980  ; remove:
36809 111980  ; ---------
36810 111980  b. i24  w.
36811 111980  i0:  <:link<0>:>
36812 111984  g71: rl. w3     e22.     ;
36813 111986       sn. w3     (i0.)    ; if command=removelink then
36814 111988       jl.        g113.    ; goto removelink
36815 111990  
36815 111990       jl. w3     d34.     ;   check child;
36816 111992       jl. w3     d39.     ;   stop child;
36817 111994       jl. w3     (i1.)    ; adjust bs-claims
36818 111996       jl. w3     d40.     ;   remove child;
36819 111998       jl.        g35.     ;   goto next command;
36820 112000  
36820 112000  
36820 112000  
36820 112000  ; cleanup:
36821 112000  g104:                    ; cleanup:
36822 112000                           ; ----------
36823 112000       rl. w3     e15.+c20 ;   while first of core table <> core table head do
36824 112002       sn. w3     e15.     ;   begin
36825 112004       jl.        g35.     ;     done: goto next command;
36826 112006       rs. w3     e30.     ;     coretable element:=first of coretable;
36827 112008       rl  w0  x3+c17      ;     child:= child(first of core table);
36828 112010       rs. w0     e29.     ;
36829 112012       jl. w3     d39.     ;     stop process;
36830 112014       jl. w3     (i1.)    ;     adjust bs-claims;
36831 112016       jl. w3     d40.     ;     remove child;
36832 112018       jl.        g104.    ;   end;
36833 112020  i1:  d76
36834 112022  e.
36835 112022  c.(:c23>21a.1:)-1        ; if include/exclude option then
36836 112022  g72 = k                  ; include:
36837 112022                           ; ------------
36838 112022       am         2        ;
36839 112024  g73 = k                  ; exclude:
36840 112024                           ; ------------
36841 112024  b.i24  w.                ; begin
36842 112024       rl. w3  i2.         ;
36843 112026       rs. w3      i1.     ;
36844 112028       jl. w3     d34.     ;   check child;
36845 112030  i0:  jl. w3      d2.     ; more:
36846 112032       se  w0       2      ;   next param(type);
36847 112034       jl.        g36.     ;   if type<>2
36848 112036       rl. w1     e25.     ;   then goto exam command;
36849 112038       al  w3  x1+c29      ;
36850 112040       rl. w1     e19.     ;   include/exclude(name(console),
36851 112042  i1:  am           0      ;       integer,result);
36852 112044       se  w0       0      ;   if result=0
36853 112046       jl.        g16.     ;   then goto more
36854 112048       jl.         i0.     ;   else goto end line;
36855 112050  i2:  jd     1<11+14      ;
36856 112052       jd     1<11+12      ;
36857 112054  e.z.
36858 112054  c.(:c23>20a.1:)-1       ; if call option then
36859 112054  g74 = k                 ; call:
36860 112054                          ; --------
36861 112054  b.i24 w.                ; begin
36862 112054  i0:  jl. w3  d2.        ; more: next param(type);
36863 112056       se  w0       2      ;   if type<>2 
36864 112058       jl.        g36.     ;   then goto exam command;
36865 112060       rl. w1     e19.     ;   device:=integer;
36866 112062       jl. w3     d15.     ;   next name;
36867 112064       al. w3     e20.     ;   create peripheral process(
36868 112066       jd     1<11+54      ;   name,device,result);
36869 112068       sn  w0       3      ;   if result=3
36870 112070       jl.        g10.     ;
36871 112072       sn  w0       4      ;   or result=4
36872 112074       jl.        g16.     ;
36873 112076       sn  w0       5      ;   or result=5
36874 112078       jl.        g17.     ;   then goto end line
36875 112080       jl.         i0.     ;   else goto more;
36876 112082  e.
36877 112082  z.
36878 112082  c.(:c23>19a.1:)-1       ; if list option then
36879 112082  b.i24 w.                ; begin
36880 112082  g75 = k                 ; list:
36881 112082                          ; ---------
36882 112082       rl  w2  b6         ; 
36883 112084  i1:  sl  w2     (b7)     ; for i:=first internal step 1
36884 112086       jl.        g35.     ; until last internal do
36885 112088       rl  w1  x2          ;
36886 112090       rl  w0  x1+a11      ; if name=0
36887 112092       rl  w3  x1+a34      ; or
36888 112094       al  w2  x2  +2      ; parent=0
36889 112096       rs. w2     e78.     ;
36890 112098       se  w0       0      ;
36891 112100       sn  w3       0      ; else
36892 112102       jl.         i1.     ; begin
36893 112104       jl. w3     d19.     ; initwrite
36894 112106       rl  w2  x2  -2      ;
36895 112108       al  w1  x2+a11      ;
36896 112110       jl. w3     d21.     ; writetext(processname)
36897 112112       ac  w1  x1 -12      ;
36898 112114       jl. w3     d70.     ; writespace(no af spaces)
36899 112116       rl  w1  x2+a17      ;
36900 112118       wa  w1  x2+a182
36901 112120       al  w0       8      ;
36902 112122       jl. w3     d71.     ; writeint(first core,8)
36903 112124       rl  w1  x2+a18      ;
36904 112126       ws  w1  x2+a17      ; 
36905 112128       al  w0       8      ;
36906 112130       jl. w3     d71.     ; writeint(coresize,8)
36907 112132       rl  w1  x2+a301     ;
36908 112134       al  w0        4     ;
36909 112136       jl. w3     d71.     ; writeint(priority,8)
36910 112138       zl  w1  x2+a12      ;
36911 112140       al  w0       4      ;
36912 112142       jl. w3     d71.     ; writeint(stopcount,4)
36913 112144       bl  w0  x2+a13      ; w0 := process state;
36914 112146                           ;
36915 112146       al. w3     i9.      ;  write process state:
36916 112148       sz  w0   2.10000000 ;  if not waiting then
36917 112150       jl.        i3.      ;  begin
36918 112152       sz  w0   2.00000011 ;     if not running then
36919 112154       jl.        i2.      ;
36920 112156       jl. w1     d21.     ;     writetext(<:error :>)
36921 112158           <: error     :> ;
36922 112166  i2:  jl. w1     d21.     ;     else
36923 112168           <: running   :> ;     writetext(<:running :>;
36924 112176  i3:                      ;  end else
36925 112176       so  w0   2.10100000 ;  if waiting for stop or start then
36926 112178       jl.        i4.      ;     writetext(<:stop :>)
36927 112180       jl. w1     d21.     ;  
36928 112182           <: stopped   :> ;  else
36929 112190  i4:  sz  w0   2.00000111 ;  if waiting for cpu then
36930 112192       jl.        i5.      ;     writetext(<:waiting cpu :>)
36931 112194       jl. w1     d21.     ;
36932 112196           <: wait cpu  :> ;  else
36933 112204  i5:  so  w0   2.00000011 ;  if waiting for event then
36934 112206       jl.        i6.      ;     writetext(<:waiting event :>)
36935 112208       jl. w1     d21.     ; 
36936 112210           <: wait evnt :> ;  else
36937 112218  i6:  sz  w0   2.00000011 ;  if waiting for procfunc then
36938 112220       jl.        i7.      ;     writetext(<:waiting proc :>)
36939 112222       jl. w1     d21.     ; 
36940 112224           <: wait proc :> ;  else
36941 112232  i7:  so  w0   2.00000001 ;  if waiting for message then
36942 112234       jl.        i8.      ;     writetext(<:waiting mess :>)
36943 112236       jl. w1     d21.     ;
36944 112238           <: wait mess :> ;  else
36945 112246  i8:  jl. w1     d21.     ;     writetext(<:waiting answ :>);
36946 112248           <: wait answ :> ;
36947 112256  i9:                      ;  comment: return from writetext;
36948 112256       rl  w1  x2+a34    ;
36949 112258       al  w1  x1+a11      ;
36950 112260       jl. w3     d21.     ; writetext(parent)
36951 112262       al  w0      10      ;
36952 112264       jl. w3     d20.     ; writechar(nl)
36953 112266       jl. w3     d23.     ; typeline(buf)
36954 112268       jl. w3     d42.     ; save work(buf)
36955 112270       jl.         g47.    ; +2 error goto end line
36956 112272       rl. w2     e78.     ;
36957 112274       jl.         i1.     ;
36958 112276  e.
36959 112276  z.
36960 112276  c.(:c23>18a.1:)-1        ; if max option then
36961 112276  g76 = k                  ; max:
36962 112276  b.i24  w.                ; begin
36963 112276       al. w1     g26.     ;
36964 112278       jl. w3     d21.     ;   writetext(<:max:>);
36965 112280       am       -2048      ;
36966 112282       jl. w3     d29.+2048;   find max(size);
36967 112284       jl. w3     d22.     ;   writeinteger(size);
36968 112286       al  w0      32      ;
36969 112288       jl. w3     d20.     ;   writechar(32);
36970 112290       rl. w2      b1.     ;
36971 112292       bz  w1  x2+a19      ;
36972 112294       ws. w1     (v2.)    ;   writeinteger(buf claim(s)
36973 112296       jl. w3     d22.     ;                -own buf);
36974 112298       al  w0      32      ;
36975 112300       jl. w3     d20.     ;   writechar(32);
36976 112302       bz  w1  x2+a20      ;
36977 112304       ws. w1     (v3.)    ;   writeinteger(area claim(s)
36978 112306       jl. w3     d22.     ;                -own area);
36979 112308       al  w0      32      ;
36980 112310       jl. w3     d20.     ;   writechar(32);
36981 112312       bz  w1  x2+a21      ;
36982 112314       jl. w3     d22.     ;   writeinteger(internal claim(s));
36983 112316       al  w0      32      ;
36984 112318       jl. w3     d20.     ;   writechar(32);
36985 112320  c.-4000
36986 112320       al  w2       8      ;   keys:=8;
36987 112320       jl. w3     d32.     ;   find keys(keys,pr,pk,
36988 112320       jl.         i0.     ;             typekeys);
36989 112320       am           0      ;
36990 112320  i0:  ac  w1  x2  -8      ; typekeys:
36991 112320       jl. w3     d22.     ;   writeinteger(8-keys);
36992 112320  z.
36993 112320       al  w0      10      ;
36994 112322       jl. w3     d20.     ;   writechar(10);
36995 112324       jl. w3     d23.     ;   typeline(buf);
36996 112326       jl. w3     d42.     ;   save work(buf);
36997 112328       jl.         g47.    ;+2:  error:  goto end line;
36998 112330       jl.        g35.     ;   goto next command;
36999 112332  e.
37000 112332  z.
37001 112332  
37001 112332  
37001 112332  
37001 112332  c.(:c23>17a.1:)-1       ; if replace option then
37002 112332  g77 = k                 ; replace:
37003 112332                          ; ----------
37004 112332  b.i24 w.                ; begin
37005 112332       jl. w3      d15.    ;   next name;
37006 112334       rl. w3     v20.     ;
37007 112336       jd     1<11+52      ;   create area process(name,result);
37008 112338       sn  w0       2      ;
37009 112340       jl.        g11.     ;   if result=2
37010 112342       se  w0       3      ;       or result=3
37011 112344       sn  w0       4      ;       or result=4 then
37012 112346       jl.        g12.     ;     goto end line;
37013 112348       al. w1     e51.     ;
37014 112350       rl. w3      b1.     ; next buffer:
37015 112352  i0:  al  w2       0      ;   buf:=0;
37016 112354       jd     1<11+24      ;   wait event(buf);
37017 112356       jd     1<11+26      ;   get event(buf);
37018 112358       ba. w0       1      ;   result:=result+1;
37019 112360       sn  w0       1      ;   if result=1 then
37020 112362       jd     1<11+22      ;     send answer(buf,answer,result);
37021 112364       rl  w0  x3+a15      ;   next:=word(event q(proc));
37022 112366       se  w0  x3+a15      ;   if next<>event q(proc) then
37023 112368       jl.         i0.     ;     goto next buffer;
37024 112370       al. w3    (v20.)    ;
37025 112372       jd      1<11+8      ;   reserve process(name,result);
37026 112374       sn  w0       1      ;   if result=1 then
37027 112376       jl.         i2.     ;     goto give up;
37028 112378       al. w1     e51.     ;
37029 112380       jd     1<11+42      ;   lookup entry(name,tail,result);
37030 112382       sn  w0       2      ;   if result=2 then
37031 112384       jl.         i3.     ;     goto give up;
37032 112386       bz. w0     e59.     ;
37033 112388       se  w0       8      ;   if content<>8 then
37034 112390       jl.         i4.     ;     goto give up;
37035 112392       rl. w1     e60.     ;
37036 112394       al  w1  x1+511      ;
37037 112396       ls  w1      -9      ;   load size:=
37038 112398       ls  w1       9      ;       (bytes(tail)+511)/512*512;
37039 112400       jl. w3     d27.     ;   find size(start,size,give up);
37040 112402       jl.         i6.     ;
37041 112404       wa  w1       0      ;   last addr(area mess):=
37042 112406       al  w1  x1  -2      ;     first addr+load size-2;
37043 112408       ds. w1    (v49.)    ;   first addr(area mess):= first addr;
37044 112410       rl. w1    (v58.)    ;   segment(area mess):=
37045 112412       rs. w1    (v50.)    ;       segment(tail);
37046 112414       bz. w1    (v67.)    ;
37047 112416       wa  w1       0      ;
37048 112418       rs. w1     i20.     ;   entry:= first addr+entry(tail);
37049 112420       rl. w3     (v49.)   ;
37050 112422       sh  w1  x3          ;   if entry>last addr(area mess) then
37051 112424       jl.          4      ;
37052 112426       jl.         i5.     ;     goto give up;
37053 112428       al. w1    (v47.)    ;
37054 112430       rl. w3     v20.     ;
37055 112432       jd     1<11+16      ;   send mess(name,area mess,buf);
37056 112434       al. w1    (v51.)    ;
37057 112436       jd     1<11+18      ;   wait answer(buf,answer,result);
37058 112438       rl. w1    (v51.)    ;
37059 112440       lo  w1       0      ;   res:= status or result;
37060 112442       jd     1<11+64      ;   remove process(name,result);
37061 112444       se  w1       1      ;   if res <> 1 then
37062 112446       jl.        g15.     ;     goto sorry;
37063 112448       rl. w0     i22.     ;
37064 112450       rs. w0     g30.     ;
37065 112452       jl.         g1.     ;
37066 112454  i12: rl. w1    (v24.)    ; ok:
37067 112456       rl  w2  x1+c50      ;   buf:= state(work);
37068 112458       jd     1<11+18      ;   wait answer(buf,work,result);
37069 112460       ld  w1     -100      ;   w0:= w1:= 0;
37070 112462       rl. w2    (v25.)    ;   
37071 112464       rl  w2  x2+c25      ;    w2:=process descr.(console)
37072 112466       xl.          0      ;   ex:= 0;
37073 112468       jl.       (i20.)    ;   goto entry;
37074 112470  
37074 112470  i2:  am         g13-g11;
37075 112472  i3:  am         g11-g12;
37076 112474  i4:  am         g12-g14;
37077 112476  i5:
37078 112476  i6:  al. w2     g14.     ; give up:
37079 112478       rl. w3     v20.     ;
37080 112480       jd     1<11+64      ;   remove process(name,result);
37081 112482       jl      x2  +0      ;   goto end line;
37082 112484  i20: 0                   ; entry
37083 112486  i22: jl.    i12-g30      ; return to ok
37084 112488  e.
37085 112488  z.
37086 112488  
37086 112488  
37086 112488  ; closecatopr
37087 112488  ; -----------
37088 112488  ;
37089 112488  ; closecatopr
37090 112488  ;
37091 112488  
37091 112488  b.  i5,  j5  w.
37092 112488  g119:                  ; closecatopr
37093 112488                         ; begin
37094 112488       rl. w1     i0.    ;   first core := first free core;
37095 112490       rs. w1    (v16.)  ;
37096 112492       al  w1     0      ;
37097 112494       rl. w3    (v12.)  ;   command table end := 0;
37098 112496       rs  w1  x3        ;
37099 112498       jl.        g35.   ;   goto next command;
37100 112500  i0:  h11               ;   top of resident commands;
37101 112502  e.                     ; end;
37102 112502  
37102 112502  
37102 112502  ; priviliged
37103 112502  ; -----------
37104 112502  ;
37105 112502  ; priviliged
37106 112502  ;
37107 112502  
37107 112502  b.  i5,  j5  w.
37108 112502  g124:                  ; priviliged
37109 112502                         ; begin
37110 112502       jl. w3     d15.   ;   next_name;
37111 112504       rl. w1     v20.   ; begin
37112 112506       rl. w3    (v35.)  ;
37113 112508       rl  w2  x3+c20    ;
37114 112510       sn  w2  (x3+c21)  ;   if number of free consolbuffs < 2 then
37115 112512       jl.        g126.  ;      write 'no free';<* dont use the last one *>
37116 112514       al  w0  x1-2      ;   pseudo_pd:=name area address -2
37117 112516       jl. w3     d64.   ;   find_and_select_console_2(pseudo_pd_addr,consol_buf);
37118 112518       jl.        g126.  ;   not_found: goto no consolbuffers;
37119 112520       al  w3     2.1000 ;
37120 112522       lo  w3  x1+c27    ;
37121 112524       hs  w3  x1+c27    ;   set(privileged);
37122 112526       jl. w3     d17.   ;   remove_element(console);
37123 112528       jl.        g35.   ;   else goto next command;
37124 112530                         ; end;
37125 112530  
37125 112530  
37125 112530  
37125 112530  ; unprivileged
37126 112530  ; -----------
37127 112530  ;
37128 112530  ; unprivileged
37129 112530  ;
37130 112530  
37130 112530  g125:                  ; unprivileged
37131 112530                         ; begin
37132 112530       jl. w3     d15.   ;   next_name;
37133 112532       rl. w1     v20.   ; begin
37134 112534       al  w0  x1-2      ;   pseudo_pd:=name area address -2
37135 112536       jl. w3     d44.   ;   find_console(pseudo_pd_addr,console_buf);
37136 112538       jl.        g22.   ;not_found: goto unknown;
37137 112540       am         (b4)   ;found:
37138 112542       rl  w3     a199<1 ;
37139 112544       se  w3  (x1+c25)  ;   if console = mainconsole or
37140 112546       se  w1  (x1+2)    ;   not unlinked then
37141 112548       jl.        g3.    ;   goto not allowed;
37142 112550       zl  w3  x1+c27    ;
37143 112552       al  w3  x3-2.1000 ;   remove privileged;
37144 112554       hs  w3  x1+c27    ;
37145 112556       rl. w2     v35.   ;
37146 112558       jl. w3     d18.   ;   insert_in_free(console);
37147 112560       jl.        g35.   ;   else goto next command;
37148 112562  e.                     ; end;
37149 112562  ;
37150 112562  m.
37150 112562                  step 2 g-names

37151 112562  
37151 112562  ;
37152 112562  ; stepping stone
37153 112562  ;
37154 112562  jl.        (2),  g2,  g2=k-4
37155 112566  jl.        (2),  g9,  g9=k-4
37156 112570  jl.        (2), g11, g11=k-4
37157 112574  jl.        (2), g15, g15=k-4
37158 112578  jl.        (2), g16, g16=k-4
37159 112582  jl.        (2), g19, g19=k-4
37160 112586  jl.        (2), g20, g20=k-4
37161 112590  jl.        (2), g21, g21=k-4
37162 112594  jl.        (2), g22, g22=k-4
37163 112598  jl.        (2), g27, g27=k-4
37164 112602  jl.        (2), g31, g31=k-4
37165 112606  jl.        (2), g35, g35=k-4
37166 112610  jl.        (2), g36, g36=k-4
37167 112614  jl.        (2), g47, g47=k-4
37168 112618  jl.        (2), g66, g66=k-4
37169 112622  
37169 112622  
37169 112622  c.(:a80>16a.1:)-1      ; <* include connect, disconnect, link, unlink, linkall
37170 112622                         ;    and initkit if itc device drivers are included *>
37171 112622  
37171 112622  b.  p21  w.            ; itc controller command block
37172 112622  
37172 112622  p0 = 6                 ; size of logical disc description 
37173 112622  c. -1
37174 112622  p1: <:connect error <0>:>
37175 112622  p2: <:  connected to<0>:>
37176 112622  p3: <:disconnect error <0>:>
37177 112622  p4: <:link error <0>:>
37178 112622  p5: <:logical disc linked  on<0>:>
37179 112622  p6: <:unlink error <0>:>
37180 112622  p7: <:disc error <0>:>
37181 112622  p8: <:illegal devno<0>:>
37182 112622  
37182 112622  
37182 112622  
37182 112622  p9: 0,0,0,0            ; name save area
37183 112622  p10: 0                 ; param area: cm / log devno
37184 112622       0                 ;             unit / phys devno
37185 112622       0                 ;             devno or -1 / first segment
37186 112622       0                 ;             kind, type / no of segments
37187 112622       5                 ;             max outstanding operations
37188 112622  p11: h23               ; first of disc buffer
37189 112622  p12: h24               ; last of disc buffer
37190 112622  p13: <:unknown <0>:>   ; device name table
37191 112622  p14: <:disc    <0>:>
37192 112622  p15: <:terminal<0>:>
37193 112622  p16: <:printer <0>:>
37194 112622  p17: <:tape    <10>:>
37195 112622  p18: <:idamain <0>:>
37196 112622  p19: <:ifpmain <0>:>
37197 112622  p20: <:gsd<0>:>
37198 112622  
37198 112622  ; connect:
37199 112622  ; --------
37200 112622  ;
37201 112622  ; connect <name of itcmain> <device kind> <device type> <cm> <unit> (<device no>)
37202 112622  ;
37203 112622  b. i5, j5  w.
37204 112622  
37204 112622  g112:                  ; connect
37205 112622                         ; begin
37206 112622       jl. w3     d15.   ;   next name; <* itc main process name *>
37207 112622       dl. w0    (v21.)  ;   <* move name to local save area *>
37208 112622       ds. w0     p9.+2  ;
37209 112622       dl. w0    (v23.)  ;
37210 112622       ds. w0     p9.+6  ;
37211 112622       al. w1     p10.   ;
37212 112622       jl. w3     d16.   ;   param.device type := next integer;
37213 112622       hs  w0  x1+6+0    ;
37214 112622  
37214 112622       jl. w3     d16.   ;   param.device kind := next integer
37215 112622       hs  w0  x1+6+1    ;
37216 112622                         ;
37217 112622       jl. w3     d16.   ;   param.cm := next integer;
37218 112622       rs  w0  x1+0      ;
37219 112622       jl. w3     d16.   ;   param.unit := next integer;
37220 112622       rs  w0  x1+2      ;
37221 112622                         ;
37222 112622       jl. w3     d2.    ;   param.devno :=
37223 112622       rs. w0    (v78.)  ;   if next param = integer then param
37224 112622       al  w1    -1      ;   else -1;
37225 112622       sn  w0     2      ;
37226 112622       rl. w1    (v19.)  ;   <* type of param is saved for later use
37227 112622       al. w2     p10.   ;      to determine whether the next command
37228 112622       rs  w1  x2+4      ;      has been read or not *>
37229 112622       al. w1     p9.    ;
37230 112622       jl. w3     d51.   ;   connect(itcmain, param);
37231 112622       jl.        j1.    ;   +0: 
37232 112622                         ;   +2: if not error then
37233 112622       jl. w3     d19.   ;   begin  initwrite;
37234 112622       rl. w2     v51.   ;
37235 112622       rl  w1  x2+2      ;
37236 112622       ls  w1    +1      ;     connection := 
37237 112622       wa  w1     b4     ;     name table(answer.devno);
37238 112622       rl  w2  x1        ;
37239 112622       al. w1     p13.   ;
37240 112622       rl  w0  x2        ;     text:=
37241 112622                         ;     device name table(answer.device kind);
37242 112622       sn  w0     q6     ;
37243 112622       al. w1     p14.   ;
37244 112622       sn  w0     q8     ;
37245 112622       al. w1     p15.   ;
37246 112622       sn  w0     q14    ;
37247 112622       al. w1     p16.   ;
37248 112622       sn  w0     q18    ;
37249 112622       al. w1     p17.   ;
37250 112622       sn  w0     q20    ;
37251 112622       al. w1     p18.   ;
37252 112622       sn  w0     q26    ;
37253 112622       al. w1     p19.   ;
37254 112622       sn  w0     q28    ;
37255 112622       al. w1     p20.   ;
37256 112622       jl. w3     d21.   ;     write(text);
37257 112622       rl  w1  x2+a67    ;
37258 112622       jl. w3     d22.   ;     writeinteger(connection.cm);
37259 112622       rl  w1  x2+a68    ;
37260 112622       jl. w3     d22.   ;     writeinteger(connection.unit);
37261 112622       al. w1     p2.    ;
37262 112622       jl. w3     d21.   ;     write(<:connected to:>);
37263 112622       am.       (v51.)  ;
37264 112622       rl  w1    +2      ;
37265 112622       jl. w3     d22.   ;     writeinteger(answer.devno);
37266 112622       jl.        j2.    ;   end
37267 112622  j1:                    ;   else begin
37268 112622       rl  w2     0      ;     <*save logical status*>
37269 112622       jl. w3     d19.   ;     initwrite;
37270 112622       al. w1     p1.    ;
37271 112622       jl. w3     d21.   ;     write(<:connect error:>);
37272 112622       al  w1  x2        ;
37273 112622       jl. w3     d14.   ;     writebits(logical status);
37274 112622                         ;   end;
37275 112622  j2:                    ;
37276 112622       al  w0     10     ;
37277 112622       jl. w3     d20.   ;   writechar(nl);
37278 112622       jl. w3     d23.   ;   type line(buf);
37279 112622       jl. w3     d42.   ;   save work(buf);
37280 112622       am          0    ;   +0 ignore output error
37281 112622       rl. w0    (v78.)  ;   +2:    else <get type of last read param >;
37282 112622       sn  w0     2      ;   if last read param = integer then
37283 112622       jl.        g35.   ;        goto next command
37284 112622       jl.        g36.   ;   else goto exam command;
37285 112622                         ;
37286 112622  i1:  0                 ;
37287 112622  
37287 112622  e.                     ; end;
37288 112622  
37288 112622  
37288 112622  ; disconnect:
37289 112622  ; -----------
37290 112622  ;                             *
37291 112622  ; disconnect (<device number>)
37292 112622  ;                             0
37293 112622  
37293 112622  b.  i5, j5  w.
37294 112622  
37294 112622  g113:                  ; disconnect
37295 112622       jl. w3     d2.    ; if next param <> integer then
37296 112622       se  w0     2      ;    goto exam command
37297 112622       jl.        g36.   ; else begin
37298 112622       rl. w0    (v19.)  ;   deviceno := read integer;
37299 112622       jl. w3     d52.   ;   disconnect(deviceno, logical status);
37300 112622       sz                ;   +0: if  error then goto error
37301 112622       jl.        g113.  ;   +2:     else goto disconnect;
37302 112622                         ;
37303 112622       rl  w2     0      ;   error:
37304 112622       al. w1     p3.    ;   save error cause;
37305 112622       jl. w3     d21.   ;   writetext(<:disconnect error:>;
37306 112622       al  w1  x2        ;
37307 112622       jl. w3     d14.   ;   writebits(logical status);
37308 112622       al  w0     10     ;
37309 112622       jl. w3     d20.   ;   writechar(nl);
37310 112622       jl. w3     d23.   ;   type line(buf);
37311 112622       jl. w3     d42.   ;   save work(buf);
37312 112622       jl.        g47.   ;   +0: if error then goto endline
37313 112622       jl.        g113.  ;   +2:    else goto disconnect
37314 112622                         ;
37315 112622  e.                     ; end;
37316 112622  z.
37317 112622  p1: <:createlink error <0>:>
37318 112634  p2: <:  linked to<0>:>
37319 112642  p3: <:removelink error <0>:>
37320 112654  p4: <:link error <0>:>
37321 112662  p5: <:logical disc linked  on<0>:>
37322 112678  p6: <:unlink error <0>:>
37323 112688  p7: <:disc error <0>:>
37324 112696  p8: <:illegal devno<0>:>
37325 112706  
37325 112706  
37325 112706      0,0,0,0            ;
37326 112714  p9: 0,0,0,0            ; name save area
37327 112722  ;                        param area
37328 112722  ;                               create link                   link logical disk
37329 112722  ;                        disk/tape      console/floppy
37330 112722  p10: 0                 ; slave no         kind                  log devno
37331 112724       0                 ; facility no      unused                phys devno
37332 112726       0                 ; devno or -1      devno or -1           first segment
37333 112728       0                 ; kind, type       unused                no of segments
37334 112730       5                 ; max outstanding operations
37335 112732  ;
37336 112732  p11: h23               ; first of disc buffer
37337 112734  p12: h24               ; last of disc buffer
37338 112736  p13: <:unknown <0>:>   ; device name table
37339 112742  p14: <:disc    <0>:>
37340 112748  p15: <:console <0>:>
37341 112754  p16: <:printer <0>:>
37342 112760  p17: <:tape    <0>:>
37343 112766  p20: <:gsd<0>:>
37344 112770  
37344 112770  ; createlink:
37345 112770  ; --------
37346 112770  ;
37347 112770  ; createlink <main> <device type> <devicename>.<device no> (<slave> <facility>)
37348 112770  ;
37349 112770  b. i5, j5  w.
37350 112770  i4=10                  ; size of one element in create link param list
37351 112770  i5= 8                  ; position of kind,modif in create link param list
37352 112770  
37352 112770  g112:                  ; create link
37353 112770                         ; begin
37354 112770       jl. w3     d15.   ;   next name; <* main process name *>
37355 112772       dl. w0    (v21.)  ;   <* move name to local save area *>
37356 112774       ds. w0     p9.+2  ;
37357 112776       dl. w0    (v23.)  ;
37358 112778       ds. w0     p9.+6  ;
37359 112780       jl. w3     d15.   ;   next_name;
37360 112782       dl. w0     (v21.) ;
37361 112784       rl. w1     i2.    ;
37362 112786       al  w1  x1-i4     ;
37363 112788  j0:  al  w1  x1+i4     ;   pointer:=next_from_list;
37364 112790       sl. w1     (i3.)  ;   if not end of list then
37365 112792       jl.        g2.    ;   begin
37366 112794       sn  w3  (x1)      ;     if param.name<>name.list then
37367 112796       se  w0  (x1+2)    ;
37368 112798       jl.        j0.    ;     goto next;
37369 112800       al. w2     p10.   ;
37370 112802       rl  w1  x1+i5     ;     else c_param.device_kind:=kind;
37371 112804       rs  w1  x2+6      ;          c_param.type:=type;
37372 112806                         ;   end else goto syntax error;
37373 112806       jl. w3     d15.   ;   next_name;
37374 112808       dl. w0    (v21.)  ;   <* move name to local save area *>
37375 112810       ds. w0     p9.-6  ;
37376 112812       dl. w0    (v23.)  ;
37377 112814       ds. w0     p9.-2  ;
37378 112816       jl. w3     d16.   ;   next_integer;
37379 112818       rs  w0  x2+4      ;   c_param.device_no:=param.device_no;
37380 112820       zl  w0  x2+6+0    ;
37381 112822       se  w0     18     ;   if tape or
37382 112824       sn  w0     6      ;      disc then
37383 112826       sz                ;
37384 112828       jl.        j3.    ;   begin
37385 112830                         ;
37386 112830       jl. w3     d16.   ;     c_param.slave:= param.slave;
37387 112832       rs  w0  x2+0      ;
37388 112834       jl. w3     d16.   ;     c_param.unit := param.slave;
37389 112836       am         2      ;   end else
37390 112838  j3:  rs  w0  x2+0      ;   c_param.kind:=param:=kind;
37391 112840       dl. w0     p9.-6  ;   move name to work
37392 112842       ds. w0    (v21.)  ;
37393 112844       dl. w0     p9.-2  ;
37394 112846       ds. w0    (v23.)  ;
37395 112848  
37395 112848       al. w1     p9.    ;
37396 112850       jl. w3     d51.   ;   create_link(main, c_param);
37397 112852       jl.        j1.    ;   +0: 
37398 112854                         ;   +2: if not error then
37399 112854       al. w3    (v20.)  ;
37400 112856                         ;
37401 112856       al  w1  x2        ;
37402 112858       jd         1<11+54;   create_peripheral_process(name,dev_no);
37403 112860       se  w0     0      ;   if result<>ok then
37404 112862       jl.        2      ;   no action
37405 112864       jl. w3     d19.   ;   begin  initwrite;
37406 112866       rl. w2     v51.   ;
37407 112868       rl  w1  x2+2      ;
37408 112870       ls  w1    +1      ;     link := 
37409 112872       wa  w1     b4     ;     name table(answer.devno);
37410 112874       rl  w2  x1        ;
37411 112876       al. w1     p13.   ;
37412 112878       rl  w0  x2        ;     text:=
37413 112880                         ;     device name table(answer.device kind);
37414 112880       sn  w0     q6     ;
37415 112882       al. w1     p14.   ;
37416 112884       sn  w0     q8     ;
37417 112886       al. w1     p15.   ;
37418 112888       sn  w0     q14    ;
37419 112890       al. w1     p16.   ;
37420 112892       sn  w0     q18    ;
37421 112894       al. w1     p17.   ;
37422 112896       sn  w0     q28    ;
37423 112898       al. w1     p20.   ;
37424 112900       jl. w3     d21.   ;     write(text);
37425 112902       rl  w1  x2+a67    ;
37426 112904       jl. w3     d22.   ;     writeinteger(link.slaveno);
37427 112906       rl  w1  x2+a68    ;
37428 112908       jl. w3     d22.   ;     writeinteger(link.unit);
37429 112910       al. w1     p2.    ;
37430 112912       jl. w3     d21.   ;     write(<:linked to:>);
37431 112914       am.       (v51.)  ;
37432 112916       rl  w1    +2      ;
37433 112918       jl. w3     d22.   ;     writeinteger(answer.devno);
37434 112920       jl.        j2.    ;   end
37435 112922  j1:                    ;   else begin
37436 112922       rl  w2     0      ;     <*save logical status*>
37437 112924       jl. w3     d19.   ;     initwrite;
37438 112926       al. w1     p1.    ;
37439 112928       jl. w3     d21.   ;     write(<:link error:>);
37440 112930       al  w1  x2        ;
37441 112932       jl. w3     d14.   ;     writebits(logical status);
37442 112934                         ;   end;
37443 112934  j2:                    ;
37444 112934       al  w0     10     ;
37445 112936       jl. w3     d20.   ;   writechar(nl);
37446 112938       jl. w3     d23.   ;   type line(buf);
37447 112940       jl. w3     d42.   ;   save work(buf);
37448 112942       am          0     ;   +0 ignore output error
37449 112944       jl.        g35.   ;   goto next command
37450 112946                         ;
37451 112946  i1:  0                 ;
37452 112948  i2:  h14               ;   start of name list
37453 112950  i3:  h15               ;   end of name list
37454 112952  e.                     ; end;
37455 112952  
37455 112952  
37455 112952  ; removelink:
37456 112952  ; -----------
37457 112952  ;                             *               *
37458 112952  ; removelink (<device number>) (<device name>)
37459 112952  ;                             0               0
37460 112952  
37460 112952  b.  i5, j5  w.
37461 112952  
37461 112952  g113:                  ; removelink
37462 112952       jl. w3     d2.    ;
37463 112954       sn  w0     0      ; if empty then
37464 112956       jl.        g35.   ; goto next param;
37465 112958       sn  w0     1      ; if next param=name then
37466 112960       jl.        j3.    ; goto find_devno else
37467 112962                         ; if next param <> integer then
37468 112962       se  w0     2      ;    goto exam command
37469 112964       jl.        g36.   ; else begin
37470 112966       rl. w0    (v19.)  ;   deviceno := read integer;
37471 112968  j0:  rl. w3     (v109. ;   save last read char
37472 112970       rs. w3    (v78.)  ;   in work;
37473 112972       jl. w3     d52.   ;   removelink(deviceno, logical status);
37474 112974       jl.        j4.    ;   +0: if  error then goto error
37475 112976       rl. w3     (v78.) ;   +2:     else test next;
37476 112978       se  w3     10     ;   if not end of line then
37477 112980       jl.        g113.  ;      goto get next param;
37478 112982       jl.        g35.   ;    else goto next command;
37479 112984  j4:
37480 112984       rl  w2     0      ;   error:
37481 112986       al. w1     p3.    ;   save error cause;
37482 112988       jl. w3     d21.   ;   writetext(<:removelink error:>;
37483 112990       al  w1  x2        ;
37484 112992       jl. w3     d14.   ;   writebits(logical status);
37485 112994  j2:  al  w0     10     ;
37486 112996       jl. w3     d20.   ;   writechar(nl);
37487 112998       jl. w3     d23.   ;   type line(buf);
37488 113000       jl. w3     d42.   ;   save work(buf);
37489 113002       jl.        g47.   ;   +0: if error then goto endline
37490 113004       jl.        g35.   ;   +2:    else goto next param
37491 113006                         ; end;
37492 113006  j3:  jl. w3     g123.  ; find_devno(name);
37493 113008       jl.        j2.    ; error: goto out line;
37494 113010       jl.        j0.    ; ok:    goto removelink
37495 113012  e.                     ; end;
37496 113012  
37496 113012  ; link logical disc
37497 113012  ; -----------------
37498 113012  ;
37499 113012  ; link <devno of phys. disc> <first segment> <no of segm.> (<devno of log. disc>)
37500 113012  ;
37501 113012  
37501 113012  b. i5, j5  w.
37502 113012  
37502 113012  g114:                  ; link
37503 113012       al. w2     p10.   ; begin
37504 113014       jl. w3     d16.   ;   param.physical disc devno := next integer;
37505 113016       rs  w0  x2+2      ;
37506 113018       jl. w3     d16.   ;   param.first segment := next integer;
37507 113020       rs  w0  x2+4      ;
37508 113022       jl. w3     d16.   ;   param.no of segments:= next integer;
37509 113024       rs  w0  x2+6      ;
37510 113026                         ;
37511 113026       jl. w3     d2.    ;   param.log-devno :=
37512 113028       rs. w0    (v78.)  ;   if next param = integer then
37513 113030       al  w1    -1      ;        integer
37514 113032       sn  w0     2      ;   else -1;
37515 113034       rl. w1    (v19.)  ;
37516 113036       rs  w1  x2+0      ;
37517 113038                         ;
37518 113038       jl. w3     d53.   ;   link(param, logical status, devno);
37519 113040       am         p4.-p5.;   +0: text := if error then <:link error:>
37520 113042       al. w1     p5.    ;   +2:                  else <:logical disc...:>;
37521 113044       rs. w0     i1.    ;
37522 113046       jl. w3     d21.   ;   writetext(text);
37523 113048       rl. w1     i1.    ;
37524 113050       se  w1     1<1    ;   if logical status = ok then
37525 113052       jl.        j1.    ;        writeinteger(devno)
37526 113054       al  w1  x2        ;   else writebits(logical status);
37527 113056       jl. w3     d22.   ;
37528 113058       sz                ;
37529 113060  j1:  jl. w3     d14.   ;
37530 113062       al  w0     10     ;   
37531 113064       jl. w3     d20.   ;   writechar(nl);
37532 113066       jl. w3     d23.   ;   typeline(buf);
37533 113068       jl. w3     d42.   ;   save work(buf);
37534 113070       jl.        g47.   ;   +0: if error then goto end line
37535 113072       rl. w0    (v78.)  ;   +2:          else <get type of last read param>;
37536 113074       sn  w0     2      ;   if last read param = integer then 
37537 113076       jl.        g35.   ;   goto next command
37538 113078       jl.        g36.   ;   else goto exam command;
37539 113080                         ;
37540 113080  i1:  0                 ;
37541 113082  e.                     ; end;
37542 113082  
37542 113082  
37542 113082  ; unlink logical disc
37543 113082  ; -------------------
37544 113082  ;                          *
37545 113082  ; unlink (<device number>)
37546 113082  ;                          0
37547 113082  
37547 113082  b.  i5, j5  w.
37548 113082  j0:  jl. w3     d19.   ; init write
37549 113084  g115:                  ; unlink
37550 113084       jl. w3     d2.    ; if next param <> integer then
37551 113086       se  w0     2      ;    goto exam command
37552 113088       jl.        g36.   ; else begin
37553 113090       rl. w0    (v19.)  ;   devno := read integer;
37554 113092       jl. w3     d54.   ;   unlink(devno);
37555 113094       sz                ;   +0: if error then goto error
37556 113096       jl.        g115.  ;   +2: else goto unlink;
37557 113098                         ;   error:
37558 113098       al  w2  x1        ;
37559 113100       al. w1     p6.    ;
37560 113102       jl. w3     d21.   ;   writetext(<:unlink error:>);
37561 113104       al  w1  x2        ;
37562 113106       jl. w3     d14.   ;   writebits(logical status);
37563 113108       al  w0     10     ;
37564 113110       jl. w3     d20.   ;   writechar(nl);
37565 113112       jl. w3     d23.   ;   typeline(buf);
37566 113114       jl. w3     d42.   ;   save work(buf);
37567 113116       jl.        g47.   ;   +0: if error then goto endline
37568 113118       jl.        j0.    ;   +2: else goto next unlink;
37569 113120                         ;
37570 113120  e.                     ; end;
37571 113120  z.
37572 113120  ;
37573 113120  m.
37573 113120                 step 2

37574 113120  ;
37575 113120  ; stepping stones
37576 113120  ;
37577 113120  
37577 113120  jl.   (2) ,  l2 ,  d2 = k-4
37578 113124  jl.   (2) ,  l15,  d15= k-4
37579 113128  jl.   (2) ,  l16,  d16= k-4
37580 113132  jl.   (2) ,  l34,  d34= k-4
37581 113136  jl.   (2) ,  l39,  d39= k-4
37582 113140  jl.   (2) ,  l42,  d42= k-4
37583 113144  jl.   (2) ,  l46,  d46= k-4
37584 113148  jl.   (2) ,  l61,  d61= k-4
37585 113152  jl.   (2) ,  l74,  d74= k-4
37586 113156  jl.   (2) ,  l77,  d77= k-4
37587 113160  jl.   (2) ,  l78,  d78= k-4
37588 113164  jl.   (2) ,  g2,   g2 = k-4
37589 113168  jl.   (2) ,  g11,  g11= k-4
37590 113172  jl.   (2) ,  g12,  g12= k-4
37591 113176  jl.   (2) ,  g13,  g13= k-4
37592 113180  jl.   (2) ,  g15,  g15= k-4
37593 113184  jl.   (2) ,  g35,  g35= k-4
37594 113188  jl.   (2),  g111, g111= k-4
37595 113192  c.(:a80>16a.1:)-1      
37596 113192  
37596 113192  ; linkall
37597 113192  ; -------
37598 113192  ;
37599 113192  ; linkall <devno of phys. disc> / <name of phys. disc>
37600 113192  ;
37601 113192  
37601 113192  b.  i5, j15  w.
37602 113192  
37602 113192  g116:                  ; linkall <main entrypoint>
37603 113192       jl. w3     d2.    ;
37604 113194       sn  w0     1      ; if next param=name then
37605 113196       jl.        j11.   ; goto find_devno else
37606 113198                         ; if next param <> integer then
37607 113198       se  w0     2      ;    goto exam command
37608 113200       jl.        g36.   ; else begin
37609 113202       rl. w0    (v19.)  ;   deviceno := read integer;
37610 113204  j0:  al  w3     0      ; execute reentrant code := false;
37611 113206       rs. w3    (v89.)  ; <nessesary as kiton is called>
37612 113208       al. w3     g35.   ; <return address := next command>
37613 113210                         ;
37614 113210  g118:                  ; linkall <2nd entrypoint>
37615 113210       rs. w3    (v83.)  ; begin
37616 113212       rs. w0    (v101.) ;   w0: devno of link
37617 113214       rs. w0    (v102.) ;   w3: link
37618 113216       rl  w1     0      ;
37619 113218       jl. w3     d56.   ;   check device(devno);
37620 113220       jl.        j9.    ;   +0: if error or
37621 113222       sn  w0     6      ;   +2: not (kind of device = idadisc and 
37622 113224       se  w3     0      ;            type of device = physical disc) then
37623 113226       jl.        j9.    ;       goto <illegal devno>;
37624 113228                         ;
37625 113228       rl. w1    (v24.)  ;
37626 113230       rs. w1    (v104.) ;   user of buffer := current work;
37627 113232       rl. w1    (v101.) ;
37628 113234       al  w0     0      ;
37629 113236       jl. w3     d55.   ;   read segment(0,devno of readdevice);
37630 113238       jl.        j10.   ;   +0: if error then goto disc error;
37631 113240                         ;   +2:
37632 113240       rl. w1     p11.   ;   pointer :=
37633 113242       rl  w2  x1+0      ;   (buffer.no of files * 2 + 1) * 2;
37634 113244       ls  w2    +1      ;
37635 113246       al  w2  x2+1      ;
37636 113248       ls  w2    +1      ;
37637 113250       am      x1        ;   pointer :=
37638 113252       al  w2  x2+2      ;   pointer + buffer.start + 2; <skip 'no of log discs'>
37639 113254       rs. w2    (v103.) ;
37640 113256       sl. w2    (p11.)  ;   if not pointer within buffer then goto finis;
37641 113258       sl. w2    (p12.)  ;      <*uninitialized description*>
37642 113260       jl.        j7.    ;
37643 113262       zl  w0  x2-2      ;   size of log disc description :=
37644 113264       sn  w0     0      ;   if buffer(pointer - 2)=0 then default size 
37645 113266       al  w0     p0     ;   else
37646 113268       rs. w0    (v105.) ;   buffer(pointer - 2);
37647 113270                         ;
37648 113270  j3:  jl. w3     d19.   ;   while true do
37649 113272       rl. w0    (v24.)  ;   begin
37650 113274       sn. w0    (v104.) ;     init write;
37651 113276       jl.        j4.    ;
37652 113278       rs. w0    (v104.) ;     if user of buffer <> current work then
37653 113280       al  w0     0      ;     begin  user of buffer := current work;
37654 113282       rl. w1    (v101.) ;
37655 113284       jl. w3     d55.   ;       read segment(0, devno of read device);
37656 113286       jl.        j10.   ;       +0: if error then goto disc error;
37657 113288       rl. w2    (v103.) ;       +2:
37658 113290                         ;     end;
37659 113290  j4:                    ;
37660 113290       dl  w0  x2+2      ;     if buffer(pointer).first segment = -1 then
37661 113292       sn  w3    -1      ;     goto finis;
37662 113294       jl.        j7.    ;
37663 113296       ds. w0     p10.+6 ;     param.first segment := buffer(pointer+0);
37664 113298                         ;     param.no of segments:= buffer(pointer+2);
37665 113298       el  w3  x2+5      ;     param.log devno := buffer(pointer+5);
37666 113300       rl. w0    (v102.) ;     param.phys devno:= devno;
37667 113302       ds. w0     p10.+2 ;
37668 113304       al. w2     p10.   ;
37669 113306       jl. w3     d53.   ;     link(param, devno);
37670 113308       jl.        j1.    ;     +0: if error then goto linkerror;
37671 113310       rl. w1    (v103.) ;     +2: 
37672 113312       zl  w1  x1+4      ;
37673 113314       ls  w1    -1      ;     if buffer (pointer).type = rc8000 catalog and
37674 113316       rl. w3    (v12.)  ;        kiton-command still valid then
37675 113318       rl  w3  x3        ;
37676 113320       sn  w1     1      ;        kiton(devno)
37677 113322       sn  w3     0      ;
37678 113324       jl.        j2.    ;
37679 113326       jl. w3    (i2.)   ;
37680 113328       jl.        j6.    ;     else
37681 113330  j1:  am         p4-p5  ;     begin
37682 113332  j2:  al. w1     p5.    ;       text := if linkerror then <:link error:>
37683 113334       rs. w0     i1.    ;                            else <:logical disc..:>;
37684 113336       jl. w3     d21.   ;       write(text);
37685 113338       rl. w1     i1.    ;
37686 113340       se  w1     1<1    ;       if logical status = ok then
37687 113342       jl.        j5.    ;       begin
37688 113344       rl. w1    (v54.)  ;         if answer.first segment = 0 then
37689 113346       sn  w1     0      ;            devno of read device := devno;
37690 113348       rs. w2    (v101.) ;
37691 113350       al  w1  x2        ;
37692 113352       jl. w3     d22.   ;         writeinteger(devno);
37693 113354       sz                ;       end
37694 113356  j5:  jl. w3     d14.   ;       else writebits(logical status);
37695 113358       al  w0     10     ;
37696 113360       jl. w3     d20.   ;       writechar(nl);
37697 113362       jl. w3     d23.   ;       typeline(buf);
37698 113364       jl. w3     d42.   ;       save work(buf);
37699 113366       am         0      ;       +0: error:
37700 113368                         ;       +2:
37701 113368  j6:                    ;     end;
37702 113368       rl. w2    (v103.) ;
37703 113370       wa. w2    (v105.) ;     pointer := pointer + size of log disc descrp;
37704 113372       rs. w2    (v103.) ;
37705 113374       jl.        j3.    ;   end ***while true do***;
37706 113376                         ;
37707 113376  j7:                    ;   finis:
37708 113376       rl. w3    (v83.)  ;   return;
37709 113378       jl      x3        ;
37710 113380                         ;
37711 113380  j9:                    ;   illegal devno:
37712 113380       al. w1     p8.    ;   writetext(<illegal devno>);
37713 113382       jl. w3     d21.   ;
37714 113384       jl.        j8.    ;   goto writebuf;
37715 113386                         ;
37716 113386  j10:                   ;   disc error:
37717 113386       al  w2  x1        ;
37718 113388       al. w1     p7.    ;
37719 113390       jl. w3     d21.   ;   write(<:disc error:>);
37720 113392       al  w1  x2        ;
37721 113394       jl. w3     d14.   ;   writebits(logical status);
37722 113396  j8:  al  w0     10     ;   writebuf:
37723 113398       jl. w3     d20.   ;   writechar(nl);
37724 113400       jl. w3     d23.   ;   typeline(buf);
37725 113402       jl. w3     d42.   ;   save work(buf);
37726 113404       am         0      ;   +0: 
37727 113406       jl.        j7.    ;   +2: goto finis;
37728 113408                         ; end;
37729 113408  j11:
37730 113408       al. w3     g35.   ; <return address := next command>
37731 113410       rs. w3    (v83.)  ; used at error return
37732 113412       jl. w3     g127.  ; find_devno;
37733 113414       jl.        j8.    ; error: goto out line;
37734 113416       jl.        j0.    ; ok:    goto linkall
37735 113418                         ;
37736 113418  i1:  0                 ;
37737 113420  i2:  0                 ;   kiton entry point
37738 113422  b135 = i2              ;   <initialized in init part of the next slang segm.>
37739 113422                         ;
37740 113422  e.                     ;
37741 113422                         ;
37742 113422  
37742 113422  
37742 113422  ; initkit
37743 113422  ; -------
37744 113422  ;
37745 113422  ;                                                                    *
37746 113422  ; initkit <devno of physical device> (<size> <devno of logical disc>)
37747 113422  ;                                                                    0
37748 113422  
37748 113422  b.  i5, j10  w.
37749 113422  
37749 113422  g117:                  ; initkit
37750 113422       jl. w3     d16.   ; begin
37751 113424       rs. w0    (v102.) ;   physical disc := next integer;
37752 113426       rl  w1     0      ;
37753 113428       jl. w3     d56.   ;   check device(physical disc);
37754 113430       jl.        g16.   ;   +0: if error or
37755 113432       sn  w0     6      ;   +2: not (kind of device = idadisc and
37756 113434       se  w3     0      ;            type of device = physical disc) then
37757 113436       jl.        g16.   ;       goto <device unknown>;
37758 113438                         ;
37759 113438       rl. w0    (v24.)  ;   user of buffer := current work;
37760 113440       rs. w0    (v104.) ;   
37761 113442                         ;
37762 113442       al  w0    -1      ;   clear the buffer:
37763 113444       rl. w1     p11.   ;   for i := buffer.first step 2 until buffer.top do
37764 113446  j1:  rs  w0  x1+0      ;   buffer(i) := -1;
37765 113448       al  w1  x1+2      ;
37766 113450       sh. w1    (p12.)  ;
37767 113452       jl.        j1.    ;
37768 113454                         ;
37769 113454       rl. w1     p11.   ; init buffer:
37770 113456       rl. w2     i3.    ;   displace := 0;
37771 113458  j2:  rl  w0  x2+0      ;   while more in default desc do
37772 113460       rs  w0  x1+0      ;   begin
37773 113462       al  w1  x1+2      ;     buffer(buffer.first+displace) :=
37774 113464       al  w2  x2+2      ;     default(default.start+displace);
37775 113466       se. w2    (i4.)   ;     displace := displace + 2;
37776 113468       jl.        j2.    ;   end;
37777 113470                         ;
37778 113470       rl. w1     p11.   ;   displace :=
37779 113472       rl  w2  x1+0      ;   (buffer.no of files * 2 + 1) * 2;
37780 113474       ls  w2    +1      ;
37781 113476       al  w2  x2+1      ;
37782 113478       ls  w2    +1      ;
37783 113480       am      x1        ;   pointer := buffer.start + displace;
37784 113482       al  w2  x2        ;
37785 113484       rs. w2    (v103.) ;   <save pointer to 'no of log discs'>
37786 113486       zl  w1  x2+1      ;   no of log disc := buffer.no of log discs;
37787 113488       al  w2  x2+2      ;   pointer :=
37788 113490       al  w0     p0     ;   pointer + 2 + (no of log discs * size of descrip);
37789 113492       wm  w0     2      ;
37790 113494       wa  w2     0      ;
37791 113496                         ;
37792 113496  j3:  jl. w3     d2.    ;
37793 113498       se  w0     2      ;   while next param = integer do
37794 113500       jl.        j4.    ;   begin
37795 113502       rl. w0    (v19.)  ;     cur desc := buffer(pointer);
37796 113504       rs  w0  x2+2      ;     cur desc.no of segments := integer;
37797 113506       al  w0     0      ;     cur desc.first segment :=
37798 113508       se  w1     0      ;     if no of log discs = 0 then 0
37799 113510       rl  w0  x2-p0     ;     else
37800 113512       se  w1     0      ;     prev desc.first segment +
37801 113514       wa  w0  x2-p0+2   ;     prev desc.no of segments;
37802 113516       rs  w0  x2+0      ;
37803 113518       jl. w3     d16.   ;     cur desc.type := data_disc,
37804 113520       ls  w0    +12     ;                      include sender as user;
37805 113522       ls  w0    -12     ;     cur desc.rc8000devno := next integer;
37806 113524       rs  w0  x2+4      ;
37807 113526       al  w1  x1+1      ;     no of log discs := no of log discs + 1;
37808 113528       al  w2  x2+p0     ;     pointer := pointer + size of descrip;
37809 113530       jl.        j3.    ;   end <*.while *>;
37810 113532                         ;
37811 113532  j4:                    ;
37812 113532       rl. w2    (v103.) ;   buffer.no of log disc := no of log discs;
37813 113534       hs  w1  x2+1      ;
37814 113536       al  w1     p0     ;   buffer.size of log disc descrp := size of disc descr;
37815 113538       hs  w1  x2+0      ;
37816 113540       rs. w0    (v78.)  ;   <save kind of param>
37817 113542       al  w0     0      ;
37818 113544       rl. w1    (v102.) ;
37819 113546       jl. w3     d57.   ;   write segment(0, device no);
37820 113548       jl.        j5.    ;   +0: if error then goto disc error
37821 113550       rl. w0    (v78.)  ;   +2: else goto exam command
37822 113552       jl.        g36.   ;       <with restored param type>
37823 113554                         ;
37824 113554  j5:                    ; disc error:
37825 113554       rl  w2     0      ;
37826 113556       al. w1     p7.    ;
37827 113558       jl. w3     d21.   ;   write text(:disc error:);
37828 113560       al  w1  x2        ;
37829 113562       jl. w3     d14.   ;   writebits(logical status);
37830 113564       al  w0     10     ;
37831 113566       jl. w3     d20.   ;   writechar(nl);
37832 113568       jl. w3     d23.   ;   type line(buf);
37833 113570       jl. w3     d42.   ;   save work(buf);
37834 113572       jl.        g47.   ;   +0: if error then goto endline
37835 113574       rl. w0    (v78.)  ;   +2: else goto exam command;
37836 113576       jl.        g36.   ;       <with restored param type>
37837 113578                         ;
37838 113578  i3:  h25               ;
37839 113580  i4:  h26               ;
37840 113582  e.                     ; end;
37841 113582                         ;
37842 113582  ; find devno
37843 113582  ;
37844 113582  ; reg  call    return ok     return not ok
37845 113582  ; w0            devno        undef
37846 113582  ; w1            unchanged      -
37847 113582  ; w2            unchanged      -
37848 113582  ; w3  link      unchanged      -
37849 113582  ;
37850 113582  ; return:
37851 113582  ; link+2        ok: device with kind 6,8,14,18 or 28 found
37852 113582  ; link+0   not  ok: an error text is written in the output buffer
37853 113582  ;                   if the device is not found
37854 113582  b. j5,i5 w.
37855 113582  
37855 113582  i0:<:  unknown<0>:>
37856 113590  i1:<:  illegal kind<0>:>
37857 113600  i4=k+4
37858 113600  i2:<:removelink error <0>:>
37859 113612  i3:  0                 ; return
37860 113614  i5:  0                 ; text address
37861 113616  
37861 113616  g123:am         i2-i4  ;
37862 113618  g127:al. w0     i4.    ;
37863 113620       ds. w0     i5.    ;
37864 113622       rl. w3     v20.   ;
37865 113624       jd         1<11+4 ; process_description(name,pda);
37866 113626       sn  w0     0      ;
37867 113628       jl.        j2.    ; goto unknown;
37868 113630       rl  w3     (0)    ;
37869 113632       se  w3     q6     ;  if proc<>disc    and
37870 113634       sn  w3     q8     ;     proc<>console and
37871 113636       jl.        j0.    ;
37872 113638       se  w3     q14    ;     proc<>printer and
37873 113640       sn  w3     q18    ;     proc<>tape    and
37874 113642       jl.        j0.    ;
37875 113644       se  w3     q28    ;     proc<>gsd then
37876 113646       jl.        j1.    ;  goto illegal kind else
37877 113648  j0:  am         (0)    ;  devno:=devno.proc;
37878 113650       rl  w0       +a59 ;
37879 113652       rl. w3     i3.    ;
37880 113654       jl      x3+2      ; return;
37881 113656  j2:  am         i0-i1  ;
37882 113658  j1:  al. w2     i1.    ;
37883 113660       rl. w1     i5.    ;
37884 113662       jl. w3     d21.   ; write(remove link error);
37885 113664       rl. w1     v20.   ;
37886 113666       jl. w3     d21.   ; write_text(name);
37887 113668       al  w1  x2        ;
37888 113670       jl. w3     d21.   ; write(unknown/illegal devno);
37889 113672       jl. w3    (i3.)   ; return sorry;
37890 113674  
37890 113674  e.
37891 113674  
37891 113674  ;
37892 113674  c.(:a399>21a.1:)-1
37893 113674  ; prepare dump <name> <low.first> <low.last> <high.first> <high.last>
37894 113674  b. i0,j0 w.
37895 113674  i0:<:prepare dump error<0>:>;
37896 113674  
37896 113674  g121: jl. w3     d15.   ; next name
37897 113674        dl. w0     (v21.) ;
37898 113674        ds. w0     p9.+2  ; move_name(param_list,name area);
37899 113674        dl. w0     (v23.) ;
37900 113674        ds. w0     p9.+6  ;
37901 113674        al. w1     p10.   ;
37902 113674        jl. w3     d16.   ; next integer;
37903 113674        rs  w0  x1+0      ; low.first:=next integer
37904 113674        jl. w0     d16.   ;
37905 113674        rs  w0  x1+2      ; low.last:=next integer
37906 113674        ea  w0     1      ;
37907 113674        sh  w0  (x1+0)    ; if low.first>low.last then
37908 113674        jl.        g47.   ; goto endline;
37909 113674        jl. w3     d16.   ; next integer;
37910 113674        rs  w0  x1+4      ; high.first:=next integetr
37911 113674        jl. w0     d16.   ;
37912 113674        rs  w0  x1+6      ; high.last:=next integer
37913 113674        ea  w0     1      ;
37914 113674        sh  w0  (x1+4)    ; if high.first>high.last then
37915 113674        jl.        g47.   ; goto endline;
37916 113674        al. w3     p9.    ;
37917 113674        jd         1<11+52; create area process;
37918 113674        jd         1<11+4 ; process description;
37919 113674        sh  w0     0      ; if no process then
37920 113674        jl.        g47.   ; goto end line
37921 113674        rl  w1     0      ;
37922 113674        al. w2     p10.   ;
37923 113674        jl. w3     d58.   ; prepare_dump(pda_ext/area_proc,address_buff);
37924 113674        jl.        j0.    ; error: goto write text;
37925 113674        jl.        g35.   ; goto next command
37926 113674  j0:   al. w1     i0.    ;
37927 113674        jl. w3     d21.   ; write_text;
37928 113674        al  w0     10     ;
37929 113674        jl. w3     d20.   ; write(nl);
37930 113674        jl. w3     d23.   ; type_line;
37931 113674        jl. w3     d42.   ; save_buffer;
37932 113674        jl.        g47.   ; error: goto end line
37933 113674        jl.        g35.   ; goto next command
37934 113674  e.
37935 113674  ;
37936 113674  ; memory dump
37937 113674  ;
37938 113674  b. j2 ,i5 w.
37939 113674  i3:<:prepare dump not performed <0>:>
37940 113674  i4:<:dump memory status <0>:>
37941 113674  i5:<:prepare dump status <0>:>
37942 113674  g122: rl. w2    (v106.) ;
37943 113674        sn  w0     0      ;
37944 113674        jl.        j0.    ; goto prepare dump not performed
37945 113674        rl  w2  x2+a141   ;
37946 113674        sh  w2     0      ;
37947 113674        ac  w2     x2     ;
37948 113674        al. w3     p9.    ;
37949 113674        dl  w1  x2+a11+2  ;
37950 113674        ds  w1  x3+2      ; move_name(receiver_name,name area);
37951 113674        dl  w1  x2+a11+6  ;
37952 113674        ds  w1  x3+6      ;
37953 113674        rl. w1     v32.   ;
37954 113674        al  w0     0      ;
37955 113674        hs  w0  x1+0      ; mess.op:=0;
37956 113674        jd         1<11+16;
37957 113674        rl. w1     v51.   ;
37958 113674        jd         1<11+18;
37959 113674        rl. w2    (v51.)  ;
37960 113674        sn  w0       1    ; if result<>1
37961 113674        se  w2       0    ; or status(answer)<>0 then
37962 113674        jl.         j1.   ; give up: dump error
37963 113674        al  w2     0      ;
37964 113674        rx. w2    (v106.) ;
37965 113674        jd     1<11+18    ; wait answer(buf,answer,result);
37966 113674        rl. w2    (v51.)  ;
37967 113674        sn  w0       1    ; if result<>1
37968 113674        se  w2       0    ; or status(answer)<>0 then
37969 113674        jl.         j2.   ; give up: prepare dump error
37970 113674        jl.        g35.   ; goto next command;
37971 113674  j0:   am         i3-i4  ;
37972 113674  j1:   am         i4-i5  ; prepare dump error:
37973 113674  j2:   al. w1     i5.    ; dump error:
37974 113674        al  w2     1      ;
37975 113674        ls  w2     (0)    ;
37976 113674        sn  w2     1<1    ; if result<>1 then
37977 113674        lo. w2     (v51.) ; status:=answer.status + 1 shift result;
37978 113674        jl. w3     d21.   ; write_text;
37979 113674        al  w1  x2        ;
37980 113674        sz  w1     2.111111;if answer result then
37981 113674        jl. w3     d14.   ; write status;
37982 113674        al  w0     10     ;
37983 113674        jl. w3     d20.   ; write(nl);
37984 113674        jl. w3     d23.   ; type_line;
37985 113674        jl. w3     d42.   ; save_buffer;
37986 113674        jl.        g47.   ; error: goto end line
37987 113674        jl.        g35.   ; goto next command;
37988 113674  e.                      ;
37989 113674  z.
37990 113674  c.-(:a399>21a.1:)
37991 113674  g121:
37992 113674  g122: jl.        g2.    ;
37993 113676  z.
37994 113676  e.                     ; end of itc controller command block
37995 113676  
37995 113676  z.
37996 113676  c.-(:a80>16a.1:)       ; if not itc devices included then
37997 113676  g112:                  ;
37998 113676  g113:                  ;
37999 113676  g114:                  ;
38000 113676  g115:                  ;
38001 113676  g116:                  ;
38002 113676  g117:                  ;
38003 113676  g118:                  ;
38004 113676  g121:                  ;
38005 113676  g122:                  ;
38006 113676        jl.        g2.   ; goto endline;
38007 113676  z.                     ;
38008 113676  
38008 113676  ;
38009 113676  m.
38009 113676              v  block

38010 113676  ; indirect adressing of all e-names
38011 113676  ;
38012 113676  v2:  e2
38013 113678  v3:  e3
38014 113680  v12: e12
38015 113682  v16: e16
38016 113684  v19: e19
38017 113686  v20: e20 
38018 113688  v21: e21
38019 113690  v23: e23
38020 113692  v24: e24
38021 113694  v25: e25
38022 113696  v29: e29
38023 113698  v30: e30
38024 113700  v32: e32
38025 113702  v35: e35
38026 113704  v37: e37
38027 113706  v38: e38
38028 113708  v44: e44
38029 113710  v46: e46
38030 113712  v47: e47
38031 113714  v49: e49
38032 113716  v50: e50
38033 113718  v51: e51
38034 113720  v52: e52
38035 113722  v54: e54
38036 113724  v56: e56
38037 113726  v58: e58
38038 113728  v59: e59
38039 113730  v67: e67
38040 113732  v70: e70
38041 113734  v71: e71
38042 113736  v72: e72
38043 113738  v77: e77
38044 113740  v78: e78
38045 113742  v79: e79
38046 113744  v83: e83
38047 113746  v85: e85
38048 113748  v87: e87
38049 113750  v89: e89
38050 113752  v101: e101
38051 113754  v102: e102
38052 113756  v103: e103
38053 113758  v104: e104
38054 113760  v105: e105
38055 113762  c.(:a399>21a.1:)-1
38056 113762  v106: e106
38057 113762  z.
38058 113762  v109: e109
38059 113764  
38059 113764  
38059 113764  b.i24 w.                 ; dump:
38060 113764                           ; ---------
38061 113764  g79:                     ;
38062 113764       jl. w3      d15.    ;   next name;
38063 113766       jl. w3     d34.     ;   check child;
38064 113768       dl  w1  x2+a43      ; get catbase of pr descr(child)
38065 113770       al. w3      i1.     ; name=0
38066 113772       jd     1<11+72      ; catbase(s)=catbase(child)
38067 113774       se  w0       0      ; if not ok then
38068 113776       jl.        g19.     ; goto end line: base illegal
38069 113778       rl. w3     v20.     ; name adr
38070 113780       jd     1<11+52      ; create area process(name)
38071 113782       al. w3     i1.      ; (prevent remove process(name))
38072 113784       sn  w0       2      ; if result=2 or
38073 113786       jl.        i10.     ;
38074 113788       sl  w0       2      ; result>2 then 
38075 113790       jl.        i11.     ; goto give up
38076 113792       rl. w3     v20.     ;
38077 113794       jd      1<11+8      ;   reserve process(name,result);
38078 113796       se  w0       0      ;   if result<>0 then
38079 113798       jl.         i12.    ;   goto give up;
38080 113800       jl. w3     d39.     ;   stop child;
38081 113802       rl. w2    (v29.)    ;
38082 113804       al  w1     0        ;
38083 113806       am.        e46.+2000;
38084 113808       rs  w1       +2-2000; segmentno(mess)=0
38085 113810       rl  w1  x2+a182     ; load base (child)
38086 113812       dl  w3  x2+a18      ;
38087 113814       wa  w2     2        ; add base
38088 113816       wa  w3     2        ; 
38089 113818       al  w3  x3  -2      ;   line addr:= first addr(child);
38090 113820       ds. w3    (v46.)    ;   write addr:= top addr(child)-2;
38091 113822       rl. w3     v20.     ;
38092 113824       rl. w1     v44.     ;
38093 113826       jd     1<11+16      ;   send mess(name,output,buf);
38094 113828       rl. w1     v51.     ;
38095 113830       jd     1<11+18      ;   wait answer(buf,answer,result);
38096 113832       rl. w2    (v51.)    ;
38097 113834       sn  w0       1      ;   if result<>1
38098 113836       se  w2       0      ;   or status(answer)<>0 then
38099 113838       jl.         i9.     ; give up: area error
38100 113840       jd     1<11+42      ; lookup entry (area)
38101 113842       se  w0     0        ; if not ok then
38102 113844       jl.         i9.     ; goto area error
38103 113846       al  w0     7        ; else
38104 113848       hs. w0    (v59.)    ; contents key(area):= core dump
38105 113850       jd     1<11+36      ; get clock
38106 113852       ld  w1     5        ;
38107 113854       rs. w0    (v56.)    ; set shortclock(area)
38108 113856       rl. w1     v51.     ;
38109 113858       jd     1<11+44      ; change entry
38110 113860       se  w0     0        ; if not ok then 
38111 113862   i9: am     g15-g35      ; give up: area error
38112 113864       am     g35-g11      ; goto next command
38113 113866  i10: am     g11-g12      ; give up: catalog error
38114 113868  i11: am     g12-g13      ;  - - - : area unknown
38115 113870  i12: am       -2000      ;  - - - : area reserved
38116 113872       al. w2    g13.+2000 ;
38117 113874       jd     1<11+64      ; remove area process
38118 113876       al. w3      i1.     ;
38119 113878       dl. w1      i2.     ;
38120 113880       jd     1<11+72      ; reset catalogbase(s)
38121 113882       jl      x2+  0      ; exit , 
38122 113884  
38122 113884   i1: 0
38123 113886       a107
38124 113888   i2: a108-1
38125 113890  e.
38126 113890  
38126 113890  b. i4
38127 113890  w.                     ;
38128 113890  ; command syntax:  user <lower> <upper>
38129 113890  ;                  --------------------
38130 113890  ; command syntax:  login <lower> <upper>
38131 113890  ;                  --------------------
38132 113890  ; command syntax:  project <lower> <upper>
38133 113890  ;                  ----------------------
38134 113890  g86: am         c43-c42; user: update userbase;
38135 113892  g82: am         c42-c41; login: update loginbase;
38136 113894  g80: al  w2  x1+c41    ; project: update projectbase;
38137 113896       jl. w3     d16.   ; next integer
38138 113898       rs  w0  x2+0      ; lower := integer;
38139 113900       jl. w3     d16.   ; next integer
38140 113902       rs  w0  x2+2      ; upper := integer;
38141 113904       jl.        g35.   ; next command
38142 113906  e.
38143 113906  
38143 113906  
38143 113906  b.i12 w.                ; bs:
38144 113906                          ; --------
38145 113906  i2:  dl. w2    (v21.)    ;
38146 113908       ds. w2      i4.     ;
38147 113910       dl. w2    (v23.)    ;
38148 113912       ds. w2      i5.     ;
38149 113914       jl      x3          ;
38150 113916  g81: jl. w3     d34.     ; check child
38151 113918       jl. w3     d15.     ;
38152 113920       jl. w3      i2.     ;
38153 113922       jl. w3     d16.     ; next integer
38154 113924  i0:  rs. w0    (v52.)    ; more:
38155 113926       jl. w3     d16.     ; next integer
38156 113928       rs. w0    (v51.)    ;
38157 113930       dl. w0    (v52.)    ;
38158 113932       am.       (v51.)    ;
38159 113934       al  w1     +a110*4; index:= claim list end
38160 113936  i1:  ds  w0  x1  +2      ; repeat begin
38161 113938       al  w1  x1  -4      ; claimlist(index):=claimchange
38162 113940       se. w1    (v51.)    ; index:= index-4
38163 113942       jl.         i1.     ; until index = claim list start
38164 113944       al. w2      i3.     ;
38165 113946       rl. w3    (v25.)    ;
38166 113948       al  w3  x3+c29      ; w3 = process name(console)
38167 113950       jd     1<11+78      ; set bs claims
38168 113952       sn  w0       1      ; if result = 1
38169 113954       jl.        g20.     ; then goto end line
38170 113956       se  w0       0      ; if result <> 0
38171 113958       jl.        g21.     ; then goto end line
38172 113960       jl.        g35.     ; then goto exam command
38173 113962  
38173 113962  ; command syntax:  temp <docname> <segments> <entries>
38174 113962  ;                  ------------------------------------
38175 113962  g84:                   ; temp:
38176 113962       am         c45-c47;   (update temp claims)
38177 113964  
38177 113964  ; command syntax:  perm <docname> <segments> <entries>
38178 113964  ;                  -------------------------------------
38179 113964  g85:                   ; perm:
38180 113964       al  w3     c47    ;   (update perm claims)
38181 113966       wa. w3    (v25.)  ;
38182 113968       rs. w3     i6.    ;   save abs addr of claim;
38183 113970  
38183 113970       jl. w3     d15.     ;
38184 113972       jl. w3      i2.     ;
38185 113974       jl. w3     d16.     ; get segments
38186 113976       rs. w0    (v52.)    ;
38187 113978       jl. w3     d16.     ; get entries
38188 113980       rs. w0    (v51.)    ;
38189 113982       al. w2      i3.     ; name adr.
38190 113984       jl. w3     d61.     ; get devno*8
38191 113986       jl.        g16.     ; sorry goto end line
38192 113988       dl. w1    (v52.)    ;
38193 113990       am.       (i6.)     ; update segments and entries;
38194 113992       ds  w1  x2          ;
38195 113994       jl.        g35.     ; next command
38196 113996  i3:0
38197 113998  i4:0
38198 114000     0
38199 114002  i5:0
38200 114004  i6:0                     ; abs addr of claim (in console descr)
38201 114006  e.
38202 114006  b.i40,j10
38203 114006  w.
38204 114006  c.(:c23>14a.1:)-1
38205 114006  g96 = k                ; get:
38206 114006                         ; --------------
38207 114006       al  w0        1   ; increase access indicator := true;
38208 114008       rs. w0    (v77.)  ;
38209 114010            am -1        ;
38210 114012  g89 = k                ; job:
38211 114012                         ; --------------
38212 114012       al  w0  0         ; set startflag
38213 114014       rs. w0  i16.      ;
38214 114016       al  w3  0         ;
38215 114018       rs  w3  x1+c95+2  ; clear primin and primout
38216 114020       rs  w3  x1+c96+2  ;
38217 114022       jl. w3     d46.   ;   clear claimlist;
38218 114024       jl. w3     d15.   ; get jobname
38219 114026       al  w1       0    ; then get segment(0)
38220 114028       rl. w2    (v70.)  ;
38221 114030       jl. w3     d77.   ;
38222 114032       rl. w1    (v70.)  ;
38223 114034       rl  w3  x1+6      ; get no. of segments
38224 114036       rs. w3     i14.   ;
38225 114038       rl  w1  x1  +2      ;
38226 114040       rs. w1     i12.     ;
38227 114042       al  w2       0      ; find number of
38228 114044       al  w3     512      ; entries in one
38229 114046       wd  w3       2      ; susercatentry
38230 114048       al  w3  x2-510      ; w3 := last used in segment;
38231 114050       rs. w3    (v85.)    ;
38232 114052  j8:  dl. w2     (v21.)   ;
38233 114054       aa. w2     (v23.)   ; compute hashvalue
38234 114056       wa  w2       2      ;
38235 114058       al  w1       0      ;
38236 114060       sh  w2      -1      ;
38237 114062       ac  w2  x2          ;
38238 114064       wd. w2     i14.
38239 114066       rs. w1     i13.     ;
38240 114068   j3: rl. w2    (v71.)    ;
38241 114070       rs. w1     (v79.)   ;
38242 114072       jl. w3     d77.     ; get segment
38243 114074       jl. w3     d78.     ; find entry
38244 114076       sl  w2       0      ; if entry address then
38245 114078       jl.         j4.     ; copy information
38246 114080       se  w2     -10      ; if entry ndon' excist then
38247 114082       jl.        g22.     ; goto end line
38248 114084       rl. w1     (v79.)    ; if entry not found on this segment
38249 114086       al  w1  x1+1        ; then increase segment no.
38250 114088       sn. w1    (i14.)    ; search cyclical through
38251 114090       al  w1       0      ;
38252 114092       se. w1    (i13.)    ;
38253 114094       jl.         j3.
38254 114096       jl.        g22.
38255 114098   j4: rl  w1       4      ;
38256 114100       wa. w1     i12.     ; last adr. +2 in userentry
38257 114102       rs. w1     i15.
38258 114104       rl. w1     (v25.)    ;
38259 114106       rl  w3  x2+2        ; command mask(job) :
38260 114108       rl  w0  x1+c26      ; if abs.protection, abs.addr or
38261 114110       la. w0     i17.     ; 
38262 114112       la. w3     i10.     ; all bs= true then
38263 114114       lo  w0       6      ; 'or' these bits to
38264 114116       rs  w0  x1+c26      ; command mask(console)
38265 114118       al  w3  x1+c29      ; copy job to console buffer
38266 114120       al  w2  x2+4        ; from process name
38267 114122   j5: rl  w0  x2          ; to claim list
38268 114124       rs  w0  x3          ;
38269 114126       al  w2  x2+2        ;
38270 114128       al  w3  x3+2        ;
38271 114130       se  w3  x1+c95      ; (until i and o are defined in susercat) end
38272 114132       jl.         j5.     ;
38273 114134  ;
38274 114134  ; create claim list(console)
38275 114134  ;
38276 114134       rs. w2      i1.     ;
38277 114136       rl. w2(v70.)    ;
38278 114138       al  w2  x2+8        ; name adr. first dev(entry0)
38279 114140       rs. w2      i2.     ;
38280 114142       al  w2  x1+c44      ; start of claim list(console)
38281 114144       rs. w2      i0.     ;
38282 114146   j0: rl. w2      i2.     ;
38283 114148       sl. w2    (i15.)    ; kan fjernes nar newcat er rettet !!!!!!!!!!!!!
38284 114150       jl.         j2.     ; ---------""---------""-------""!!!!!!!!!!!
38285 114152       jl. w3     d61.     ; get devno*8(next dev)
38286 114154       jl.         j1.     ; not found: goto next dev.
38287 114156       rl. w3      i1.     ; found: copy claim list:
38288 114158       dl  w1  x3+2        ; begin
38289 114160       wa. w2      i0.     ;
38290 114162       ds  w1  x2+2        ;
38291 114164       dl  w1  x3+6        ;
38292 114166       ds  w1  x2+6        ; end
38293 114168   j1: dl. w3      i2.     ; next device: get claim list adr.(userentry)
38294 114170       al  w3  x3+12       ; and dev. name adr.(entry0)
38295 114172       al  w2  x2+8        ;
38296 114174       ds. w3      i2.     ;
38297 114176       se. w2    (i15.)    ;
38298 114178       jl.         j0.     ; then find next dev.
38299 114180  j2:                      ;
38300 114180       rl. w1    (v25.)    ; restore console
38301 114182       al  w2    -1        ; areabuf := undef;
38302 114184       rs. w2     (v87.)   ;
38303 114186       se. w2     (i16.)   ; if job command then
38304 114188       jl.         g66.    ;   goto run
38305 114190       jl.         g35.    ;   else goto next command;
38306 114192                           ; end;
38307 114192  ;
38308 114192   i0: 0                   ; claim list start(console)
38309 114194   i1: 0                   ; -2  claim list adr(userentry)
38310 114196   i2: 0                   ; +0  dev. name adr.(entry0)
38311 114198  i10: 8.77772006          ; prio+all bs, abs. protc., abs. addr.
38312 114200  i12: 0                   ; entry lenght
38313 114202  i13: 0                   ; name key
38314 114204  i14: 0                   ; catalog lenght
38315 114206  i15: 0                   ; last adr.+2(userentry)
38316 114208  i16: 0                   ; job indicator : 0=job command
38317 114210  i17: 8.1770
38318 114212  z.e.
38319 114212  b.i24
38320 114212  w.
38321 114212  g87: am         1<8    ; lock:  lock := true;
38322 114214                         ; -------------------
38323 114214  g88: al  w0     0      ; unlock:lock := false;
38324 114216                         ; ---------------------
38325 114216       rs. w0     (i0.)  ;
38326 114218       jl.        g35.   ;   goto next command;
38327 114220   i0: e80               ; lock indicator
38328 114222  e.
38329 114222  
38329 114222  
38329 114222  
38329 114222  c. (:c23>15a.1:)-1
38330 114222  
38330 114222  
38330 114222  
38330 114222  b. i30, j10           ;
38331 114222  w.                    ;
38332 114222  
38332 114222  ; command syntax:  modify <addr> <old contents> <new contents>
38333 114222  ;                  -------------------------------------------
38334 114222  g91 = k                ; modify:
38335 114222       jl. w3    (i22.)    ;   addr := next integer;
38336 114224       sl  w0       0      ;   if illegal core-address then
38337 114226       sl  w0    (116)     ;
38338 114228       jl.        g111.    ;     goto end line;
38339 114230       rl  w2       0      ;
38340 114232  
38340 114232       jl. w3    (i22.)    ;
38341 114234       se  w0 (x2)         ;   if next integer <> core(addr) then
38342 114236       jl.        g111.    ;     goto end line;
38343 114238  
38343 114238       jl. w3    (i22.)    ;
38344 114240       rs  w0  x2          ;   core(addr) := next integer;
38345 114242  
38345 114242       jl.        g35.     ;   goto next command;
38346 114244  
38346 114244  g90 = k                  ; print:
38347 114244                           ; --------------
38348 114244       jl. w3    (i22.)    ; next integer
38349 114246       rs. w0    (v37.)    ;
38350 114248       jl. w3    (i22.)    ; next integer
38351 114250       rs. w0    (v38.)    ;
38352 114252       al. w3     i11.     ;
38353 114254       jd      1<11+8      ; reserve printer
38354 114256       se  w0       0      ; if result <> 0
38355 114258       jl.       (i23.)    ; then goto end line
38356 114260  j0:  dl. w1     i12.     ; next:  init output area
38357 114262       ds. w1      i1.     ;
38358 114264       ds. w1      i3.     ;
38359 114266       ds. w1      i7.     ;
38360 114268       dl. w1     i13.     ;
38361 114270       ds. w1      i4.     ;
38362 114272       ds. w1      i5.     ;
38363 114274       rl. w1     i14.     ;
38364 114276       rs. w1      i2.     ;
38365 114278       rs. w1      i6.     ;
38366 114280       rl. w1    (v37.)    ; print address(decimal)
38367 114282       al  w0      10      ;
38368 114284       al. w2      i1.     ;
38369 114286       jl. w3      j3.     ;
38370 114288       rl. w2    (v37.)    ; print word(octal)
38371 114290       rl  w1  x2          ;
38372 114292       al  w0       8      ;
38373 114294       al. w2      i3.     ;
38374 114296       jl. w3      j3.     ;
38375 114298       al  w1      -2      ;
38376 114300       la. w1    (v37.)    ;
38377 114302       bz  w1  x1          ; print byte 1(decimal)
38378 114304       al  w0      10      ;
38379 114306       al. w2      i4.     ;
38380 114308       jl. w3      j3.     ;
38381 114310       al  w1      -2      ;
38382 114312       la. w1    (v37.)    ;
38383 114314       bz  w1  x1  +1      ; print byte 2(decimal)
38384 114316       al  w0      10      ;
38385 114318       al. w2      i5.     ;
38386 114320       jl. w3      j3.     ;
38387 114322       rl. w2    (v37.)    ;
38388 114324       rl  w1  x2          ; print word(decimal)
38389 114326       sl  w1       0      ; if word < 0
38390 114328       jl.         j2.     ; then begin
38391 114330       ac  w1  x1          ; change sign
38392 114332       rl. w0     i15.     ;
38393 114334       rs. w0      i6.     ; set minus
38394 114336  j2:  al  w0      10      ; end
38395 114338       al. w2      i7.     ;
38396 114340       jl. w3      j3.     ;
38397 114342       rl. w1    (v37.)    ;
38398 114344       rl  w2  x1          ; print word(text)
38399 114346       rl. w1     i26.     ;
38400 114348  j1:  ld  w2       8      ;
38401 114350       sz  w1       8.340  ;
38402 114352       sz  w1       8.200  ;
38403 114354       la. w1     i25.     ;
38404 114356       sz  w1       8.177  ;
38405 114358       sz                  ;
38406 114360       al  w1  x1 +32      ;
38407 114362       sh  w1       0      ;
38408 114364       jl.         j1.     ;
38409 114366       rs. w1      i8.     ;
38410 114368       al. w1     i10.     ;
38411 114370       al. w3     i11.     ;
38412 114372       jd     1<11+16      ; send message
38413 114374       jl. w3     d42.     ;   save work(buf);
38414 114376       jl.         j6.     ;+2:  error:  goto end print;
38415 114378       rl. w1    (v37.)    ; first addr
38416 114380       al  w1  x1  +2      ; +2
38417 114382       rs. w1    (v37.)    ; =: first addr
38418 114384       rl. w2    (v38.)    ;
38419 114386       sh  w1  x2          ; if first addr<=last addr
38420 114388       jl.         j0.     ; then goto next
38421 114390  j6:                      ; end print:
38422 114390       al. w3     i11.     ;
38423 114392       jd     1<11+10      ; release printer
38424 114394       jl.       (i24.)    ; goto next command
38425 114396  j3:  ds. w0     i19.     ; save return and radix
38426 114398  j4:  al  w3       0      ; next word: s:= 0
38427 114400  j5:  al  w0       0      ; next char:
38428 114402       wd. w1     i19.     ;
38429 114404       wa. w0     i16.     ;
38430 114406       as  w0  x3          ; remainder shift s
38431 114408       wa  w0  x2          ; + word(i)
38432 114410       rs  w0  x2          ; =: word(i)
38433 114412       sn  w1       0      ; if quotient = 0
38434 114414       jl.       (i18.)    ; then return
38435 114416       al  w3  x3  +8      ; s:= s+8
38436 114418       se  w3      24      ; if s<>24
38437 114420       jl.         j5.     ; then goto next char
38438 114422       al  w2  x2  -2      ; i:=i-2
38439 114424       jl.         j4.     ; goto next word
38440 114426  i0:0                ;
38441 114428  i1:0                ; addr
38442 114430  <:   :>             ;
38443 114432  i6:0                ;
38444 114434  0                   ;
38445 114436  i7:0                ; decimal
38446 114438  0                   ;
38447 114440  i4:0                ; byte 1
38448 114442  0                   ; 
38449 114444  i5:0                ; byte 2
38450 114446  <:   :>             ;
38451 114448  i2:0                ;
38452 114450  0                   ;
38453 114452  i3:0                ; octal
38454 114454  <:   :>             ; 
38455 114456  i8:0                ; text
38456 114458  i9:<:<10>:>         ;
38457 114460  i10:5<12            ; message
38458 114462  i0                  ;
38459 114464  i9                  ;
38460 114466  0                   ;
38461 114468  i11:<:printer:>,0,0  ; name
38462 114478  <:      :>           , i12=k-2
38463 114482  <:      :>           , i13=k-2
38464 114486  <:   :>              , i14=k-2
38465 114488  <:-  :>              , i15=k-2
38466 114490  <:<0><0><16>:>       , i16=k-2
38467 114492  i18:0                ; link
38468 114494  i19:0                ; radix
38469 114496  i22:d16              ; next integer
38470 114498  i23:g1               ; error
38471 114500  i24:g35              ; next command
38472 114502  i25:8.7777 7400      ;
38473 114504  i26:128<16+128<8+128 ;
38474 114506  z.
38475 114506  e.
38476 114506  
38476 114506  
38476 114506  b. i24,j4  w.
38477 114506  g128:am         1        ; set priority
38478 114508  g93: al  w2     0        ; prio:
38479 114510                           ;--------------
38480 114510       jl. w3     d16.     ; read priority
38481 114512       sz. w0    (i1.)     ;   if prio < 0 or prio >= 4096 then
38482 114514       jl.        g27.     ; goto end line: illegal priority
38483 114516       se  w2       0      ; if prio then
38484 114518       jl.          j0.    ; begin
38485 114520       hs  w0  x1+c26      ;   insert prio in console buffer and
38486 114522       jl.        g35.     ;   goto next command
38487 114524  j0:                      ; end else
38488 114524       al  w3  x1+c29      ; begin <* set priority *>
38489 114526       al  w2  x1          ;   save address of console buffer
38490 114528       rl  w1     0        ;
38491 114530       jd         1<11+94  ;   set_priority(prio,child,res);
38492 114532       se  w0     0        ;   if error result then
38493 114534       jl.        g27.     ;   goto end line: illegal priority
38494 114536       hs  w1  x2+c26      ;   insert priority in console buffer and
38495 114538       jl.        g35.     ;   goto next command
38496 114540                           ; end;
38497 114540   i1:  -1<12
38498 114542  e.
38499 114542  
38499 114542  
38499 114542  b.i10   w.
38500 114542  g99:                    ; jobremove
38501 114542                          ; --------------
38502 114542       jl.  w3     (i1.)  ; check child
38503 114544       al  w2  -1         ;
38504 114546       rs  w2  x3+c22     ; coretableelement:=not job
38505 114548       jl.     (i2.)      ; goto remove
38506 114550  i1:  d34
38507 114552  i2:  g71
38508 114554  e.
38509 114554  
38509 114554  
38509 114554  b.i3    w.
38510 114554  g100:                    ; base
38511 114554                           ; -------------
38512 114554       jl. w3     d16.     ; next integer
38513 114556       rs. w0      i3.     ;
38514 114558       jl. w3     d16.     ; next integer
38515 114560       rl. w3      i3.     ;
38516 114562       ds  w0  x1+c42+2    ; set bases
38517 114564       ds  w0  x1+c41+2    ;
38518 114566       ds  w0  x1+c43+2    ;
38519 114568       jl.        g35.     ;
38520 114570  i3:0
38521 114572  e.
38522 114572  ; autorel and relocate
38523 114572  ; ---------------------
38524 114572  ;                  yes
38525 114572  ; syntax: command <first logic address>
38526 114572  ;                  no
38527 114572  ; --------------------------------------
38528 114572  b. i10, j10 w.
38529 114572  
38529 114572  g92: rl. w3      v72.      ; autorel
38530 114574       jl.          j0.      ; set destination address
38531 114576  g102:al  w3  x1+c97        ; relocate :
38532 114578  j0:  rs. w3       i1.      ;
38533 114580       jl. w3       d2.      ; examine next param
38534 114582       se  w0        1       ; if name then
38535 114584       jl.          j1.      ; begin
38536 114586       rl. w2     (v20.)     ; if name:= <:no :> then
38537 114588       al  w3       -1       ; first logic address :=
38538 114590       se. w2      (i0.)     ; -1 (no relocation) 
38539 114592       jl.          j2.      ; else
38540 114594       rl. w3     (v16.)     ; set first logic address
38541 114596       jl.         j2.       ; top of s own code
38542 114598  j1:  se  w0        2       ; if not integer then 
38543 114600       jl.          g2.      ; syntax
38544 114602       rl. w3     (v19.)     ; integer:
38545 114604       sh  w3       -1       ; if <0 then write
38546 114606       jl.          g2.      ; syntax
38547 114608  c.(:a399>23a.1:)-1
38548 114608       sz  w0      (b214)    ; if integer mod 8k <>0 then
38549 114608       jl.          g2.      ;    syntax
38550 114608  z.
38551 114608  j2:  rs. w3      (i1.)     ;
38552 114610       jl.         g35.      ; goto next command
38553 114612  
38553 114612  i0: <:yes:>                ; 
38554 114614  i1: 0                      ;
38555 114616  e.
38556 114616  
38556 114616  ; adjust rest claims in usercat.
38557 114616  ; comment: change the perm rest claims in susercat
38558 114616  ; to the value given by the internal process descr. for key=3.
38559 114616  ; temp claims are unchanged.
38560 114616  ;
38561 114616  ;     call         return
38562 114616  ; w0               destroyed
38563 114616  ; w1               destroyed
38564 114616  ; w2               destroyed
38565 114616  ; w3  link         destroyed
38566 114616  ;
38567 114616   b.i20, j10
38568 114616   w.
38569 114616  
38569 114616  d76: rs. w3     i10.     ; store return in save area
38570 114618       rl. w3   (v30.)     ;
38571 114620       rl  w1  x3+c22      ; if segmentno= -1 then
38572 114622       sh  w1      -1      ; return: no susercatjob
38573 114624       jl.       (i10.)    ;
38574 114626   c.(:c23>14 a.1 :)-1
38575 114626       rl. w2      i2.     ; 
38576 114628       jl. w3     d77.     ; get segment
38577 114630       rl. w1   (v30.)     ;
38578 114632       rl  w1  x1+c22      ;
38579 114634       am.      (v46.)     ;
38580 114636       rs  w1      +2      ; store segmentno in output mess
38581 114638       rl. w1   (v29.)     ; get procname(child)
38582 114640       al  w2  x1+a11      ; and store in name area
38583 114642       rl. w3    v20.      ;
38584 114644       dl  w1  x2+2        ;
38585 114646       ds  w1  x3+2        ;
38586 114648       dl  w1  x2+6        ;
38587 114650       ds  w1  x3+6        ;
38588 114652   j0: jl. w3     d78.     ; find entry
38589 114654       sh  w2      -1      ; if entry not found then
38590 114656       jl.         j7.     ; goto write warning
38591 114658       al  w2  x2+50       ;
38592 114660       rs. w2      i3.     ; perm claim adr(userentry)+2
38593 114662       rl. w2      i1.     ;
38594 114664       al  w2  x2+8        ;
38595 114666       rs. w2      i4.     ;
38596 114668   j1: rl. w2      i4.     ; adjust rest claims
38597 114670       rl. w3  v20.        ; for i=0 step 1 until last dev.(entry0) do
38598 114672       jl. w1  d74.        ; begin
38599 114674       se  w0  0           ; lookup bs claims(dev,process)
38600 114676       jl.     j2.         ; if not-ok goto next device
38601 114678       dl  w3  x1+4*a110+2 ; perm(entryes, segments) := entryes ,segments(key=max-key
38602 114680       ds. w3  (i3.)       ;
38603 114682   j2: dl. w2     i4.      ; next device:
38604 114684       al  w2  x2+12       ; 
38605 114686       al  w1  x1+8        ;
38606 114688       ds. w2      i4.     ;
38607 114690       rl. w1      i1.     ;
38608 114692       rl  w1  x1+4
38609 114694       am.       ( i1.)    ; if  dev.name.adr. <
38610 114696       sh  w2  x1          ; last used of entry0 then
38611 114698       jl.         j1.     ; goto next , else
38612 114700       rl. w2      i2.     ; store segment:
38613 114702       al  w3  x2+510      ; create output mess.
38614 114704                           ; first adr. h20
38615 114704       ds. w3   (v46.)     ; last adr. h20+510
38616 114706       rl. w3      i5.     ; segment no:stored above
38617 114708       jd     1<11+52     ; create area.susercat
38618 114710       jd      1<11+8      ; reserve(susercat)
38619 114712       sn  w0       0      ;
38620 114714       jl.         j5.     ;
38621 114716                           ; if error then
38622 114716       jl.        g15.     ; write: area error
38623 114718   j5:                     ;
38624 114718       rl. w1     v44.     ;
38625 114720       jd     1<11+16      ; send mess.
38626 114722       rl. w1     i11.     ;
38627 114724       jd      1<11+18     ; wait answer
38628 114726       lo. w0    (i11.)    ; 'or' status and result
38629 114728       sn  w0       1      ; if <> 1 then goto error
38630 114730       jl.         j6.     ;
38631 114732   j4:                     ; error
38632 114732       al. w1     g11.     ; write catalog error
38633 114734       rs. w1     i10.     ;
38634 114736   j6: rl. w3      i5.     ;
38635 114738       jd     1<11+64      ; remove area susercat
38636 114740       rs. w3     (v87.)   ;   areabuf := undef;
38637 114742       jl.       (i10.)    ; return
38638 114744  ;
38639 114744  j7:  rl. w1     i7.      ; entry not found error:
38640 114746       jl. w3    (i8.)     ;   write warning;
38641 114748       jl. w3     d42.     ;   save work;
38642 114750       jl.       +2        ;   +0: error: ignore;
38643 114752       jl.        j6.      ;   +2: goto remove susercat area
38644 114754   i0: 0                   ; pr.descr.adr(procname)
38645 114756   i1: h19                 ; entry0 adr.
38646 114758   i2: h20                 ; user segment adr.
38647 114760  i7:  g120                ; address of warning text
38648 114762  i8:  g105                ; 
38649 114764  z.
38650 114764   c.-(:c23>14 a.1 :)
38651 114764       jl.   (2), g18
38652 114764  z.
38653 114764  
38653 114764   i3: 0                   ; -2, perm claim list adr(userentry)
38654 114766   i4: 0                   ; +0, dev.name adr(entry0)
38655 114768   i5: c69                 ; susercat name adr.
38656 114770   i6: 0                   ; segmentno in susercat
38657 114772  i10: 0                 ; return adr.
38658 114774  i11: e51               ; answer status adr.
38659 114776  e.
38660 114776  
38660 114776  
38660 114776  ; character table:
38661 114776  ; contains an entry of 3 bits defining the type of each
38662 114776  ; character in the iso 7 bit character set.
38663 114776  
38663 114776  w.h0: 8.7777 7777       ; nul soh stx etx eot enq ack bel
38664 114778  8.7757 7777       ; bs  ht  nl  vt  ff  cr  so  si
38665 114780  8.7777 7777       ; dle dc1 dc2 dc3 dc4 nak syn etb
38666 114782  8.7667 7777       ; can em  sub esc fs  gs  rs  us
38667 114784  8.3666 6666       ; sp
38668 114786  8.6636 4244       ; (   )   *   +   ,   -   .   /
38669 114788  8.1111 1111       ; 0   1   2   3   4   5   6   7
38670 114790  8.1125 6466       ; 8   9   :   ;   <   =   >
38671 114792  8.6000 0000       ;     A   B   C   D   E   F   G
38672 114794  8.0000 0000       ; H   I   J   K   L   M   N   O
38673 114796  8.0000 0000       ; P   Q   R   S   T   U   V   W
38674 114798  8.0000 0066       ; X   Y   Z   Æ   Ø   Å       _
38675 114800  8.6000 0000       ;     a   b   c   d   e   f   g
38676 114802  8.0000 0000       ; h   i   j   k   l   m   n   o
38677 114804  8.0000 0000       ; p   q   r   s   t   u   v   w
38678 114806  8.0000 0067       ; x   y   z   æ   ø   å      del
38679 114808  
38679 114808  ; command table:
38680 114808  ; each entry consists of two words defining the name of the
38681 114808  ; command, a eigth bits defining a bit to test in the console mask,
38682 114808  ; and a sixteen bits defining the address of the command action
38683 114808  ; relative to g45.
38684 114808  
38684 114808  w.h2 = k-6  ; base of command:
38685 114808  <:all<0>:>  , 1<17+g83-g45
38686 114814  <:addr:>    , 1<17+g54-g45
38687 114820  <:area:>    , 1<17+g61-g45
38688 114826  <:autore:>  , 1<15+g92-g45
38689 114832  <:base:>    , 1<18+g100-g45
38690 114838  <:break:>   , 1<20+g70-g45
38691 114844  <:bs<0><0>:>, 1<17+g81-g45
38692 114850  <:buf<0>:>  , 1<17+g60-g45
38693 114856  <:call:>    , 1<17+g74-g45
38694 114862  <:closec:>  , 1<15+g119-g45
38695 114868  <:connec:>  , 1<17+g112-g45
38696 114874  <:cpa<0>:>  , 1<17+g59-g45
38697 114880  <:create:>  , 1<16+g64-g45               ; <:createlink:> --> g64 --> g112
38698 114886  <:date:>    , 1<21+1<14+g49-g45
38699 114892  <:discon:>  , 1<17+g113-g45
38700 114898  <:dump:>    , 1<20+g79-g45
38701 114904  <:exclud:>  , 1<19+g73-g45
38702 114910  <:i:>,0     , 1<20+g94-g45
38703 114916  <:functi:>  , 1<17+g63-g45
38704 114922  <:includ:>  , 1<19+g72-g45
38705 114928  <:init:>    , 1<16+g65-g45
38706 114934  <:initki:>  , 1<17+g117-g45
38707 114940  <:intern:>  , 1<17+g62-g45
38708 114946  <:job<0>:>  , 1<20+g89-g45
38709 114952  <:get<0>:>  , 1<20+g96-g45
38710 114958  <:link:>    , 1<17+g114-g45
38711 114964  <:linkal:>  , 1<17+g116-g45
38712 114970  <:list:>    , 1<20+1<14+g75-g45
38713 114976  <:load:>    , 1<20+g67-g45
38714 114982  <:lock:>    , 1<15+g87-g45
38715 114988  <:login:>   , 1<18+g82-g45
38716 114994  <:max<0>:>  , 1<20+1<14+g76-g45
38717 115000  <:modify:>  , 1<21+1<14+g91-g45
38718 115006  <:memdum:>  , 1<17+g122-g45
38719 115012  <:new<0>:>  , 1<16+g51-g45
38720 115018  <:jobrem:>  , 1<15+g99-g45
38721 115024  <:o:>,0     , 1<20+g95-g45
38722 115030  <:perm:>    , 1<17+g85-g45
38723 115036  <:prepar:>  , 1<17+g121-g45
38724 115042  <:prio:>    , 1<18+g93-g45
38725 115048  <:privil:>  , 1<15+g124-g45
38726 115054  <:proc:>    , 1<20+g52-g45
38727 115060  <:prog:>    , 1<20+g53-g45
38728 115066  <:projec:>  , 1<18+g80-g45
38729 115072  <:read:>    , 1<20+1<14+g57-g45
38730 115078  <:reloca:>  , 1<18+g102-g45      ;  
38731 115084  <:remove:>  , 1<20+g71-g45               ; <:removelink:> -->g71 --> g113
38732 115090  <:setpri:>  , 1<15+g128-g45
38733 115096  <:unpriv:>  , 1<15+g125-g45
38734 115102  <:cleanu:>  , 1<15+g104-g45
38735 115108  
38735 115108  c.(:c23>17a.1:)-1
38736 115108  <:replac:>  , 1<15+g77-g45
38737 115114  z.
38738 115114  <:run<0>:>  , 1<16+g66-g45
38739 115120  <:size:>    , 1<18+g56-g45
38740 115126  <:start:>   , 1<20+g68-g45
38741 115132  <:stop:>    , 1<20+g69-g45
38742 115138  <:temp:>    , 1<17+g84-g45
38743 115144  <:unlink:>  , 1<17+g115-g45
38744 115150  <:unlock:>  , 1<15+g88-g45
38745 115156  <:unstac:>  , 1<20+1<14+g58-g45
38746 115162  <:user:>    , 1<18+g86-g45
38747 115168  <:mode:>    , 1<21+g55-g45
38748 115174  c.-4000
38749 115174  <:key<0>:>     , 1<17+g57-g45
38750 115174  <:pk<0><0>:>   , 1<18+g59-g45
38751 115174  <:pr<0><0>:>   , 1<18+g58-g45
38752 115174  z.
38753 115174  <:print:>      , 1<21+1<14+g90-g45
38754 115180  h3:h13         ; continue command list
38755 115182  
38755 115182  ; create link param list
38756 115182  h14: ; type           kind<12+modifier
38757 115182  <:disc<0>:>,0,0,        6 < 12 + 0   ; reserved
38758 115192  <:disk<0>:>,0,0,        6 < 12 + 0   ; reserved
38759 115202  <:discneutral<0>:>,     6 < 12 + 4   ; neutral
38760 115212  <:diskneutral<0>:>,     6 < 12 + 4   ; neutral
38761 115222  <:discforce<0>:>,       6 < 12 + 8   ; override
38762 115232  <:diskforce<0>:>,       6 < 12 + 8   ; override
38763 115242  <:tape<0>:>,0,0,       18 < 12 + 0   ; reserved
38764 115252  <:tapeneutral<0>:>,    18 < 12 + 4   ; neutral
38765 115262  <:tapeforce<0>:>,      18 < 12 + 8   ; override
38766 115272  <:tapek2<0>:>,0,       18 < 12 + 2   ; keystone 2
38767 115282  <:tapek3<0>:>,0,       18 < 12 + 3   ; keystone 3
38768 115292  <:tapeperte<0>:>,      18 < 12 + 1   ; 3715
38769 115302  <:console:>,0,          1 < 12 + 0   ;
38770 115312  <:floppy:>,0,0,         7 < 12 + 0   ;
38771 115322  h15:
38772 115322  
38772 115322  ; define b-name for transferring variables to mons2-text
38773 115322  
38773 115322  b110 = g45   ; command base
38774 115322  b112 = d2    ; call next param
38775 115322  b113 = d15   ; call next name
38776 115322  b114 = d16   ; call next integer
38777 115322  b115 = g2    ; goto syntax error
38778 115322  b116 = g35   ; goto next command
38779 115322  b117 = g36   ; goto exam command
38780 115322  b118 = e19   ; integer just read
38781 115322  b119 = e20   ; name just read
38782 115322  b120 = e16   ; pointer to: first addr
38783 115322  b121 = d19   ; call init write
38784 115322  b122 = d20   ; call write char
38785 115322  b123 = d21   ; call write text
38786 115322  b124 = d23   ; call type line
38787 115322  b125 = d42   ; call save work
38788 115322  b126 = g47   ; goto input aborted
38789 115322  b129 = g11   ; goto catalog error
38790 115322  b130 = d79   ; call stack input
38791 115322  b131 = d22   ; call write integer;
38792 115322  b132 = e90   ; pointer to: terminal
38793 115322  b133 = d51   ; call connect;
38794 115322  b134 = g118  ; call linkall;
38795 115322  b136 = c84   ; devno of 1st connection;
38796 115322  b137 = d55   ; call read segment;
38797 115322  b138 = d57   ; call write segment;
38798 115322  b139 = 0     ; default definition. redefined below if itc included  (dirty)
38799 115322  b140 = d14   ; call writebits;
38800 115322  b141 = e72   ; pointer to: first logical address
38801 115322  b142 = e17   ; memory buffer (first free and top of core e16+e17)
38802 115322  b143 = d12   ; change write mode
38803 115322  b144 = e53   ; write mode
38804 115322  b145 = e44   ; output message
38805 115322  b146 = e40   ; name (receiver)
38806 115322  b147 = e32   ; answer area
38807 115322  b148 = c36   ; s log area name
38808 115322  b149 = e42   ; top of write buffer
38809 115322  b150 = d58   ; prepare dump
38810 115322  c.(:a399>21a.1:)-1
38811 115322  b151 = c107  ; default dump area size
38812 115322  z.
38813 115322  b152 = e102  ; device number for 1. physical disc
38814 115322  b153 = d59   ; initialize main
38815 115322  
38815 115322  e86: 0,r.(:a110+1:)*2    ; bs claim store;
38816 115338  
38816 115338  ; console table:
38817 115338  
38817 115338  h4:0, r.c81*c1>1     ; lay out standard console descriptions
38818 118258  h22=k-c1             ; last description
38819 118258  
38819 118258  ; initialize standard console descriptions.
38820 118258  ;  c20, c21 queue element  (queued up on the queue head)
38821 118258  ;  c27      command mask           (standard mask)
38822 118258  b.i4,j2 w.
38823 118258  
38823 118258  i0:0                 ; saved link
38824 118260  h4+c1                ; next element
38825 118262  i1:h4-c1             ; last element
38826 118264  i2:e35               ; queue head
38827 118266  i3: h4.              ;
38828 118268  
38828 118268  j0:  rs. w3      i0.     ; start:
38829 118270       al. w1      i0.     ;
38830 118272       rs  w1  x2  +0      ;   first free:=start of init code;
38831 118274       al  w0     c82      ;
38832 118276       dl. w2      i1.     ;
38833 118278       al. w3      i3.     ;
38834 118280       wa. w3      i3.     ;   al. w3 h4.
38835 118282  j1:  rs  w0  x3+c27      ;   for console desc:=first stop 1 until last do
38836 118284       ds  w2  x3+c21      ;     mask(console desc):=standard mask;
38837 118286       al  w1  x1 +c1      ;     next,last queue element:=next, last console desc;
38838 118288       al  w2  x2 +c1      ;
38839 118290       al  w3  x3 +c1      ;
38840 118292       sh. w3     h22.     ;
38841 118294       jl.         j1.     ;
38842 118296       rl. w2      i2.     ;   insert queue head in first and last console des;
38843 118298       al. w3      i3.     ;
38844 118300       wa. w3      i3.     ;   al. w3 h4.
38845 118302       rs  w2   x3+c21     ;
38846 118304       rs. w2     h22.+c20 ;
38847 118306       al  w0       0      ;
38848 118308       al  w2       0      ;
38849 118310       jl.        (i0.)    ;   return to slang;
38850 118312  
38850 118312       jl.         j0.     ;   goto start;
38851 118314  e.j.
38852 118258  
38852 118258  h21=k                  ; main console
38853 118258  
38853 118258  m.
38853 118258                  s main console included

38854 118258      k, k-2, 0,   2, 8.1770, <:console1:>,0, 0, r.c1>1-9
38855 118404  
38855 118404  h. h5=k-c1   ; last console
38856 118404   
38856 118404  ; device exception table (devices not automatically included with users )
38857 118404  ; the numbers in order of increasing value:
38858 118404  h6:                 ; start(table)
38859 118404  t.
38859 118404* type 

38860 118404  
38860 118404  
38860 118404  m.
38860 118404    s device exclusion table

38861 118404      4,  11,  13
38862 118407  n.m.
38862 118407                  s device exclusion table included

38863 118407      2047            ; last(table)
38864 118408  w.
38865 118408  w.
38866 118408  
38866 118408  ; work table:
38867 118408  
38867 118408  h. h8:                 ; first work:
38868 118408  0,r.c2*c3
38869 119288  h9=k-c2                ; last work:
38870 119288  h. h19:  -1,r.c89
38871 119392  h20:-1,r.512
38872 119904  c.(:a80>16a.1:)-1      ; if ida device drivers included then
38873 119904  w.                     ;
38874 119904  h23=k                  ;    first of disc desc buffer
38875 119904  -1, r.256              ;    disc buffer = one segment
38876 120416  h24=k-2                ;    last of disc desc buffer
38877 120416                         ;
38878 120416  b139 = h23             ;
38879 120416                         ;
38880 120416  h25:                   ;    initkit disc description:
38881 120416       6                 ;    + 0: no of files
38882 120418       866               ;    + 2: first segment of rc8000 coredump
38883 120420       500               ;    + 4: no of segments in coredump
38884 120422       5                 ;    + 6: first segment of ida801 fw
38885 120424       60                ;    + 8: no of segments in ida801 fw
38886 120426       65                ;    +10: first segment of bootloader
38887 120428       1                 ;    +12: no of segments in bootloader
38888 120430       66                ;    +14: first segment of rc8000 monitor
38889 120432       500               ;    +16: no of segments in monitor
38890 120434       566               ;    +18: first segment of 1st fe program
38891 120436       300               ;    +20: no of segments in 1st fe program
38892 120438       1366              ;    +22: first segment of dummy file
38893 120440       0                 ;    +24: no of segments in dummy file
38894 120442                         ;
38895 120442       0, 0              ;    +26,+27: size of log disc descrp, no of log disc descrp
38896 120446  h26=k                  ;    top of default kit description
38897 120446                         ;    format of log disc description:
38898 120446                         ;    +28: first segment of 1st disc 
38899 120446                         ;    +30: no of segments in 1st disc
38900 120446                         ;    +32: type: include sender, data disc
38901 120446                         ;    +33: devno: select a free
38902 120446                         ;
38903 120446  z.                     ;
38904 120446  
38904 120446  
38904 120446  ; core table:
38905 120446  ; contains an entry for each storage area allocated to a child.
38906 120446  ; an entry defines the address of a child description within the
38907 120446  ; monitor. the entries are arranged in the same order as the
38908 120446  ; storage areas from low towards high addresses. the table is
38909 120446  ; terminated by a zero.
38910 120446  
38910 120446  w.
38911 120446  h10 = k - c11        ; base of core table:
38912 120446  -1, r.(:a3-2:)*c11>1 ; lay out core table
38913 121326  h11=k                ; top of coretable
38914 121326  m.
38914 121326                  first free addr

38915 121326  
38915 121326  ; initialize core table.
38916 121326  ; all entries in the core table is initialised to this values-
38917 121326  ;   k, k-2, -1, r.5
38918 121326  b.i1,j1 w.
38919 121326  i0:h10+c11           ; absolute addr of core table
38920 121328  i1:h10.+c11          ; relative addr of core table
38921 121330  
38921 121330  j0:  al. w1      i0.     ; start:
38922 121332       rs  w1  x2  +0      ;   first free:=start of init code;
38923 121334       rl. w1      i0.     ;
38924 121336       al. w2      i1.     ;
38925 121338       wa. w2      i1.     ;
38926 121340  j1:  rs  w1  x2  +0      ;   for entry:=first stop 1 until last do
38927 121342       rs  w1  x2  +2      ;     word(entry+0,+2):=k, k-2;
38928 121344       al  w1  x1+c11      ;
38929 121346       al  w2  x2+c11      ;
38930 121348       se. w2      h11.    ;
38931 121350       jl.         j1.     ;
38932 121352       al  w0       0      ;
38933 121354       al  w2       0      ;   status:=ok;
38934 121356       jl      x3          ;   return to slang;
38935 121358  
38935 121358       jl.         j0.     ;   goto start;
38936 121360  e.j.
38937 121326  ; * * * obs do not place any data between h12 and i10 !
38938 121326  
38938 121326  c.(:a399>23a.1:)-1
38939 121326  h.
38940 121326  0,r.(:(:(:(:k+2047:)/2048:)*2048:) - k:); (first address:=(first address+2047)//2048)*2048;
38941 121326  w.
38942 121326  m.                     first free mod 2k
38943 121326  z.
38944 121326  
38944 121326  h12:
38945 121326  h13 = - (:h12 + 2:)  ;  command table continues in second word of next text
38946 121326  
38946 121326  b. i29 w.
38947 121326  
38947 121326  ; table of preoccupied claims:
38948 121326  ; mess buf      area          internal
38949 121326  i0=1          , i1=a112+1   , i2=1          ; proc func
38950 121326  i3=1+a117     , i4=0        , i5=1          ; std driver
38951 121326  i6=a5-i0-i3   , i7=a1-i1-i4 , i8=a3-i2-i5   ; s
38952 121326  c.(:a399>22a.1:)-1
38953 121326  i25=2         , i26=0       , i27=1         ; monitor
38954 121326  i6=i6-i25     , i7=i7-i26   , i8=i8-i27     ; s
38955 121326  z.
38956 121326  
38956 121326  i10: rs. w3     i12.     ;    save return to autoloader;
38957 121328  
38957 121328  ; initialize work table
38958 121328  b. j1 w.
38959 121328       rl. w3    i20.     ;
38960 121330  j0:                    ; rep:
38961 121330       al  w1  x3+c73    ;   for all work table entries do
38962 121332       rs  w1  x3+c58    ;     stack pointer := stack base;
38963 121334       al  w3  x3+c2     ;
38964 121336       sh. w3     (i21.) ;
38965 121338       jl.        j0.    ;
38966 121340  e.                     ;
38967 121340  
38967 121340  ; initialize special console descriptions.
38968 121340  b.j10 w.
38969 121340       al. w3     (j2.)    ;
38970 121342       jl.         j1.     ;
38971 121344  j0:  rl  w1  x3+c25      ;   for console desc:=first step 1 until last do
38972 121346       ls  w1       1      ;     proc desc addr(console):=
38973 121348       wa  w1      b4      ;       word(base name table(dev)+2*devno);
38974 121350       rl  w1  x1          ;
38975 121352       rs  w1  x3+c25      ;
38976 121354       al  w3  x3 +c1      ;
38977 121356  j1:  sh. w3      (j3.)    ;
38978 121358       jl.         j0.     ;
38979 121360  c.(:a399>22a.1:)-1
38980 121360       dl  w1     b27+2    ;
38981 121360       ws  w1     0        ; max r.size:=max space allowing visibilty monitor tables and area for process dscriptions
38982 121360       ls  w1     -11      ; max r.size mod 2k :=0;
38983 121360       ls  w1      11      ;
38984 121360       rs. w1     (i29.)   ;
38985 121360  z.
38986 121360       jl.        i9.
38987 121362  
38987 121362  j2: h21
38988 121364  j3: h5
38989 121366  i20: h8
38990 121368  i21: h9
38991 121370  c.(:a399>22a.1:)-1
38992 121370  i28: d30
38993 121370  i29: e82
38994 121370  z.
38995 121370  e.
38996 121370  
38996 121370  ; process description for process functions:
38997 121370  ;
38998 121370  ; rel address contents
38999 121370  
38999 121370   i9: rl  w1     (b6)     ;    proc := first internal;
39000 121372       jl. w2     i18.     ;    init description;
39001 121374  
39001 121374  a48    , a107              ; interval low
39002 121378  a49    , a108              ;    -     high
39003 121382  a11    , 0                 ; name 0 : zero
39004 121386  a11+2  , <:pro:>           ; name 2-6: <:procfunc>
39005 121390  a11+4  , <:cfu:>           ;
39006 121394  a11+6  , <:nc:>            ;
39007 121398  a17    , b60-b60+a398      ; first address
39008 121402  a18    , b61               ; top address
39009 121406  a301   , 0                 ; priority
39010 121410  a26    , a89               ; interrupt mask
39011 121414  a27    , b62               ; user exception address
39012 121418  a170   , 0                 ; user escape address
39013 121422  a32    , 1<23              ; status = monitor mode
39014 121426  a33    , b63               ; ic = waiting point
39015 121430  a182   , 0                 ; base = no relocation
39016 121434  a183   , a398              ; lower write limit = first core
39017 121438  ;*** a184   , core size         ; top write limit: special
39018 121438  a185   , 6<12+b54          ; interrupt levels
39019 121442  a42    , a107              ; catalog base low
39020 121446  a43    , a108              ;    -     -   high
39021 121450  a44-2  , a107              ; max interval low
39022 121454  a44    , a108              ;  -     -     high
39023 121458  a45-2  , a107              ; std    -     low
39024 121462  a45    , a108              ;  -     -     high
39025 121466  a302   , 0                 ; save area address
39026 121470  
39026 121470  a10    , 0;(end of words)  ; kind = 0
39027 121474  
39027 121474  a12    , 0                 ; stop count
39028 121478  a13    , a102              ; state = waiting for message
39029 121482  a19    , i0                ; buf claim
39030 121486  a20    , i1                ; area claim
39031 121490  a22    , 8.7777            ; function mask
39032 121494  
39032 121494  a10    , 0;(end of bytes)  ; (kind = 0)
39033 121498  
39033 121498       rs  w0  x1+a184       ;    top write limit(proc func) := core size;
39034 121500  c.(:a399>22a.1:)-1
39035 121500  
39035 121500  ; process description for monitor
39036 121500  
39036 121500       al  w1  x1 +a4        ;    proc := second internal;
39037 121500       jl. w2     i18.       ;    init description;
39038 121500  
39038 121500  a48    , a107              ; interval low
39039 121500  a49    , a108              ;    -     high
39040 121500  a11    , <:mon:>           ; name = <:monitor:>
39041 121500  a11+2  , <:ito:>           ;
39042 121500  a11+4  , <:r:>             ;
39043 121500  a11+6  , 0                 ;
39044 121500  a17    , b160              ; first address
39045 121500  a18    , 8.3777 7777       ; top address
39046 121500  a301   , 0                 ; priority
39047 121500  a26    , a89               ; interrupt mask
39048 121500  a27    , 0                 ; user exception address
39049 121500  a170   , 0                 ; user escape address
39050 121500  ;*** a171   , core size    ; initial cpa
39051 121500  a172   , 0                 ;    -    base
39052 121500  a173   , a398              ;    -    lower write limit
39053 121500  ;*** a174   , core size    ;    -    upper   -     -
39054 121500  a175   , b54<12+b54        ;    -    interrupt levels
39055 121500  a32    , 0                 ; status = not monitor mode
39056 121500  a33    , b160              ; ic = start init
39057 121500  a34    , 0                 ; parent = undef
39058 121500  ;*** a181   , core size    ; current cpa
39059 121500  a182   , 0                 ;    -    base
39060 121500  a183   , a398              ;    -    lower write limit
39061 121500  ;*** a184   , core size    ;    -    upper   -     -
39062 121500  a185   , b54<12+b54        ;    -    interrupt levels
39063 121500  a42    , a107              ; catalog base low
39064 121500  a43    , a108-1            ;    -     -   high
39065 121500  a44-2  , a107              ; max interval low
39066 121500  a44    , a108-1            ;  -      -    high
39067 121500  a45-2  , a107              ; std interval low
39068 121500  a45    , a108-1            ;  -      -    high
39069 121500  a302   , 0                 ; save area address
39070 121500  
39070 121500  a10    , 0;(end of words)  ; kind = 0
39071 121500  
39071 121500  a12    , 0                 ; stopcount
39072 121500  a13    , a104              ; state = wait for event
39073 121500  a19    , i25               ; buf claim
39074 121500  a20    , i26               ; area claim
39075 121500  a21    , i27-1              ; internal claim
39076 121500  a24    , 1<7               ; (protection register, for compatibility reasons)
39077 121500  a25    , 0                 ; (protection key, for compatibility reasons)
39078 121500  a22    , 8.7777            ; function mask
39079 121500  
39079 121500  a10    , 0;(end of bytes)  ; (kind = 0)
39080 121500  
39080 121500       sl  w0     0        ; if montop<8MHW then
39081 121500       rs  w0  x1+a18      ;    top address(s) :=montop
39082 121500       rs  w0  x1+a171     ;    initial cpa(s) :=
39083 121500       rs  w0  x1+a174     ;    initial upper write limit(s) :=
39084 121500       rs  w0  x1+a181     ;    current cpa(s) :=
39085 121500       rs  w0  x1+a184     ;    current upper write limit(s) := core size;
39086 121500       al  w0  x1          ;
39087 121500       al  w2     0        ;
39088 121500       jl. w3     (i28.)   ;    reserve core
39089 121500       rl  w1     0        ;
39090 121500  
39090 121500  z.
39091 121500  
39091 121500  ; process description for initial operating system, s
39092 121500  
39092 121500       al  w1  x1 +a4        ;    proc := second internal;
39093 121502       jl. w2     i18.       ;    init description;
39094 121504  
39094 121504  a48    , a107              ; interval low
39095 121508  a49    , a108              ;    -     high
39096 121512  a11    , <:s:>             ; name = <:s:>
39097 121516  a11+2  , 0                 ;
39098 121520  a11+4  , 0                 ;
39099 121524  a11+6  , 0                 ;
39100 121528  a17    , c0                ; first address
39101 121532  ;*** a18    , core size    ; top address
39102 121532  a301   , 0                 ; priority
39103 121536  a26    , a89               ; interrupt mask
39104 121540  a27    , d0                ; user exception address
39105 121544  a170   , 0                 ; user escape address
39106 121548  ;*** a171   , core size    ; initial cpa
39107 121548  a172   , 0                 ;    -    base
39108 121552  a173   , a398              ;    -    lower write limit
39109 121556  ;*** a174   , core size    ;    -    upper   -     -
39110 121556  a175   , b54<12+b54        ;    -    interrupt levels
39111 121560  a32    , 0                 ; status = not monitor mode
39112 121564  a33    , h12               ; ic = start init
39113 121568  a34    , 0                 ; parent = undef
39114 121572  ;*** a181   , core size    ; current cpa
39115 121572  a182   , 0                 ;    -    base
39116 121576  a183   , a398              ;    -    lower write limit
39117 121580  ;*** a184   , core size    ;    -    upper   -     -
39118 121580  a185   , b54<12+b54        ;    -    interrupt levels
39119 121584  a42    , a107              ; catalog base low
39120 121588  a43    , a108-1            ;    -     -   high
39121 121592  a44-2  , a107              ; max interval low
39122 121596  a44    , a108-1            ;  -      -    high
39123 121600  a45-2  , a107              ; std interval low
39124 121604  a45    , a108-1            ;  -      -    high
39125 121608  a302   , 0                 ; save area address
39126 121612  
39126 121612  a10    , 0;(end of words)  ; kind = 0
39127 121616  
39127 121616  a12    , 0                 ; stopcount
39128 121620  a13    , a95               ; state = running
39129 121624  a19    , i6                ; buf claim
39130 121628  a20    , i7                ; area claim
39131 121632  a21    , i8-1              ; internal claim
39132 121636  a24    , 1<7               ; (protection register, for compatibility reasons)
39133 121640  a25    , 0                 ; (protection key, for compatibility reasons)
39134 121644  a22    , 8.7777            ; function mask
39135 121648  
39135 121648  a10    , 0;(end of bytes)  ; (kind = 0)
39136 121652  
39136 121652       rs. w0    (4)       ;   top core :=
39137 121654       jl.        4        ;
39138 121656           e17             ;
39139 121658       rs  w0  x1+a18      ;    top address(s) :=
39140 121660       rs  w0  x1+a171     ;    initial cpa(s) :=
39141 121662       rs  w0  x1+a174     ;    initial upper write limit(s) :=
39142 121664       rs  w0  x1+a181     ;    current cpa(s) :=
39143 121666       rs  w0  x1+a184     ;    current upper write limit(s) := core size;
39144 121668  
39144 121668  ; process description for std driver
39145 121668  
39145 121668       al  w1  x1 +a4      ;    proc := next internal;
39146 121670       jl. w2     i18.     ;    init description;
39147 121672  
39147 121672  a48    , a107              ; interval low
39148 121676  a49    , a108-1            ;    -     high
39149 121680  a11    , <:dri:>           ; name = <:driver proc:>
39150 121684  a11+2  , <:ver:>           ; 
39151 121688  a11+4  , <:pro:>           ;
39152 121692  a11+6  , <:c:>             ;
39153 121696  a17    , a398              ; first address
39154 121700  a18    , b60               ; top address
39155 121704  a301   , -1                ; priority
39156 121708  a26    , a89               ; interrupt mask
39157 121712  a27    , b87               ; user exception address
39158 121716  a170   , 0                 ; user escape address
39159 121720  a171   , b60               ; initial cpa
39160 121724  a172   , 0                 ;    -    base
39161 121728  a173   , a398              ;    -    lower write limit
39162 121732  a174   , b60               ;    -    upper   -     -
39163 121736  a175   , 6<12+8            ;   -    interrupt levels
39164 121740  a32    , 1<23+1<6          ; status = monitor mode,locked
39165 121744  a33    , b77               ; ic = before central waiting point one call of lock
39166 121748  a34    , 0                 ; parent = undef
39167 121752  a181   , b60               ; current cpa
39168 121756  a182   , 0                 ;    -    base
39169 121760  a183   , a398              ;    -    lower write limit
39170 121764  a184   , b60               ;    -    upper   -     -
39171 121768  a185   , 6<12+8            ;    -    interrupt levels
39172 121772  a42    , a107              ; catalog base low
39173 121776  a43    , a108-1            ;    -     -   high
39174 121780  a44-2  , a107              ; max interval low
39175 121784  a44    , a108-1            ;  -     -     high
39176 121788  a45-2  , a107              ; std interval low
39177 121792  a45    , a108-1            ;  -     -     high
39178 121796  a302   , b86               ; save area address
39179 121800  
39179 121800  a10    , 0 ;(end of words) ; kind = 0
39180 121804  
39180 121804  a12    , 0                 ; stopcount
39181 121808  a13    , a95               ; state = running
39182 121812  a19    , i3                ; buf claim
39183 121816  a20    , i4                ; area claim
39184 121820  a21    , i5-1              ; internal claim
39185 121824  a24    , 1<7               ; (protection register)
39186 121828  a25    , 0                 ; (protection key)
39187 121832  a22    , 8.7777            ; function mask
39188 121836  
39188 121836  a10    , 0 ;(end of bytes) ; (kind = 0)
39189 121840       al  w0     0        ;
39190 121842       rs  w0  x1+a30      ;    driverproc.save w2 := 0;
39191 121844       al  w2  x1+a16      ;
39192 121846       rl  w1     b2       ;
39193 121848       jl  w3     b36      ;    link(timer q,driverproc)
39194 121850       al  w2  x2-a4       ;
39195 121852       jl  w3     b36      ;    link(timer q, s); 
39196 121854  
39196 121854  
39196 121854       jl. w3     i14.     ;   take control
39197 121856  b3               ;     (first name table entry,
39198 121858  b6               ;      first internal,
39199 121860  b29+2*a4         ;      driver proc);
39200 121862  
39200 121862       jl. w3     i14.     ;   take control
39201 121864  b76              ;     (first secondary interrupt,
39202 121866  k                ;      irrellevant,
39203 121868  b29+2*a4         ;      driver proc);
39204 121870  
39204 121870       al. w2     i10.     ;
39205 121872       jl.       (i12.)    ;   autoloader(first core);
39206 121874  i13:e4                ;
39207 121876  
39207 121876  ; take control
39208 121876  ; comment: searches through the specified part of name table and initializes driver
39209 121876  ;          proc address.
39210 121876  
39210 121876  i14: rl  w1 (x3)         ;   entry := param 1;
39211 121878  
39211 121878  i15: am     (x3  +2)     ; next:
39212 121880       sn  w1      (0)     ;   if entry = top entry (i.e. param 2)
39213 121882       jl      x3  +6      ;      then return;
39214 121884  
39214 121884       rl  w2  x1  +0      ;   proc := nametable(entry);
39215 121886       sn  w2       0      ;   if end of table then
39216 121888       jl      x3  +6      ;      then return;
39217 121890  
39217 121890       rl  w0  x3  +4      ;   if driverproc(proc) = 0 then
39218 121892       rx  w0  x2+a250     ;      driverproc(proc) := param 3;
39219 121894       se  w0       0      ;
39220 121896       rs  w0  x2+a250     ;
39221 121898  
39221 121898       al  w1  x1  +2      ;   entry := entry + 2;
39222 121900       jl.        i15.     ;   goto next;
39223 121902  
39223 121902  ; procedure init description
39224 121902  ; call: w1 = process description address, w2 = init table
39225 121902  ; exit: w0 = core size, w1 = unchanged
39226 121902  i18: dl  w0  x2  +2      ; move words:
39227 121904       al  w2  x2  +4      ;    move contents to outpointed
39228 121906       am      x1          ;      relatives in process description
39229 121908       rs  w0  x3          ;
39230 121910       se  w3     a10      ;      until kind is moved;
39231 121912       jl.        i18.     ;
39232 121914  
39232 121914  i19: dl  w0  x2  +2      ; move bytes:
39233 121916       al  w2  x2  +4      ;    move contents to outpointed
39234 121918       am      x1          ;      relatives in process description
39235 121920       hs  w0  x3          ;
39236 121922       se  w3     a10      ;      until kind is moved;
39237 121924       jl.        i19.     ;
39238 121926       rl  w0     b12      ;
39239 121928       jl      x2          ;
39240 121930  
39240 121930  
39240 121930  i12:0                    ; after loading:
39241 121932       jl.        i10.     ;   goto initialize segment;
39242 121934  c70= k-b127 + 2
39243 121934  k=i10                   ;
39244 121326  e.                      ;
39245 121326  i.
39246 121326  e.     ; end of operating system s
39247 121326  \f


39247 121326  
39247 121326  m.
39247 121326                  moncatinit - initialisation of catalog, links ... 17.0 beta

39248 121326  
39248 121326  ;88.05.05 13.33 kak  link of dlc/ioc main deviceses
39249 121326  ;88.05.12 10.04 kak  connect and oldcat (g11) corrected to the new connect protecol
39250 121326  ;88.05.16 10.15 kak  ioc/dlc devices from the autloadlist are linked after autoload
39251 121326  ;88.06.07 11.45 kak  initial prepare dump included
39252 121326  ;88 10 06 13.27 hsi  changed text to oldcat (g11) (R15)
39253 121326  ;88 11 21 14 42 kak  bskind removed from kitlabel (always disc kind);
39254 121326  ;88 11 21 15 30 kak  number of modes increased in binin
39255 121326  ;88 11 28 10.52 kak  error in binin corrected
39256 121326  ;89 01 27 13.15 kak  a new block with stepping stones included
39257 121326  ;                    g40,...,g50  <--> g70,...,g80
39258 121326  
39258 121326  b.i30 w.
39259 121326  i0=89 01 27 
39260 121326  i1=13 15 00 
39261 121326  
39261 121326  ; if newtime (i0,i1) > oldtime (a133,a134) then oldtime:=newtime;
39262 121326  c.i0-a133
39263 121326    c.i0-a133-1, a133=i0, a134=i1, z.
39264 121326    c.i1-a134-1,          a134=i1, z.
39265 121326  z.
39266 121326  
39266 121326  i10=i0, i20=i1
39267 121326  
39267 121326  i15=i10/100000 , i10=i10-i15*100000 , i25=i20/100000 , i20=i20-i25*100000 
39268 121326  i14=i10/10000  , i10=i10-i14*10000  , i24=i20/10000  , i20=i20-i24*10000 
39269 121326  i13=i10/1000   , i10=i10-i13*1000   , i23=i20/1000   , i20=i20-i23*1000
39270 121326  i12=i10/100    , i10=i10-i12*100    , i22=i20/100    , i20=i20-i22*100
39271 121326  i11=i10/10     , i10=i10-i11*10     , i21=i20/10     , i20=i20-i21*10
39272 121326  
39272 121326  i2:  <:                              date  :>
39273 121350       (:i15+48:)<16+(:i14+48:)<8+46
39274 121352       (:i13+48:)<16+(:i12+48:)<8+46
39275 121354       (:i11+48:)<16+(:i10+48:)<8+32
39276 121356  
39276 121356       (:i25+48:)<16+(:i24+48:)<8+46
39277 121358       (:i23+48:)<16+(:i22+48:)<8+46
39278 121360       (:i21+48:)<16+(:i20+48:)<8+ 0
39279 121362  
39279 121362  i3:  al. w0  i2.       ; write date:
39280 121364       rs  w0  x2+0      ;   first free:=start(text);
39281 121366       al  w2  0         ;
39282 121368       jl      x3        ;   return to slang(status ok);
39283 121370  
39283 121370       jl.     i3.       ;
39284 121372  e.
39285 121372  j.
39285 121326                                date  89.01.27 13.15.00

39286 121326  
39286 121326  
39286 121326  ; segment 9: initialize catalog on backing store
39287 121326  s.k=k, m2, h13,g80,f60,e27,d80,c25
39288 121326  w.b127=k, c25, k=k-2
39289 121326  
39289 121326  ; segment structure:
39290 121326  ;     definitions            (c names)
39291 121326  ;     variables              (d names)
39292 121326  ;     textstrings            (e names)
39293 121326  ;     utility procedures     (f names)
39294 121326  ;     command actions        (g names)
39295 121326  ;     tables and buffers     (h names)
39296 121326  ;
39297 121326  ;     (i and j names are used locally)
39298 121326  
39298 121326    d0=k-2                ; start s:
39299 121326  
39299 121326  w.    jl.   (d40.)      ; first instruction: goto init catalog;
39300 121328  
39300 121328  h2:  h3                ; link for initcat command-table
39301 121330  
39301 121330  d54=0     , d53=1       ; first slice.cat, keys
39302 121330  d52=4                   ; interval
39303 121330  d55=6                   ; name
39304 121330  d56=14                  ; tail
39305 121330  d57=d56+0               ; size
39306 121330  d61=d56+2               ; doc name
39307 121330  d64=d56+12              ; slicelength
39308 121330  d66=d56+14, d67=d56+15  ; last slice, first reserved slice
39309 121330  
39309 121330    e5: <:result<0>:>, e6=k-2
39310 121336    e7: <:status<0>:>, e8=k-2
39311 121342  
39311 121342  ; generate  start up header.
39312 121342  ; the text generated below is printed during start up of the monitor.
39313 121342  
39313 121342  e19:
39314 121342  <:  <10>monitor release : :>
39315 121356  
39315 121356  b.i1,j1 w.
39316 121356  
39316 121356  i0=a135/10,  j0=a136/10
39317 121356  i1=a135/1 ,  j1=a136/1
39318 121356  
39318 121356  (:i0+48:)<16+(:i1-i0*10+48:)<8+46
39319 121358  (:j0+48:)<16+(:j1-j0*10+48:)<8+32
39320 121360  0
39321 121362  
39321 121362  e.
39322 121362  e20:
39323 121362  
39323 121362  <:monitor version : :>
39324 121374  
39324 121374  b.i10,j5 w.
39325 121374  
39325 121374  i0=a133/100000, j0=a134/100000
39326 121374  i1=a133/10000 , j1=a134/10000
39327 121374  i2=a133/1000  , j2=a134/1000
39328 121374  i3=a133/100   , j3=a134/100
39329 121374  i4=a133/10    , j4=a134/10
39330 121374  i5=a133/1     , j5=a134/1
39331 121374  
39331 121374       (:i0      +48:)<16+(:i1-i0*10+48:)<8+46
39332 121376       (:i2-i1*10+48:)<16+(:i3-i2*10+48:)<8+46
39333 121378       (:i4-i3*10+48:)<16+(:i5-i4*10+48:)<8+32
39334 121380       32<16+(:j0      +48:)<8+(:j1-j0*10+48:)
39335 121382       46<16+(:j2-j1*10+48:)<8+(:j3-j2*10+48:)
39336 121384       46<16+(:j4-j3*10+48:)<8+(:j5-j4*10+48:)
39337 121386  0
39338 121388  e.
39339 121388  e21:
39340 121388  
39340 121388  
39340 121388  c.a130-1
39341 121388  b.i5,j5 w.
39342 121388  i0=a130/100000, j0=a131/100000
39343 121388  i1=a130/10000 , j1=a131/10000
39344 121388  i2=a130/1000  , j2=a131/1000
39345 121388  i3=a130/100   , j3=a131/100
39346 121388  i4=a130/10    , j4=a131/10
39347 121388  i5=a130/1     , j5=a131/1
39348 121388  
39348 121388  <:date of options : :>
39349 121400       (:i0      +48:)<16+(:i1-i0*10+48:)<8+46
39350 121402       (:i2-i1*10+48:)<16+(:i3-i2*10+48:)<8+46
39351 121404       (:i4-i3*10+48:)<16+(:i5-i4*10+48:)<8+32
39352 121406       32<16+(:j0      +48:)<8+(:j1-j0*10+48:)
39353 121408       46<16+(:j2-j1*10+48:)<8+(:j3-j2*10+48:)
39354 121410       46<16+(:j4-j3*10+48:)<8+(:j5-j4*10+48:)
39355 121412  e.z.
39356 121412  <:<10><0>:>
39357 121414  e18:
39358 121414  
39358 121414  <:<10>initialize date using the date command <10>:>
39359 121442  
39359 121442  ; print out start-up head under assembly.
39360 121442  b.j0 w.
39361 121442  j0:  al. w0  e19.      ;   text:=start-up header;
39362 121444       al  w2  0         ;   status:=ok;
39363 121446       jl      x3        ;   return to slang;
39364 121448  
39364 121448       jl.     j0.       ; entry: goto start;
39365 121450  e.
39366 121450  j.
39366 121450    
monitor release : 17.00 

39367 121450  
39367 121450  b. j0 w.
39368 121450  j0:  al. w0  e20.      ; text = mon version
39369 121452       al  w2  0         ;
39370 121454       jl      x3        ; return to slang
39371 121456       jl.     j0.       ; entry: goto start
39372 121458  e.                     ;end
39373 121458  j.
39373 121458  monitor version : 91.05.02  09.06.00

39374 121458  
39374 121458  b. j0 w.
39375 121458  j0:  al. w0  e21.      ; text = mon options
39376 121460       al  w2  0         ;
39377 121462       jl      x3        ; return to slang
39378 121464       jl.     j0.       ; entry: goto start
39379 121466  e.                     ; end
39380 121466  j.
39380 121466  date of options : 90.09.27  07.45.00


39381 121466  
39381 121466  
39381 121466  
39381 121466  ; description of main catalog:
39382 121466  ; (format resembles a normal catalog-entry)
39383 121466  d8:                    ; start of entry
39384 121466       a110              ; (key)
39385 121468       a107,a108         ; (interval)
39386 121472  d9:  <:catalog:>, 0    ; name of main catalog
39387 121480  d10: -1                ; size of main catalog (initially not defined)
39388 121482       0, r.4            ; (document name)
39389 121490  d11: 0                 ; maincat shortclock
39390 121492       0                 ; (file)
39391 121494  d12: 0                 ; (no of keys or block)
39392 121496       -1                ; (contents and entry)
39393 121498       0, r.(:a88+d8.+2:)>1; (rest of tail)
39394 121500  
39394 121500  
39394 121500  
39394 121500  ; stepping stones
39395 121500  g70: jl. (2), g40
39396 121504  g71: jl. (2), g41
39397 121508  g72: jl. (2), g42
39398 121512  g73: jl. (2), g43
39399 121516  g74: jl. (2), g44
39400 121520  g75: jl. (2), g45
39401 121524  g76: jl. (2), g46
39402 121528  g77: jl. (2), g47
39403 121532  g78: jl. (2), g48
39404 121536  g79: jl. (2), g49
39405 121540  ;
39406 121540  ;
39407 121540  c.  (:g79-b110:) - (:1<14:)
39408 121540  m. address overflow in initcat command table
39409 121540  z.
39410 121540  
39410 121540  
39410 121540  ; procedure type newline
39411 121540  ;   outputs a newline char on the console
39412 121540  ;
39413 121540  ; call: w3 = link
39414 121540  ; exit: w0 = undef, w1,w2,w3 = unch
39415 121540  
39415 121540  f3:                    ; type newline:
39416 121540       al  w0     10     ;   char := newline;
39417 121542                         ;   continue with type char;
39418 121542  
39418 121542  
39418 121542  ; procedure type char
39419 121542  ;   outputs the given char on the console
39420 121542  ;   (if the char is <newline>, the buffer is sent)
39421 121542  ;   ***** note: return inf etc are not saved for reentrant use of this code!!!
39422 121542  ;
39423 121542  ; call: w0 = char, w3 = link;
39424 121542  ; exit: all regs unch
39425 121542  
39425 121542  f0:                    ; type char:
39426 121542  b. i24 w.
39427 121542       ds. w2     i0.    ;   save regs;
39428 121544       ds. w0     i1.    ;
39429 121546       rl  w2     0      ;
39430 121548  i10:                   ; put char: (w0 = w2 = char)
39431 121548       jl. w3     f42.   ;   write char (char);
39432 121550       rl. w3    (i2.)   ;   if write mode <> memory and
39433 121552       se  w3     1      ;
39434 121554       se  w2     10     ;   if char = newline then
39435 121556       jl.        i15.   ;     begin
39436 121558       jl. w3     f44.   ;     type line (buf);
39437 121560       jl. w3     f45.   ;     save work (buf);
39438 121562       am                ;+2:    error: (continue)
39439 121564                         ;     (maybe status-errors ougth to repeat a couple of times ???)
39440 121564       jl. w3     f41.   ;     init write;
39441 121566  i15:                   ;     end;
39442 121566       dl. w2     i0.    ;   restore regs;
39443 121568       dl. w0     i1.    ;
39444 121570       jl     x3         ;   return;
39445 121572  
39445 121572  
39445 121572  ; procedure typetextline (text);
39446 121572  ;   outputs the text on the console, terminated by a newline char
39447 121572  ; call: w1=text addr, w3=link
39448 121572  ; exit: w0,w1,w3=unch, w2 = undef
39449 121572  
39449 121572  f2:                    ; typetextline:
39450 121572       am         10-32  ;   char := newline;
39451 121574                         ;   continue with typeout;
39452 121574  
39452 121574  ; procedure typetext (text);
39453 121574  ;   outputs the text on the console, terminated by a space
39454 121574  ; call: w1=text addr, w3=link
39455 121574  ; exit: w0,w1,w3=unch, w2=undef
39456 121574  
39456 121574  f1:                    ; typetext:
39457 121574       al  w2     32     ;   char := space;
39458 121576       ds. w2     i0.    ;   save regs;
39459 121578       ds. w0     i1.    ;
39460 121580       jl. w3     f43.   ;   writetext (text);
39461 121582       al  w0  x2        ;
39462 121584       jl.        i10.   ;   goto put char
39463 121586  
39463 121586  i0=k+2, 0, 0           ; saved w1,w2
39464 121590  i1=k+2, 0, 0           ; saved w3,w0
39465 121594  i2:  b144              ; pointer to write mode (e54)
39466 121596  e.                     ;
39467 121596  
39467 121596  ; procedure typeresult(name,result)
39468 121596  ; comment: outputs a name and result on the console.
39469 121596  ;     call:     return:
39470 121596  ; w0  result    result
39471 121596  ; w1            unchanged
39472 121596  ; w2  link      link
39473 121596  ; w3  name      name
39474 121596  
39474 121596  b.i24                   ; begin
39475 121596  w.f5: ds. w1  i2.       ;
39476 121598        ds. w3  i3.       ;
39477 121600        al  w1  x3+0      ; 
39478 121602        jl. w3  f1.       ;   typeout(name);
39479 121604        al. w1  e5.       ;
39480 121606        jl. w3  f1.       ;   typeout(<:result:>);
39481 121608        wa. w0  i1.       ;
39482 121610        jl. w3  f0.       ;   typechar(result+48);
39483 121612  i0:                    ; end with newline:
39484 121612       jl. w3     f3.    ;   type newline;
39485 121614        dl. w1  i2.       ;
39486 121616        dl. w3  i3.       ;
39487 121618        jl      x2+0      ;
39488 121620    i1: 48                ;
39489 121622        0, i2: 0          ;
39490 121626        0, i3: 0          ; end
39491 121630  
39491 121630  ; procedure typestatus(name,status)
39492 121630  ; comment: outputs a name and the number of the
39493 121630  ; leftmost status bit.
39494 121630  ;     call:     return:
39495 121630  ; w0  status    status
39496 121630  ; w1            unchanged
39497 121630  ; w2  link      link
39498 121630  ; w3  name      name
39499 121630  
39499 121630                          ; begin
39500 121630  w.f6: ds. w1  i2.       ;
39501 121632        ds. w3  i3.       ;
39502 121634        al  w1  x3+0      ;
39503 121636        jl. w3  f1.       ;   typeout(name);
39504 121638        al. w1  e7.       ;
39505 121640        jl. w3  f1.       ;   typeout(<:status:>);
39506 121642        rl  w1  0         ;   w1 := status;
39507 121644        al  w2  -1        ;
39508 121646    i4: sl  w1  0         ; rep:
39509 121648        am      46-49     ;   if leftmost bit(w1) = 0 then
39510 121650        al  w0  49        ;     outchar(point) else
39511 121652        jl. w3  f0.       ;     outchar(one);
39512 121654        ld  w2  1         ;   w1 := w1 shift 1;
39513 121656        se  w2  0         ;   if not all status is printed then
39514 121658        jl.     i4.       ;     goto rep;
39515 121660        jl.     i0.       ;   goto end with newline;
39516 121662  e.                      ; end
39517 121662  
39517 121662  ; procedure inchar(char, trouble)
39518 121662  ; comment: inputs the next character from the <input>
39519 121662  ;     call:     return:
39520 121662  ; w0            char
39521 121662  ; w1            unchanged
39522 121662  ; w2            unchanged
39523 121662  ; w3  link      link
39524 121662  
39524 121662  b.i24                   ; begin
39525 121662  w.f7: ds. w2  i8.       ;
39526 121664        rs. w3  i9.       ;
39527 121666        rl. w2  d18.      ;
39528 121668        al  w2  x2+1      ;   cur char:=cur char+1;
39529 121670    i0: rs. w2  d18.      ;   while cur char=characters do
39530 121672        se. w2 (d17.)     ;   begin
39531 121674        jl.     i3.       ;
39532 121676        jl. w3   f9.      ;   inblock
39533 121678        jl.    (i9.)      ;+2:  trouble:  goto trouble;
39534 121680        jl.     i4.       ;+4:  end area: goto simulated end-character;
39535 121682                          ;+6:  ok:
39536 121682        al  w2  0         ;   end;
39537 121684        jl.     i0.       ;   cur char:=0;
39538 121686    i3: al  w1  0         ;   end;
39539 121688        wd. w2  i6.       ;
39540 121690        ls  w1  3         ;   pos:=(cur char mod 3)*8-16;
39541 121692        ls  w2  1         ;
39542 121694        wa. w2  d22.      ;   addr:=input buf+cur char/3*2;
39543 121696        rl  w0  x2+0      ;
39544 121698        ls  w0  x1-16     ;   char:=word(addr) shift pos;
39545 121700        sz  w0  255       ;   if char = null-char then
39546 121702        jl.     i5.       ;     begin
39547 121704        rl. w1  d40.      ;     if modekind <> tro then
39548 121706        sn  w1  m2        ;
39549 121708        jl.     i5.       ;
39550 121710  i4:                     ; simulated end-char:
39551 121710        al  w0  255       ;       char := 255;
39552 121712        jl.     i10.      ;     end
39553 121714  i5:                     ;   else
39554 121714        la. w0  i7.       ;     char := char extract 7;
39555 121716  i10:                    ;
39556 121716        dl. w2  i8.       ;
39557 121718        rl. w3  i9.       ;
39558 121720        jl      x3+2      ;
39559 121722    i6: 3                 ;
39560 121724    i7: 8.177             ;
39561 121726        0, i8: 0          ;
39562 121730    i9: 0                 ;
39563 121732  e.                      ; end
39564 121732  
39564 121732  ; procedure inword(word, trouble, endseg)
39565 121732  ; comment: inputs a binary word from the <input>. at the
39566 121732  ; end of an input segment the checksum is checked.
39567 121732  ;     call:     return:
39568 121732  ; w0            word
39569 121732  ; w1            unchanged
39570 121732  ; w2            unchanged
39571 121732  ; w3  link      link
39572 121732  
39572 121732  b.i24                   ; begin
39573 121732  w.f8: ds. w2  i7.       ;
39574 121734        rs. w3  i8.       ;
39575 121736        al  w0  0         ;   word:=0;
39576 121738        al  w1  18        ;   pos:=18;
39577 121740        rl. w2  d35.      ;   
39578 121742    i0: rs. w0  i6.       ;   repeat
39579 121744        jl. w3  f7.       ;   inchar(char, trouble);
39580 121746        jl.    (i8.)      ;
39581 121748        sl  w0  64        ;   if char>63
39582 121750        jl.     i1.       ;   then goto checksum;
39583 121752        wa  w2  0         ;   sum:=sum+char;
39584 121754        ls  w0  x1+0      ;
39585 121756        lo. w0  i6.       ;   word:=word or char shift pos;
39586 121758        al  w1  x1-6      ;   pos:=pos-6;
39587 121760        sl  w1  0         ;   until pos<0;
39588 121762        jl.     i0.       ;
39589 121764        rs. w2  d35.      ;
39590 121766        dl. w2  i7.       ;
39591 121768        rl. w3  i8.       ;
39592 121770        jl      x3+4      ;   goto exit;
39593 121772    i1: se  w1  18        ; checksum:
39594 121774        jl.     i2.       ;   if pos<>18
39595 121776        sn  w0  255       ;   (if null-char read
39596 121778        se  w2  0         ;     and sum=0 then
39597 121780        jl.     i9.       ;     begin
39598 121782        dl. w2  i7.       ;     restore (w1, w2);
39599 121784        sn  w1  x2        ;     if null-char allowed then
39600 121786        jl.    (i10.)     ;       goto end-action;
39601 121788        jl.     i2.       ;     goto sumerror;
39602 121790    i9:                   ;     end)
39603 121790        la. w0  i4.       ;
39604 121792        la. w2  i4.       ;   or char(18:23)<>sum(18:23)
39605 121794        sn  w0  x2+0      ;
39606 121796        jl.     i3.       ;   then
39607 121798    i2: al. w1  e9.       ;   begin
39608 121800       jl. w3  f2.       ;   type textline (<:input sumerror:>);
39609 121802        jl.    (i8.)      ;   end;
39610 121804    i3: al  w0  0         ;
39611 121806        rs. w0  d35.      ;   sum:=0;
39612 121808        dl. w2  i7.       ;
39613 121810        rl. w3  i8.       ;
39614 121812        jl      x3+2      ;   goto endseg;
39615 121814    i4: 8.77              ;
39616 121816    i5: 0, i6: 0          ;
39617 121820        0, i7: 0          ;
39618 121824    i8: 0                 ; exit:
39619 121826    i10:g54               ; end-action address
39620 121828  e.                      ; end
39621 121828  
39621 121828  ; procedure inoutseg(name, mess, trouble)
39622 121828  ; comment: inputs or outputs the load buffer from or to the backing store
39623 121828  ;     call:     return:
39624 121828  ; w0            logical status
39625 121828  ; w1  mess    mess
39626 121828  ; w2  link      link
39627 121828  ; w3  name      name
39628 121828  
39628 121828  b.i24                   ; begin
39629 121828  w.f10:am      3-5       ; input:
39630 121830    f12:al  w0  5         ; output:
39631 121832        hs  w0  x1        ;   set operation in message;
39632 121834        ds. w3  i5.       ;
39633 121836        rs. w1  i6.       ;
39634 121838        jd  1<11+16       ;   send mess(name,area mess,buf);
39635 121840        al. w1  d15.      ;   wait answer(buf,answer,result);
39636 121842        jd      1<11+18   ;
39637 121844        al  w2  1         ;   logical status :=
39638 121846        ls  w2 (0)        ;     1 shift result
39639 121848        sn  w2  1<1       ;
39640 121850        lo  w2  x1        ;     + if ok then status;
39641 121852        al  w0  x2        ;   w0 := logical status;
39642 121854        dl. w2  i4.       ;   restore(w1,w2);
39643 121856        se  w0  1<1       ;   if any errors then
39644 121858        jl.     f6.       ;     type status (logical status) and trouble return;
39645 121860        rl  w3  x1+6      ;
39646 121862        al  w3  x3+1      ;
39647 121864        rs  w3  x1+6      ;   cur seg:=cur seg+1;
39648 121866        rl. w3  i5.       ;
39649 121868        jl      x2+2      ;
39650 121870    i3: 1<18              ;
39651 121872    i6: 0                 ; saved message address
39652 121874    i4: 0, i5: 0          ;
39653 121878  e.                      ; end
39654 121878  
39654 121878  ; procedure clear(first,last)
39655 121878  ; comment: initializes a storage area with -1.
39656 121878  ;     call:     return:
39657 121878  ; w0            -1
39658 121878  ; w1  last      last
39659 121878  ; w2  first     last+2
39660 121878  ; w3  link      link
39661 121878  
39661 121878  b.i24                   ; begin
39662 121878  w.f11:al  w0  -1        ;
39663 121880    i0: rs  w0  x2+0      ;   repeat
39664 121882        al  w2  x2+2      ;   word(first):=-1;
39665 121884        sh  w2  x1+0      ;   first:=first+2;
39666 121886        jl.     i0.       ;   until first=last+2;
39667 121888        jl      x3+0      ;
39668 121890  e.                      ; end
39669 121890  
39669 121890  ; read block
39670 121890  ;
39671 121890  ; return address: link+0: trouble
39672 121890  ;                     +2: end area
39673 121890  ;                     +4: ok      (w2 = start of buffer)
39674 121890  ;
39675 121890  ; comment delivers one block from input;
39676 121890  ;             call     return
39677 121890  ;     w0       -       destroyed
39678 121890  ;     w1       -       destroyed
39679 121890  ;     w2       -       start of buffer
39680 121890  ;     w3      link     destroyed
39681 121890  ; on return d17 is initialized
39682 121890  
39682 121890  b. i20, j10
39683 121890  w.
39684 121890  
39684 121890  f9:  am         3-5     ; read double buffered:
39685 121892  f13: al  w0     5       ; write double buffered:
39686 121894       rx. w3     j3.     ;   save (return);  get mess addr;
39687 121896       hs  w0 (x3+8)      ;   save (operation) in opposite message;
39688 121898       rl  w2  x3+10      ;   get buffer address;
39689 121900  i0:  al. w1    d15.     ; wait: get answer address;
39690 121902       rs. w3    d42.     ;   save current message address;
39691 121904       jd     1<11+18     ;   wait transfer;
39692 121906       se  w0      1      ;   if result <> 1 then
39693 121908       jl.        i1.     ;   goto result error;
39694 121910       rl  w0  x1+0       ;   test status;
39695 121912       sz. w0    (j0.)    ;   if any error then
39696 121914       jl.        i2.     ;   goto read error;
39697 121916  i6:  rl  w0  x3+2       ; continue:   
39698 121918       rs. w0    d22.     ;   save buffer start;
39699 121920       rl  w2  x1+2       ;   no of characters :=
39700 121922       ls  w2     -1      ;   no of bytes +
39701 121924       wa  w2  x1+2       ;   no of no of bytes//2;
39702 121926       rs. w2     d17.    ;
39703 121928       rl  w2  x1+2       ;   w2 := bytes transferred;
39704 121930       ls  w2    -9       ;
39705 121932       wa  w2  x3+6       ;   w2 := segm := segms transferred + last segm;
39706 121934       rl  w1  x3+8       ;   get new message address;
39707 121936  i5:                     ; start transfer:
39708 121936       rs  w2  x1+6       ;   save segmno in message;
39709 121938  
39709 121938  ; prepare an empty catalog buffer, in case of kitlabel
39710 121938       dl  w3  x1+4       ;   w2 := first of buffer;  w3 := last of buffer;
39711 121940       al  w0    -1       ;
39712 121942  i10: rs  w0  x2         ;   clear all buffer;
39713 121944       al  w2  x2+2       ;
39714 121946       se  w2  x3         ;
39715 121948       jl.        i10.    ;
39716 121950       al  w0     0       ;   last word of buffer := 0;
39717 121952       rs  w0  x2         ;
39718 121954       rs. w0     j4.     ;   error count := 0;
39719 121956  
39719 121956       al. w3     e1.     ;   w3 := name;
39720 121958       jd     1<11+16     ;   start transfer;
39721 121960       rs  w2  x1+10      ;   save buffer address;
39722 121962       rl. w2     d22.    ;   w2 := start of buffer;
39723 121964       rx. w1     j3.     ;   save message address;
39724 121966       jl      x1+4       ;   return;
39725 121968  
39725 121968  ; result error
39726 121968  i1:  al. w1     f6.     ;
39727 121970        al  w2  1         ;
39728 121972        ls  w2 (0)        ;   logical status := 1 shift result;
39729 121974        al  w0  x2        ;
39730 121976       jl.        i4.     ;   out error(type result);
39731 121978  
39731 121978  ; read error
39732 121978  i2:  rl. w2     d40.    ;   w2 := modekind;
39733 121980       sn  w2     m2      ;   if kind = <tr> then goto
39734 121982       jl.        i7.     ;     goto test end of tape;
39735 121984       rs. w3     j2.     ;   save message address;
39736 121986       sn  w2     m0      ;   if kind = <bs> then
39737 121988       jl.        i11.    ;     goto test end area;
39738 121990       so. w0    (j1.)    ;   if not parity error then
39739 121992       jl.        i3.     ;     goto hard error;
39740 121994       al. w1     j5.     ;   insert move message address;
39741 121996       al. w3     e1.     ;   insert name address;
39742 121998       jd     1<11+16     ;
39743 122000       al. w1    d15.     ;   insert answer address;
39744 122002       jd     1<11+18     ;   wait move;
39745 122004       rl. w0     j1.     ;   (status := parity error);
39746 122006  i9:                     ; repeat:
39747 122006       rl. w1     j4.     ;
39748 122008       al  w1  x1+1       ;   increase (error count);
39749 122010       rs. w1     j4.     ;
39750 122012       sl  w1     5       ;   if error count >= max then
39751 122014       jl.        i3.     ;     goto hard error;
39752 122016       al. w3     e1.     ;   w3 := name;
39753 122018       rl. w1     j2.     ;   restore message address;
39754 122020       jd     1<11+16     ;   start new input;
39755 122022       rl  w3      2      ;   w3 := message address;
39756 122024       jl.        i0.     ;   goto wait;
39757 122026  
39757 122026  i11:                    ; test end area:
39758 122026       so. w0    (j10.)   ;   if not end document then
39759 122028       jl.        i9.     ;     goto repeat;
39760 122030  i13:                    ; end document:
39761 122030       al  w2     0       ;   pending answer := false;
39762 122032       rx. w2     j3.     ;
39763 122034       jl      x2+2       ;   goto end-area return;
39764 122036  
39764 122036  ; hard error:
39765 122036  i3:  al. w1     f6.     ;   out error( type status);
39766 122038        al  w2  1<1       ;   logical status := status + (result ok) shift 1;
39767 122040        lo  w0  4         ;
39768 122042  
39768 122042  ; out error:
39769 122042  i4:  al. w3     e1.     ;   get name address;
39770 122044       jl  w2  x1+0       ;   type error;
39771 122046       al  w2     0       ;   pending answer := false;
39772 122048       rx. w2     j3.     ;
39773 122050       jl      x2         ;   goto error return;
39774 122052  
39774 122052  ; test end of tape
39775 122052  i7:  sz. w0    (j6.)    ;   if end of tape then
39776 122054       jl.        i12.    ;     goto test empty;
39777 122056       jl.        i3.     ;   goto hard error;
39778 122058  
39778 122058  ; test empty: if nothing was read from the paper tape reader then
39779 122058  ;             return via end-document-return;
39780 122058  i12: rl  w2  x1+2       ;   if bytes transferred <> 0 then
39781 122060       se  w2     0       ;     goto continue;
39782 122062       jl.        i6.     ;
39783 122064       jl.        i13.    ;   goto end document;
39784 122066  
39784 122066  
39784 122066  ; procedure start transfer
39785 122066  ; comment initializes reading from input
39786 122066  ;          call     return
39787 122066  ;     w0    -       destroyed
39788 122066  ;     w1    -       destroyed
39789 122066  ;     w2    -       destroyed
39790 122066  ;     w3   link     destroyed
39791 122066  
39791 122066  f15: am         3-5     ; start transfer input:
39792 122068  f16: al  w0     5       ; start transfer output:
39793 122070       ls  w0     12      ;
39794 122072       hl. w0     d40.    ;   w0 := operation shift 12 + mode;
39795 122074  
39795 122074       al  w3  x3-4       ;   (prepare ok return via start-transfer-action)
39796 122076  
39796 122076       rs. w3     j3.     ;   save return;
39797 122078       al. w1    d38.     ;
39798 122080       al. w2    d39.     ;   get message addresses;
39799 122082       rs  w0  x1         ;   save operation and mode in messages;
39800 122084       rs  w0  x2         ;
39801 122086       rs  w1  x2+8       ;   establish chain;
39802 122088       rs  w2  x1+8       ;
39803 122090       al  w0     512-2   ;   block length := 512 bytes;
39804 122092       rl. w3     j7.     ;
39805 122094                          ;   insert buffer addresses;
39806 122094       rs  w3  x1+2       ;
39807 122096       wa  w3      0      ;
39808 122098       rs  w3  x1+4       ;
39809 122100       al  w3  x3+2       ;
39810 122102       rs  w3  x2+2       ;
39811 122104       wa  w3      0      ;
39812 122106       rs  w3  x2+4       ;
39813 122108  
39813 122108       al. w3     e1.     ;   w3 := name;
39814 122110       jd         1<11+8  ;   reserve process;
39815 122112  
39815 122112       rl. w2     d41.    ;   w2 := first segment;
39816 122114       rl. w0     d40.    ;   w0 := kind;
39817 122116       bz  w0     1       ;
39818 122118       se  w0     m1      ;   if kind <> <mt> then
39819 122120       jl.        i5.     ;     goto start transfer;
39820 122122  
39820 122122       rs. w2     j9.     ;   save position in setposition-message;
39821 122124       al. w1     j8.     ;
39822 122126       bz. w0     d40.    ;   mode.message := mode;
39823 122128       hs  w0  x1+1       ;
39824 122130       jd         1<11+16 ;   send message (setposition);
39825 122132       al. w1     d15.    ;
39826 122134       jd         1<11+18 ;   wait answer;  (no status check)
39827 122136  
39827 122136       al. w1     d38.    ;   w1 := first message;
39828 122138       jl.        i5.     ;   goto start transfer;
39829 122140  
39829 122140  
39829 122140  ; procedure end transfer
39830 122140  ; comment the last answer is checked.
39831 122140  ;
39832 122140  ;   registers     call      return
39833 122140  ;      w0          -      destroyed
39834 122140  ;      w1          -      destroyed
39835 122140  ;      w2          -      destroyed
39836 122140  ;      w3         link    name
39837 122140  
39837 122140  f17: rx. w3     j3.     ;   save return;
39838 122142       sn  w3      0      ;   if no pending answer then
39839 122144       jl.        i8.     ;   goto exit;
39840 122146       rl  w2  x3+10      ;   get buffer address
39841 122148       al. w1    d15.     ;   insert answer address;
39842 122150       jd     1<11+18     ;   wait answer;
39843 122152  i8:  al  w2      0      ; exit:
39844 122154       rx. w2     j3.     ;   change(0, return);
39845 122156       al. w3     e1.     ;   w3 := name;
39846 122158       jd         1<11+10 ;   release process(name);
39847 122160       jl      x2+0       ;   return;
39848 122162  
39848 122162  j0:  8.77 20 00 00      ;   error bits
39849 122164  j1:  8.20 00 00 00      ;   parity error bit
39850 122166  j2:              0      ;   saved message address
39851 122168  j3:              0      ;   saved return or message address
39852 122170  j4:              5      ;   error count
39853 122172  j5:       8<12,  3      ;   backspace message
39854 122176  j6:  8.01 20 00 00      ;   end of tape bit
39855 122178  j7:  h10                ; 1. input buffer
39856 122180  j8:  8 < 12             ; move operation:
39857 122182       6                  ;   setposition
39858 122184  j9:  0                  ;   file number
39859 122186       0                  ;   (block = 0)
39860 122188  j10: 1<18               ; end document status
39861 122190  
39861 122190  e.
39862 122190  ; procedure read chain   f26
39863 122190  ; procedure write chain  f27
39864 122190  ;
39865 122190  
39865 122190  
39865 122190  
39865 122190  ; procedure read  chain and prepare bs
39866 122190  ; procedure write chain and prepare bs
39867 122190  ;
39868 122190  ; the chainbuffer is either read from the device or written onto the device
39869 122190  ;   given by ..device number..
39870 122190  ;
39871 122190  ; call: w3 = link
39872 122190  ; exit: link+0: error    (all regs undef)
39873 122190  ;           +2: ok       (w3 = chainhead address, other regs undef)
39874 122190  
39874 122190  b. i30, j10 w.
39875 122190  f26: am         3-5    ; read chain
39876 122192  f27: al  w0       5    ; write chain
39877 122194       hs. w0     j1.    ; set operation
39878 122196       al  w0      -1    ; prepare bs := false
39879 122198       jl.        i2.    ;
39880 122200  
39880 122200  
39880 122200  f21: am         3-5    ; read chain:
39881 122202  f22: al  w0     5      ; write chain:
39882 122204       hs. w0     j1.    ;    set operation in message;
39883 122206       al  w0       0    ; prepare bs := true
39884 122208  i2 : rs. w0     j9.    ;
39885 122210  
39885 122210       rs. w3     j0.    ;    save (return);
39886 122212  
39886 122212       jl. w3     f39.   ;    move catname,docname to chainhead;
39887 122214                         ;    (in case of write chain)
39888 122214  
39888 122214  ; give the device a wrk-name and reserve it
39889 122214       al. w3     j5.    ;    w3 := wrk-name address;
39890 122216       al  w0     0      ;
39891 122218       rs. w0     j6.    ;    (repeat count := 0;)
39892 122220       rs  w0  x3        ;    (clear first of name to get a new wrk-name)
39893 122222       rs  w0  x3+8      ;    (clear name table address)
39894 122224  
39894 122224  ; convert device number to text
39895 122224       rl. w1     d43.   ;    w0w1 := devno;
39896 122226       wd. w1     j8.    ;
39897 122228       rl  w2     0      ;    w2 := last digit;
39898 122230       al  w0     0      ;
39899 122232       wd. w1     j8.    ;
39900 122234       ld  w1     8      ;
39901 122236       ls  w1     8      ;
39902 122238       wa  w2     0      ;    w2 := two rigthmost digits;
39903 122240       wa  w2     2      ;    w2 := three digits;
39904 122242       lo. w2     j7.    ;    convert digits to letters;
39905 122244       rs. w2     (j10.) ;    save in text;
39906 122246  
39906 122246  i0:                    ; create process:
39907 122246       rl. w1     d43.   ;    w1 := devno;
39908 122248       jd         1<11+54;    create peripheral process (wrkname, devno);
39909 122250       se  w0     0      ;    if result not ok then
39910 122252       jl.        i10.   ;      goto alarm;
39911 122254  
39911 122254       jd         1<11+8 ;    reserve process;
39912 122256       se  w0     0      ;    if result not ok then
39913 122258       jl.        i11.   ;      goto alarm;
39914 122260  
39914 122260  ; start reading/writing one segment, and later read/write the rest
39915 122260  
39915 122260       rl. w1     j2.    ;    addr := first address of chainhead buffer;
39916 122262  
39916 122262  i1:                    ; try greater size of transfer:
39917 122262       al  w1  x1+510+1  ;    last.mess :=
39918 122264       rs. w1     j3.    ;      addr + 510 + round up;
39919 122266  
39919 122266       al. w1     j1.    ;
39920 122268       jd         1<11+16;    send message;
39921 122270       al. w1     d15.   ;
39922 122272       jd         1<11+18;    wait answer;
39923 122274       al  w2     1      ;
39924 122276       ls  w2    (0)     ;    w2 := logical status.answer;
39925 122278       sn  w0     1      ;
39926 122280       lo  w2  x1        ;
39927 122282       sn  w2     1<1    ;    if no errors then
39928 122284       jl.        i5.    ;      goto test transferred;
39929 122286  
39929 122286  ; the only allowed error is disconnected (or intervention)
39930 122286       se  w2     1<5    ;    if not after intervention then
39931 122288       jl.        i12.   ;      goto alarm;
39932 122290  
39932 122290  ; intervention is only allowed a limited number of times
39933 122290       rl. w1     j6.    ;
39934 122292       al  w1  x1+1      ;    increase (repeat count);
39935 122294       rs. w1     j6.    ;
39936 122296       se  w1     2      ;    if first time then
39937 122298       jl.        i0.    ;      goto create process;
39938 122300  
39938 122300       bz. w0     j1.    ;
39939 122302       sn  w0     3      ;    if operation = input then
39940 122304       jl.       (j0.)   ;      return (no chain);
39941 122306       jl.        i13.   ;    goto alarm;
39942 122308  
39942 122308  
39942 122308  i5:                    ; test transferred:
39943 122308       rl. w1     j2.    ;    w1 := first of chainhead buffer;
39944 122310       bz  w2  x1+d66    ;    w2 := last slice number.chainhead
39945 122312       al  w2  x2+a88+1-1;        + size of chainhead + 1;
39946 122314       wa  w1     4      ;    addr := first + bytes in chain;
39947 122316       sl. w2    (d14.)  ;    if bytes in chain > bytes transferred then
39948 122318       jl.        i1.    ;      goto try greater size of transfer;
39949 122320  
39949 122320  ; the chainhead has been transferred succesfully:
39950 122320  
39950 122320       jl. w3     f39.   ;    move catname,docname to chainhead;
39951 122322                         ;    (in case of read chain, i.e. after  kit <name> )
39952 122322  
39952 122322  ; the chainbuffer now contains a chainhead
39953 122322  
39953 122322       al. w3     j5.    ;
39954 122324       jd         1<11+64;    remove process(wrk-name);
39955 122326       rl. w3     j2.    ; if not prepare bs then
39956 122328       rl. w0     j9.    ;
39957 122330       sn  w0      -1    ; then return
39958 122332       jl.        i9.    ;
39959 122334  
39959 122334       jl. w3     f38.   ;    move catname,docname from chainhead;
39960 122336                         ;    (in case of read chain, i.e. after  kit <devno> )
39961 122336  
39961 122336       rl. w1     d43.   ;    w1 := device number;
39962 122338       al. w3     e2.    ;    w3 := docname;
39963 122340       jd         1<11+54;    create peripheral process (docname, devno);
39964 122342       se  w0     0      ;    if result not ok then
39965 122344       jl.        i14.   ;      goto alarm;
39966 122346       jd         1<11+8 ;    reserve process (docname);
39967 122348  
39967 122348       rl. w3     j2.    ;    w3 := chainhead buffer;
39968 122350       jd         1<11+102;   prepare bs (chainhead);
39969 122352       se  w0     0      ;    if result not ok then
39970 122354       jl.        i15.   ;      goto alarm;
39971 122356  
39971 122356  i9 : am.       (j0.)   ;
39972 122358       jl        +2      ;    return ok;
39973 122360  
39973 122360  
39973 122360  i10:                   ; error at create wrk-name:
39974 122360       jl. w1     i20.   ;
39975 122362       <:create peripheral process wrkname<0>:>
39976 122386  
39976 122386  i11:                   ; error at reserve process wrk-name:
39977 122386       jl. w1     i20.   ;
39978 122388       <:reserve process wrkname<0>:>
39979 122404  
39979 122404  i12:                   ; error at transfer:
39980 122404       jd         1<11+64;    remove process (wrk name);
39981 122406       al  w0  x2        ;    w0 := logical status;
39982 122408       al. w3     d47.   ;    w3 := <:on <devno>:>;
39983 122410       jl. w2     f6.    ;    typestatus (text, status);
39984 122412       jl.       (j0.)   ;    return (no chain);
39985 122414  
39985 122414  i13:                   ; intervention:
39986 122414       jd         1<11+64;    remove process (wrk name);
39987 122416       jl. w1     i20.   ;
39988 122418       <:intervention<0>:>
39989 122428  
39989 122428  i14:                   ; error at create peripheral process:
39990 122428       jl. w1     i20.   ;
39991 122430       <:create peripheral process documentname<0>:>
39992 122456  
39992 122456  i15:                   ; error at prepare bs:
39993 122456       rl  w2     0      ;    save (result);
39994 122458       al  w3  x3+d61    ;
39995 122460       jd         1<11+64;    remove process (doc name.chain buffer);
39996 122462       al  w0  x2        ;    restore (result);
39997 122464       jl. w1     i20.   ;
39998 122466       <:prepare bs<0>:>
39999 122474  
39999 122474  i20:                   ; outerror:
40000 122474  
40000 122474       jl. w3     f1.    ;    typeout (text);
40001 122476  
40001 122476       al. w3     d47.   ;    w3 := <:on <devno>:>;
40002 122478       jl. w2     f5.    ;    typeresult (text, result);
40003 122480  
40003 122480       jl.       (j0.)   ;    return (no chain);
40004 122482  
40004 122482  
40004 122482  
40004 122482  j0:  0                 ; return
40005 122484  j1:  5<12+0            ; message: operation
40006 122486  j2:  h8                ;          first address
40007 122488  j3:  0                 ;          last address
40008 122490       0 ; always        ;          segment number
40009 122492  j5:  0, r.5            ; wrkname (+ name table address)
40010 122502  j6:  0                 ; repeat count
40011 122504  j7:  <:000:>           ; mask for converting to letters
40012 122506  j8:  10                ; constant for converting ti digits
40013 122508  j9: 0                  ; boolean : prepare bs ; 0: true -1 :false
40014 122510  j10:  d48               ; pointer to text
40015 122512  
40015 122512  e.                     ;
40016 122512  
40016 122512  
40016 122512  ; procedure insert all entries
40017 122512  ;
40018 122512  ; call: w3 = link
40019 122512  ; exit: link+0: trouble
40020 122512  ;       link+2: ok      (w3 = chainhead, other regs undef)
40021 122512  
40021 122512  b. i30, j20 w.
40022 122512  
40022 122512  j0:  0                 ; return
40023 122514  j1:  0                 ; writeback  (0==false, else true)
40024 122516  j2:  0                 ; error in segment
40025 122518  j3:  h8                ; start of chainhead
40026 122520  j4:  0                 ; top segmentno
40027 122522  j5:  0                 ; cur segmentno
40028 122524  j6:  8.20000000        ; status: parity
40029 122526  j7: <:segment<0>:>
40030 122532  j8: <:entry deleted<0>:>
40031 122542  j9: <:repair not possible<0>:>
40032 122556  j10: <:insert entry<0>:>
40033 122566  j11: <:entry format (head)<0>:>
40034 122580  j12: <:+0: first slice, keys:<0>:>
40035 122596  j13: <:+2: lower upper base :<0>:>
40036 122612  j14: <:+6: name             :<0>:>
40037 122628  j15: <:size trouble - end area at segment<0>:>
40038 122652  
40038 122652  j17: 0                 ; save w0 (for subroutines)
40039 122654  j18: 0                 ;  "   w1 ( "     - " -   )
40040 122656  j19: 0                 ;  "   w2 ( "     - " -   )
40041 122658  j20: 0                 ;  "   w3 ( "     - " -   )
40042 122660  
40042 122660  
40042 122660  f23:                   ; insert all entries:
40043 122660       rs. w3     j0.    ;    save (return);
40044 122662  
40044 122662       al  w0     m0     ;
40045 122664       rs. w0     d40.   ;    modekind := bs;
40046 122666       al  w0     0      ;
40047 122668       rs. w0     d41.   ;    first segment := 0;
40048 122670       rs. w0     j1.    ;    writeback := false;
40049 122672       rs. w0     j5.    ;    cur segmentno := 0;
40050 122674       rl. w3     j3.    ;
40051 122676       rl  w1  x3+d57    ;    top segmentno := aux catalogsize;
40052 122678       rs. w1     j4.    ;
40053 122680  
40053 122680       jl. w3     f15.   ;    start transfer input;
40054 122682  
40054 122682  i2:                    ; next auxcat segment:
40055 122682       al  w0     0      ;
40056 122684       rs. w0     j2.    ;    error in segment := false;
40057 122686       rx. w0     j1.    ;    writeback := false;
40058 122688       sn  w0     0      ;    if writeback was false already then
40059 122690       jl.        i5.    ;      goto read;
40060 122692  
40060 122692  ; the catalog segment was inconsistent in some way
40061 122692  
40061 122692  ; the segment must be written back:
40062 122692       rl. w1     d42.   ;    w1 := current message address;
40063 122694       al. w3     e1.    ;    w3 := catname;
40064 122696       jl. w2     f12.   ;    outsegment (name, buffer);
40065 122698       jl.        i20.   ;+2:   trouble:  goto alarm;
40066 122700                         ;comment start the inputoperation again -
40067 122700                         ;    it has been stoped after a read error;
40068 122700       jl. w3     f15.   ;    start transfer;
40069 122702  
40069 122702  i5:                    ; read:
40070 122702       dl. w2     j5.    ;    if cur segmentno = top segmentno then
40071 122704       sl  w2     (2)    ;
40072 122706       jl.        i15.   ;      goto terminate;
40073 122708                         ;
40074 122708       jl. w3     f9.    ;    input block;
40075 122710       jl.        i21.   ;+0:   trouble: goto test status;
40076 122712       jl.        i17.   ;+2:   endarea: goto end area error return;
40077 122714                         ;+4:   ok:
40078 122714  i6:                    ;    (and enter here after teststatus = parity)
40079 122714  
40079 122714  ; w2 = start of buffer
40080 122714       al  w1  x2-a88    ;    entry := base of buffer;
40081 122716       al  w2  x2+510    ;    top := top of last entry;
40082 122718  
40082 122718  i8:                    ; next entry:
40083 122718  ; w1 = old entry addr
40084 122718  ; w2 = top entry
40085 122718  
40085 122718       al  w1  x1+a88    ;    increase (entry);
40086 122720       sl  w1  x2        ;    if all entries processed then
40087 122722       jl.        i16.   ;      goto increment;
40088 122724  
40088 122724       rl  w0  x1        ;    if empty entry then
40089 122726       sn  w0    -1      ;
40090 122728       jl.        i8.    ;      goto next entry;
40091 122730       rl. w0     j2.    ;    if not error insegment then
40092 122732       se  w0     0      ;
40093 122734       jl.        i10.   ;
40094 122736       jl. w3     i13.   ;    begin
40095 122738                         ;      normalinsert(result);
40096 122738       jl.        i8.    ;      goto nextentry;
40097 122740                         ;    end;
40098 122740  i10:                   ;
40099 122740       rl. w0     j1.    ;    if not writeback then
40100 122742       sn  w0     0      ;
40101 122744       jl.        i16.   ;      goto increment;
40102 122746                         ;comment
40103 122746                         ;    there has been a parity error in the catalog
40104 122746                         ;    segment - contens of segment is perhaps undefined.
40105 122746                         ;    show the entry and try to insert it.
40106 122746                         ;
40107 122746       jl. w3     i14.   ;    printentry(entry);
40108 122748       jl. w3     i13.   ;    normalinsert(result);
40109 122750       se  w0     5      ;    if result=5 or result=6 then
40110 122752       sn  w0     6      ;
40111 122754       jl.        i11.   ;      goto deleteentry;
40112 122756       jl.        i8.    ;    goto nextentry;
40113 122758  
40113 122758  i11: al  w0     -1     ;    importen information in the entry has been
40114 122760       rs  w0  x1+d54    ;    destroyed - delete it!
40115 122762                         ;
40116 122762       ds. w2     j19.   ;
40117 122764       al. w1     j8.    ;    typetextline(<:entry deleted:>);
40118 122766       jl. w3     f2.    ;
40119 122768  
40119 122768       dl. w2     j19.   ;
40120 122770       jl.        i8.    ;    goto next entry;
40121 122772                         ;
40122 122772                         ;
40123 122772  i16:                   ; increment:
40124 122772       rl. w1     j5.    ;    cur segmentno := cursegment + 1;
40125 122774       al  w1  x1+1      ;
40126 122776       rs. w1     j5.    ;
40127 122778       jl.        i2.    ;    goto next auxcat segment;
40128 122780                         ;
40129 122780                         ;
40130 122780  i13:                   ; normal insert;
40131 122780       ds. w2     j19.   ;    save regs.
40132 122782       rs. w3     j20.   ;
40133 122784  
40133 122784       rl. w3     j3.    ;    insert entry(entry, chainhead);
40134 122786       jd      1<11+104  ;
40135 122788       se  w0     0      ;    if result=ok or result=maincat not present then
40136 122790       sn  w0     7      ;      (continue - the chains must be moved to the
40137 122792                         ;       monitor chaintable)
40138 122792       jl.        (j20.) ;      return;
40139 122794  
40139 122794       al. w1     j10.   ;    typetext(<:insert entry<0>:>);
40140 122796       jl. w3     f1.    ;
40141 122798       rl. w1     j18.   ;
40142 122800       al  w3  x1+d55    ;    typeresult(name,result);
40143 122802       jl. w2     f5.    ;
40144 122804       dl. w2     j19.   ;
40145 122806       jl.        (j20.) ;
40146 122808                         ;    return;
40147 122808                         ;
40148 122808  i14:                   ; print entry;
40149 122808       ds. w1     j18.   ;    save regs.
40150 122810       ds. w3     j20.   ;
40151 122812                         ;
40152 122812       al. w1     j11.   ;    typetextline(<:entry format:>);
40153 122814       jl. w3     f2.    ;
40154 122816       al. w1     j12.   ;    typetext(<:+0: ...:>);
40155 122818       jl. w3     f1.    ;
40156 122820       rl. w2     j18.   ;
40157 122822       zl  w1  x2+d54    ;    writeinteger(first slice);
40158 122824       jl. w3     f49.   ;
40159 122826       zl  w1  x2+d53    ;    writeinteger(segmentkey & permkey);
40160 122828       jl. w3     f49.   ;
40161 122830       jl. w3     f3.    ;    typenewline;
40162 122832                         ;
40163 122832       al. w1     j13.   ;    typetext(<: base ..:>);
40164 122834       jl. w3     f1.    ;
40165 122836       rl. w2     j18.   ;
40166 122838       rl  w1  x2+d54+2  ;    writeinteger(lowerbase);
40167 122840       jl. w3     f49.   ;
40168 122842                         ;
40169 122842       rl  w1  x2+d54+4  ;    writeinteger(upperbase);
40170 122844       jl. w3     f49.   ;
40171 122846       jl. w3     f3.    ;    typenewline;
40172 122848                         ;
40173 122848       al. w1     j14.   ;
40174 122850       jl. w3     f1.    ;    typetext(<:name:>;
40175 122852       rl. w2     j18.   ;
40176 122854       al  w1  x2+d55    ;    typetextline(name);
40177 122856       jl. w3     f2.    ;
40178 122858       jl. w3     f3.    ;    typenewline;
40179 122860                         ;
40180 122860       dl. w1     j18.   ;    restore regs.
40181 122862       dl. w3     j20.   ;
40182 122864       jl      x3        ;    return;
40183 122866                         ;
40184 122866  
40184 122866  
40184 122866  i15:                   ; terminate:
40185 122866       jl. w3     f17.   ;    end transfer;
40186 122868       jd         1<11+64;    remove process (auxcat);
40187 122870       rl. w3     j3.    ;    w3 := chainhead start;
40188 122872       am.       (j0.)   ;
40189 122874       jl        +2      ;    return ok;
40190 122876  i17:                   ; end area error:
40191 122876       al. w1     e1.    ;    writetext(catname);
40192 122878       jl. w3     f1.    ;
40193 122880       al. w1     j15.   ;    writetext(<:size trouble ...:>);
40194 122882       jl. w3     f1.    ;
40195 122884                         ;
40196 122884       rl. w1     j5.    ;    writeinteger(segmentno);
40197 122886       jl. w3     f49.   ;
40198 122888       jl. w3     f3.    ;    typenewline;
40199 122890                         ;    goto error return;
40200 122890  
40200 122890  i18:                   ; error return;
40201 122890       jl. w3     f17.   ;    end transfer;
40202 122892       jd         1<11+64;    remove process (auxcat);
40203 122894       jl.       (j0.)   ;    error return;
40204 122896  
40204 122896  
40204 122896  
40204 122896  i20:                   ; error at output catsegment:
40205 122896       al. w1     j9.    ;
40206 122898       jl. w3     f2.    ;   type textline (<:repair not possible:>);
40207 122900                         ; comment start the input transfer again.
40208 122900                         ;    the parameter has been initialized in
40209 122900       jl. w3     f15.   ;    'test status';
40210 122902                         ;    start transfer;
40211 122902       jl.        i5.    ;    goto read;
40212 122904  
40212 122904  i21:                   ;test status;
40213 122904       al. w1     e1.    ;    writetext(auxcatalogname);
40214 122906       jl. w3     f1.    ;
40215 122908       al. w1     j7.    ;    writetext(<:segment:>);
40216 122910       jl. w3     f1.    ;
40217 122912       rl. w1     j5.    ;
40218 122914       jl. w3     f49.   ;    writeinteger(cur segmentno);
40219 122916       jl. w3     f3.    ;    typenewline;
40220 122918                         ;
40221 122918       rl. w1     d15.   ;    if status<>parity then
40222 122920       so. w1     (j6.)  ;
40223 122922       jl.        i18.   ;      goto error return;
40224 122924                         
40224 122924                         ;
40225 122924       al  w0     0      ;    clear startup area name to prevent automatic
40226 122926       rs. w0     d49.   ;    startup after parity error;
40227 122928       al  w0     1      ;
40228 122930       rs. w0     j2.    ;    error insegment := true;
40229 122932                         ;    prepare new start of reading after error;
40230 122932       rl. w2     j5.    ;
40231 122934       al  w2  x2+1      ;    first segment := cur segment + 1;
40232 122936       rs. w2     d41.   ;
40233 122938                         ;
40234 122938       jl. w3     f40.   ;    testrepair allowed;
40235 122940       jl.        i22.   ;+0:    not allowed: return;
40236 122942       rs. w0     j1.    ;+2:    allowed: writeback := true;
40237 122944                         ;
40238 122944       rl. w2     d42.   ;    get inputbuffer address where bad segment
40239 122946       rl  w2  x2+2      ;    is stored;
40240 122948       jl.        i6.    ;    return (and try to insert the entries);
40241 122950                         ;
40242 122950  i22: jl. w3     f15.   ;    start transfer; (when no write back is possible)
40243 122952       jl.        i16.   ;    goto increment;
40244 122954                         ;
40245 122954  
40245 122954  e.                     ;
40246 122954  
40246 122954  
40246 122954  ; description of auxcat:
40247 122954  d3:  0                 ; bs kind
40248 122956  d4:  0                 ; catsize
40249 122958  d5:  0                 ; slice length
40250 122960  d6:  0                 ; number of slices
40251 122962  
40251 122962  
40251 122962  d15: 0, r.8            ; answer
40252 122978  d14 = d15 + 2          ; bytes transferred
40253 122978  d17: 0                 ; characters
40254 122980  d18: -1                ; cur char
40255 122982  
40255 122982  d19: h0                ; start of action table
40256 122984  d20: h1                ; end of action table
40257 122986  d21: 0                 ; cur action
40258 122988  d22: 0                 ; input buf
40259 122990  d24: h4                ; start of command buf
40260 122992  d25: h5                ; last  of command buf
40261 122994  d26: 0                 ; cur command
40262 122996  d27: 0                 ; top command
40263 122998  d28: h6                ; start of load buf
40264 123000  d29: h7                ; last of load buf
40265 123002  d30: 5<12, h6, h7, 0   ; load buf message
40266 123010  d33: 0                 ; input segment
40267 123012  d34: 0                 ; max segment
40268 123014  d35: 0                 ; checksum
40269 123016  d36: 0  ; initcat switches: writetext (by entry byte0 holds load flag)
40270 123018  d37: 0  ; initcat switches: medium
40271 123020  d49: 0, r.4 ; initcat switches: automatic startup area name
40272 123028  d38: 3<12,0,0,0,0,0    ; message 1
40273 123040  d39: 3<12,0,0,0,0,0    ; message 2
40274 123052  d40: g0                ; modekind     (initially:  start of initcat)
40275 123054  d41: 0                 ; first segment  or  position
40276 123056  d42: 0                 ; current message address
40277 123058  d43: 0                 ; device number
40278 123060  d44: 0                 ; repair allowed  ( 0==false, else true)
40279 123062  d45: b118              ; address of integer just read
40280 123064  d46: b119              ; address of name just read
40281 123066  
40281 123066  
40281 123066  e1:  0, r.5            ; auxcatname  or  devicename
40282 123076  e2:  0, r.5            ; document name
40283 123086  e9:  <:input sumerror<0>:>
40284 123096  e11: <:input sizeerror<0>:>
40285 123108  e13: <:syntax error<0>:>
40286 123118  
40286 123118  
40286 123118  ; stepping stones:
40287 123118  
40287 123118  jl. d0.  , d0  = k-2
40288 123120  
40288 123120  jl. f0.  , f0  = k-2
40289 123122  jl. f1.  , f1  = k-2
40290 123124  jl. f2.  , f2  = k-2
40291 123126  jl. f3.  , f3 = k-2
40292 123128  jl. f5.  , f5  = k-2
40293 123130  jl. f6.  , f6  = k-2
40294 123132  jl. f8.  , f8  = k-2
40295 123134  jl. f12. , f12 = k-2
40296 123136  jl. f15. , f15 = k-2
40297 123138  jl. f17. , f17 = k-2
40298 123140  jl. f21. , f21 = k-2
40299 123142  jl. f22. , f22 = k-2
40300 123144  
40300 123144  
40300 123144  
40300 123144  ; procedure dismount kit
40301 123144  ;
40302 123144  ; search through the chaintables to find a possible chaintable connected to
40303 123144  ;   the current device.
40304 123144  ; if found then remove chaintable etc
40305 123144  ;
40306 123144  ; call: w3 = link
40307 123144  ; exit: link+0: error,  all regs undef
40308 123144  ;       link+2: ok   ,  all regs undef
40309 123144  
40309 123144  b. i20, j10 w.
40310 123144  
40310 123144  j0:  0                 ; return
40311 123146  j1:  0, r.4            ; docname to be removed
40312 123154  
40312 123154  j5:  <:delete bs<0>:>
40313 123162  j7:  <:delete entries<0>:>
40314 123172  
40314 123172  f24:                   ; dismount kit:
40315 123172       rl. w0     d43.   ;    w0 := device number;
40316 123174       ls  w0     1      ;
40317 123176       wa  w0     b4     ;    w0 := name table address of device;
40318 123178  
40318 123178       rl  w1     b22    ;    entry := first chain in nametable;
40319 123180       al  w1  x1-2      ;
40320 123182  
40320 123182  i1:                    ; next chain:
40321 123182       al  w1  x1+2      ;    increase (entry);
40322 123184       sn  w1    (b24)   ;    if all chaintables tested then
40323 123186       jl      x3+2      ;      return ok;  (i.e. not found)
40324 123188  
40324 123188       rl  w2  x1        ;    chain := nametable (entry);
40325 123190       se  w0 (x2+d61+8-a88); if document name table address.chain <> w0 then
40326 123192       jl.        i1.    ;      goto next chain;
40327 123194  
40327 123194       dl  w1  x2+d61+2-a88;
40328 123196       ds. w1     j1.+2  ;    move docname.chain;
40329 123198       dl  w1  x2+d61+6-a88;
40330 123200       ds. w1     j1.+6  ;
40331 123202  
40331 123202       rs. w3     j0.    ;    save (return);
40332 123204  
40332 123204       sn  w2    (b25)   ;    if maincat on document then
40333 123206       jd         1<11+114;     remove main catalog;
40334 123208  
40334 123208       al. w2     j1.    ;
40335 123210       jd         1<11+108;   delete backing storage (docname);
40336 123212       se  w0     0      ;    if result not ok then
40337 123214       jl.        i10.   ;      goto alarm;
40338 123216  
40338 123216  i5:                    ; rep:
40339 123216       jd         1<11+110;   delete entries (docname);
40340 123218       sn  w0     3      ;    if not all entries deleted then
40341 123220       jl.        i5.    ;      goto rep;
40342 123222  
40342 123222       se  w0     0      ;    if result not ok then
40343 123224       jl.        i11.   ;      goto alarm;
40344 123226  
40344 123226       jl      x3+2      ;    return ok;
40345 123228  
40345 123228  
40345 123228  i10:                   ; error at delete bs:
40346 123228       sn  w0     2      ;    if result = catalog io-error then
40347 123230       jl.        i5.    ;      goto rep;
40348 123232       am         j5-j7  ;   text := <:delete bs:>
40349 123234  
40349 123234  i11:                   ; error at delete entries:
40350 123234       al. w1     j7.    ;    text := <:delete entries:>;
40351 123236  
40351 123236  i15:                   ; typeout:
40352 123236       jl. w3     f1.    ;    typeout (text);
40353 123238       al. w3     j1.    ;
40354 123240       jl. w2     f5.    ;    typeresult (docname, result);
40355 123242       jl.       (j0.)   ;    error return;
40356 123244  
40356 123244  e.                     ;
40357 123244  
40357 123244  
40357 123244  
40357 123244  ; procedure mount main catalog
40358 123244  ;
40359 123244  ; call: w3 = link
40360 123244  ; exit: link+0:  error  ,  all regs undef
40361 123244  ;           +2:  ok     ,  all regs undef
40362 123244  
40362 123244  b. i30, j20 w.
40363 123244  
40363 123244  j0:  0                 ; return
40364 123246  j1:  h8                ; start of chainhead buffer
40365 123248  j2:  0, r.4            ; wrk-name
40366 123256  
40366 123256  j3:  <:remove aux entry<0>:>
40367 123268  j5:  <:connect main catalog<0>:>
40368 123282  j7:  <:main catalog not defined<0>:>
40369 123300  j9:  <:create aux entry<0>:>
40370 123312  j11: <:no main catalog connected<0>:>
40371 123330  
40371 123330  f25:                   ; mount maincat:
40372 123330       rs. w3     j0.    ;    save (return);
40373 123332  i0:                    ; try again:
40374 123332       al. w3     e1.    ;
40375 123334       jd         1<11+10;    release process (aux catalog);
40376 123336       rl. w2     d10.   ;    w2 := preferred size of maincat;
40377 123338  
40377 123338       rl. w3     j1.    ;    w3 := chainhead;
40378 123340       al. w1     d9.    ;    w1 := maincat name;
40379 123342       jd         1<11+112;   connect main catalog (chainhead, maincat name);
40380 123344       al  w3  x1        ;    w3 := maincat name;
40381 123346       se  w0     0      ;    if result not ok then
40382 123348       jl.        i10.   ;      goto test create;
40383 123350  
40383 123350  ; maincat was connected, but has it the rigth size
40384 123350       sh  w2     0      ;    if preferred size undefined then
40385 123352       jl.        i30.   ;      goto return ok;  (i.e. accept any size)
40386 123354  
40386 123354  ; maincat exists, but a specific size was wanted
40387 123354  
40387 123354       jd         1<11+4 ;    w0 := proc descr (maincat area process);
40388 123356       am        (0)     ;    if areaproces.size = wanted size
40389 123358       se  w2   (+a61)   ;
40390 123360       jl.        i1.    ;    and
40391 123362       am        (0)     ;    areaprocess.noofkeys = wanted noofkeys then
40392 123364       zl  w2    +a58    ;
40393 123366       sn. w2    (d12.)  ;
40394 123368       jl.        i30.   ;    goto ok return;
40395 123370  i1:
40396 123370  
40396 123370  ; another size was wanted
40397 123370  
40397 123370       jd         1<11+114;   remove main catalog;
40398 123372       al. w3     e1.    ;    remove process (aux catalog);
40399 123374       jd         1<11+64;
40400 123376  
40400 123376       rl. w2     j1.    ;
40401 123378       al  w2  x2+d61    ;    w2 := docname.chainhead;
40402 123380       al. w1     d8.    ;    w1 := maincat entry;
40403 123382       jd         1<11+122;   remove aux entry (docname, entry);
40404 123384       se  w0     0      ;    if result not ok then
40405 123386       jl.        i15.   ;      goto alarm;
40406 123388  
40406 123388  i5:                    ; clean up:
40407 123388       jl. w3     f24.   ;    dismount kit;  (i.e. release all chains)
40408 123390       jl.        i20.   ;+2:   error:  goto error exit;
40409 123392  
40409 123392       jl. w3     f21.   ;    read chain;
40410 123394       jl.        i20.   ;+2:   error:  goto error exit;
40411 123396  
40411 123396       jl.        i0.    ;    goto try again;
40412 123398  
40412 123398  
40412 123398  i10:                   ; test create:
40413 123398       se  w0     3      ;    if neither unknown nor already exist then
40414 123400       jl.        i17.   ;      goto alarm;
40415 123402  
40415 123402  ; it will be assumed that the entry did'nt exist in auxcat
40416 123402  
40416 123402       sh  w2     0      ;    if preferred size not defined then
40417 123404       jl.        i18.   ;      goto alarm;
40418 123406  
40418 123406  ; before a maincat can be created, all chains on the document must
40419 123406  ;   be transferred
40420 123406  
40420 123406  ; the auxcat areaprocess has been released.
40421 123406  ; in order to be able to repair the auxcat during the
40422 123406  ;   following cat-scan, the auxcat must be reserved again.
40423 123406  ; this may be done by means of a call of ..prepare bs..
40424 123406       al. w3     e1.    ;
40425 123408       jd         1<11+64;    remove process (auxcat);
40426 123410       jl. w3     f24.   ;    dismount kit;
40427 123412       jl.        i20.   ;+2:   error:  goto error exit;
40428 123414       jl. w3     f21.   ;    read chain;
40429 123416       jl.        i20.   ;+2:   error:  goto error exit;
40430 123418  
40430 123418       jl. w3     f23.   ;    insert all entries;  (i.e. all chains)
40431 123420       jl.        i20.   ;+2:   error:  goto error exit;
40432 123422  
40432 123422       jd         1<11+36;    w0w1 := get clock;
40433 123424       ld  w1     5      ;    w0 := shortclock;
40434 123426  
40434 123426       al. w1     d8.    ;    w1 := maincat entry;
40435 123428       rs  w0  x1+d11-d8 ;    save shortclock in tail;
40436 123430  
40436 123430       rl. w2     j1.    ;
40437 123432       al  w2  x2+d61    ;    w2 := docname.chainhead;
40438 123434  
40438 123434       al  w0     0      ;
40439 123436       al. w3     j2.    ;    w3 := wrkname area;
40440 123438       rs  w0  x3        ;    (clear first word of name);
40441 123440  
40441 123440       jd         1<11+120;   create aux entry and area process;
40442 123442       se  w0     0      ;    if result not ok then
40443 123444       jl.        i19.   ;      goto alarm;
40444 123446  
40444 123446       jd         1<11+64;    remove process (aux area process);
40445 123448  
40445 123448       jl.        i5.    ;    goto clean up;
40446 123450  
40446 123450  
40446 123450  i15:                   ; error at remove aux entry:
40447 123450       am         j3-j5  ;   text := <:remove aux entry:>;
40448 123452  i17:                   ; error at connect main catalog:
40449 123452       am         j5-j9  ;   text := <:connect main catalog:>;
40450 123454  i19:                   ; error at create main catalog:
40451 123454       al. w1     j9.    ;   text := <:create aux entry:>;
40452 123456  
40452 123456  i16:                   ; typeout:
40453 123456       jl. w3     f1.    ;    typeout (text);
40454 123458  
40454 123458       al. w3     d9.    ;    w3 := main cat name;
40455 123460       jl. w2     f5.    ;    typeresult (maincat name, result);
40456 123462  
40456 123462       jl.        i20.   ;    goto error exit;
40457 123464  
40457 123464  i18:                   ; size of main cat not defined:
40458 123464       al. w1     j7.    ;    type textline (<:maincatalog not defined:>);
40459 123466       jl. w3     f2.    ;
40460 123468  
40460 123468  i20:                   ; error exit:
40461 123468       al. w1     j11.   ;    type textline (<:no maincat connected:>);
40462 123470       jl. w3     f2.    ;
40463 123472       al. w3     e1.    ;
40464 123474       jd         1<11+64;    remove process (aux catalog);
40465 123476  
40465 123476       jl.       (j0.)   ;    error return;
40466 123478  
40466 123478  i30:                   ; return ok:
40467 123478       am.       (j0.)   ;
40468 123480       jl        +2      ;    return ok;
40469 123482  
40469 123482  e.                     ;
40470 123482  
40470 123482  
40470 123482  
40470 123482  ; procedure get bskind
40471 123482  ;
40472 123482  ; call: w3 = link
40473 123482  ; exit: all regs undef
40474 123482  ; error exit: syntax alarm
40475 123482  
40475 123482  b. i10, j10 w.
40476 123482  
40476 123482  j0:                    ; start of table
40477 123482       <:fast:>, 0       ;
40478 123488       <:slow:>, 1       ;
40479 123494  j1:                    ; top of table
40480 123494  j2 = 6                 ; size of entry
40481 123494  
40481 123494  f29:                   ; get bskind:
40482 123494       am.       (d46.)  ;
40483 123496       dl  w1    +2      ;    w0w1 := two first word of name;
40484 123498       al. w2     j0.-j2 ;    entry := base of kind-table;
40485 123500  i0:                    ; next kind:
40486 123500       al  w2  x2+j2     ;    increase (entry);
40487 123502       sn. w2     j1.    ;    if all kinds tested then
40488 123504       jl.        f30.   ;      goto syntax alarm;
40489 123506       sn  w0 (x2+0)     ;
40490 123508       se  w1 (x2+2)     ;    if name <> kindname.entry then
40491 123510       jl.        i0.    ;      goto next kind;
40492 123512  
40492 123512       rl  w0  x2+4      ;    bskind := kind.entry;
40493 123514       rs. w0     d3.    ;
40494 123516  
40494 123516       jl      x3        ;    return;
40495 123518  
40495 123518  e.                     ;
40496 123518  ; stepping stones
40497 123518  
40497 123518  jl.    f12.  ,  f12 = k-2
40498 123520  
40498 123520  
40498 123520  
40498 123520  
40498 123520  f30: jl.       (2),b115; goto syntax error;
40499 123524  f31: jl.       (2),b116; goto next command;
40500 123528  f32: jl.       (2),b117; goto exam command;
40501 123532  f33: jl.       (2),b112; call next param;
40502 123536  f34: jl.       (2),b113; call next name;
40503 123540  f35: jl.       (2),b114; call next integer;
40504 123544  f41: jl.       (2),b121; call init write;
40505 123548  f42: jl.       (2),b122; call write char;
40506 123552  f43: jl.       (2),b123; call write text;
40507 123556  f44: jl.       (2),b124; call type line;
40508 123560  f45: jl.       (2),b125; call save work;
40509 123564  f46: jl.       (2),b133; call connect;
40510 123568  f47: jl.       (2),b129; goto catalog error;
40511 123572  f48: jl.       (2),b130; call stack input;
40512 123576  f49: jl.       (2),b131; call write integer;
40513 123580  f50: jl.       (2),b134; call linkall;
40514 123584  f51: jl.       (2),b137; call read segment;
40515 123588  f52: jl.       (2),b138; call write segment;
40516 123592  f53: jl.       (2),b140; call writebits;
40517 123596  f55: jl.       (2),b143; call change writemode
40518 123600  f58: jl.       (2),b150; call prepare dump
40519 123604  f60: jl.       (2),b153; call initialize main
40520 123608  
40520 123608  ; procedure read name
40521 123608  ;
40522 123608  ; call: w2 = name address, w3 = link
40523 123608  ; exit: all regs undef
40524 123608  
40524 123608  f36:                   ; read name:
40525 123608       al  w1  x3        ;
40526 123610       jl. w3     f34.   ;    next name;
40527 123612       al  w3  x1        ;
40528 123614  
40528 123614  ; procedure move name
40529 123614  ;
40530 123614  ; call: w2 = name address, w3 = link
40531 123614  ; exit: w0w1 = undef, w2w3 = unchanged
40532 123614  
40532 123614  f37:                   ; move name:
40533 123614       am.       (d46.)  ;
40534 123616       dl  w1    +2      ;    move name just read to name-area;
40535 123618       ds  w1  x2+2      ;
40536 123620       am.       (d46.)  ;
40537 123622       dl  w1    +6      ;
40538 123624       ds  w1  x2+6      ;
40539 123626       jl      x3        ;    return;
40540 123628  
40540 123628  
40540 123628  ; procedure move catname,docname from chainbuffer
40541 123628  ;
40542 123628  ; call: w3 = link
40543 123628  ; exit: all regs undef
40544 123628  
40544 123628  b. j10 w.
40545 123628  
40545 123628  f38:                   ; move catname,docname from chainbuffer:
40546 123628       rl. w2     j2.    ;    w2 := first of chainbuffer;
40547 123630       dl  w1  x2+d61+2  ;
40548 123632       ds. w1     e2.+2  ;    move docname from chainbuffer;
40549 123634       dl  w1  x2+d61+6  ;
40550 123636       ds. w1     e2.+6  ;
40551 123638  
40551 123638       dl  w1  x2+d55+2  ;
40552 123640       ds. w1     e1.+2  ;    move catname from chainbuffer;
40553 123642       dl  w1  x2+d55+6  ;
40554 123644       ds. w1     e1.+6  ;
40555 123646  
40555 123646       jl      x3        ;    return;
40556 123648  
40556 123648  
40556 123648  ; procedure move catname,docname to chainbuffer
40557 123648  ;
40558 123648  ; call: w3 = link
40559 123648  ; exit: all regs undef
40560 123648  
40560 123648  f39:                   ; move catname etc to chainbuffer:
40561 123648       rl. w2     j2.    ;    w2 := first of chainbuffer;
40562 123650       dl. w1     e2.+2  ;    if docname(0) not defined then
40563 123652       sn  w0    -1      ;
40564 123654       jl      x3        ;      return;
40565 123656  
40565 123656       ds  w1  x2+d61+2  ;    move docname to chainhead;
40566 123658       dl. w1     e2.+6  ;
40567 123660       ds  w1  x2+d61+6  ;
40568 123662  
40568 123662       dl. w1     e1.+2  ;    move catname to chainhead;
40569 123664       ds  w1  x2+d55+2  ;
40570 123666       dl. w1     e1.+6  ;
40571 123668       ds  w1  x2+d55+6  ;
40572 123670  
40572 123670       rl. w1     d3.    ;
40573 123672       ls  w1     3      ;    if bskind defined then
40574 123674       al  w1  x1+a110   ;      kind.chainhead := bskind;
40575 123676       sl  w1     0      ;      permkey.chainhead := max cat key;
40576 123678       hs  w1  x2+d53    ;
40577 123680  
40577 123680       jl      x3        ;    return;
40578 123682  
40578 123682  j2:  h8                ; first of chainbuffer
40579 123684  
40579 123684  e.                     ;
40580 123684  
40580 123684  
40580 123684  
40580 123684  ; procedure test repair allowed
40581 123684  ;
40582 123684  ; call: w3 = link
40583 123684  ; exit: link+0:  not allowed,  all regs undef
40584 123684  ;           +2:  allowed    , w0 = undef, other regs unchanged
40585 123684  
40585 123684  b. j10 w.
40586 123684  
40586 123684  f40:                   ; test repair allowed:
40587 123684       rl. w0     d44.   ;
40588 123686       se  w0     0      ;    if repair was allowed then
40589 123688       jl      x3+2      ;      return ok;
40590 123690  
40590 123690       jl. w1     f2.    ;   type textline... and return;
40591 123692       <:auxcat to be repaired<0>:>
40592 123708  
40592 123708  e.                     ;
40593 123708  
40593 123708  ; procedure save memory buffer(segment, name);
40594 123708  ; writes the buffer specified in the message (e44) to the area specified
40595 123708  ; by name.
40596 123708  ;
40597 123708  ;     call              return
40598 123708  ; w0  segment #         destroyed
40599 123708  ; w1  -                 destroyed
40600 123708  ; w2  name addr         destroyed
40601 123708  ; w3  link              destroyed
40602 123708  ;
40603 123708  
40603 123708  b.  i10  w.
40604 123708  
40604 123708  f56:                    ; save memory buffer
40605 123708       rs. w3     i3.     ;
40606 123710       rl. w1     i4.     ;   message.segment := segment;
40607 123712       rs  w0  x1+6       ;
40608 123714       rl. w3     i5.     ;   
40609 123716       dl  w1  x2+2       ;   receiver.name := name;
40610 123718       ds  w1  x3+2       ;
40611 123720       dl  w1  x2+6       ;
40612 123722       ds  w1  x3+6       ;
40613 123724       jd      1<11+52    ;   create area process(name);
40614 123726       jd      1<11+8     ;   reserve process(name);
40615 123728       rl. w1     i4.     ;
40616 123730       jd      1<11+16    ;   send message;
40617 123732       rl. w1     i6.     ;
40618 123734       jd      1<11+18    ;   wait answer;
40619 123736       jd      1<11+64    ;   remove process;
40620 123738       jl.       (i3.)    ;   (iggnore all error status)
40621 123740                          ;   return;
40622 123740  i3:  0                  ; saved return
40623 123742  i4:  b145               ; e44, pointer to message
40624 123744  i5:  b146               ; e40, pointer to name (receiver)
40625 123746  i6:  b147               ; e32, pointer to answer area
40626 123748                          ;
40627 123748  e.
40628 123748  
40628 123748  
40628 123748  
40628 123748  ; stepping stones
40629 123748  
40629 123748  jl.  f0.  , f0 = k-2
40630 123750  jl.  f1.  , f1 = k-2
40631 123752  jl.  f2.  , f2 = k-2
40632 123754  jl.  f3.  , f3 = k-2
40633 123756  jl.  f5.  , f5 = k-2
40634 123758  
40634 123758  
40634 123758  
40634 123758  
40634 123758  
40634 123758  \f


40634 123758  
40634 123758  
40634 123758  ; *********************************************
40635 123758  ; *********************************************
40636 123758  ; **                                         **
40637 123758  ; **  main control of monitor initialization **
40638 123758  ; **                                         **
40639 123758  ; *********************************************
40640 123758  ; *********************************************
40641 123758  
40641 123758  b.  i15,  j10  w.
40642 123758                          ; initialize catalog system
40643 123758  g0:                     ;
40644 123758       al  w0     0       ;
40645 123760       jl. w3     f55.    ;   change write mode(terminal);
40646 123762       am        (b4)     ;
40647 123764       rl  w1    +a199<1  ;
40648 123766       rs. w1    (i1.)    ;   save main console;
40649 123768                          ;
40650 123768       jl. w3     f57.    ;   link dlc/ioc main
40651 123770  
40651 123770       rl. w0     d36.    ;
40652 123772       se  w0     0       ;   if diskload then
40653 123774       jl. w3    (i2.)    ;      autoload device controllers;
40654 123776                          ;
40655 123776                          ;
40656 123776       rl. w0     d36.    ;
40657 123778       sn  w0     0       ;   if not diskload then
40658 123780       jl. w3    (i4.)    ;      load ida-ifp;
40659 123782                          ;
40660 123782       sn  w0     0       ;   if not diskload then
40661 123784       rs. w0     d49.    ;      startarea := 0;
40662 123786                          ;
40663 123786       jl. w3    (i3.)    ;   start device controllers;
40664 123788                          ;
40665 123788       rl. w1    (i1.)    ;
40666 123790       rl  w3  x1+a10     ;   if main console.kind <> perm link and
40667 123792                          ;      console.kind <> csp_terminal then
40668 123792       dl. w2    (i5.)    ;      change write mode(memory, buf.start, buf.top);
40669 123794       rx  w2     2       ;
40670 123796       al  w1  x1-2       ; 
40671 123798       al  w0     1       ;
40672 123800       se  w3     84      ;
40673 123802       sn  w3     8       ;
40674 123804       sz                 ;
40675 123806       jl. w3     f55.    ;
40676 123808                          ;
40677 123808       rl. w1     i6.     ;
40678 123810       jl. w3     f2.     ;   type text(mon release);
40679 123812       rl. w1     i7.     ;
40680 123814       jl. w3     f2.     ;   type text(mon version);
40681 123816       rl. w1     i8.     ;
40682 123818       jl. w3     f2.     ;   type text(mon options);
40683 123820       rl. w0     d49.    ;
40684 123822       rl. w1     i9.     ;
40685 123824       sn  w0     0       ;   if no start area then
40686 123826       jl. w3     f2.     ;      type text(date note);
40687 123828                          ;
40688 123828       jl. w3     g11.    ;   automatic oldcat;
40689 123830                          ;
40690 123830       rl. w0    (i10.)   ;
40691 123832       sn  w0     0       ;   if write mode = memory then
40692 123834       jl.        j1.     ;   begin
40693 123836                          ;
40694 123836       al  w0     25      ;
40695 123838       jl. w3     f0.     ;     write char(em);
40696 123840       rl. w0    (i14.)   ;
40697 123842       rl. w2     i13.    ;     message.last address := top of write buffer;
40698 123844       rs  w0  x2+4       ;
40699 123846       al  w0     0       ; 
40700 123848       rl. w2     i11.    ;     save memory buffer(0, s log area);
40701 123850       jl. w3     f56.    ;
40702 123852       al  w0     0       ;
40703 123854       jl. w3     f55.    ;     change write mode(terminal);
40704 123856                          ;   end;
40705 123856  j1:  dl. w1     i12.    ;
40706 123858       al. w2     d49.    ;
40707 123860       rl  w3  x2+0       ;   if start area <> 0 then
40708 123862       se  w3     0       ;      stack input(catalog base, name);
40709 123864       jl. w3     f48.    ;
40710 123866       jl.        f31.    ;   goto next command;
40711 123868                          ;
40712 123868  i1:  b132         ; e90 ; terminal address
40713 123870  i2:  f19                ; autoload device controllers
40714 123872  i3:  f20                ; start device controllers
40715 123874  i4:  f18                ; load ida-ifp controllers
40716 123876  i5:  b142         ; e17 ; pointer to address of memory buffer
40717 123878  i6:  e19                ; addr of mon release text
40718 123880  i7:  e20                ; addr of mon version text
40719 123882  i8:  e21                ; addr of mon options text
40720 123884  i9:  e18                ; addr of date note text
40721 123886  i10: b144         ; e53 ; address of write mode
40722 123888  i11: b148         ; c36 ; address of s log area name
40723 123890       a107               ;
40724 123892  i12: a108-1             ; max catalog base
40725 123894  i13: b145         ; e44 ; output message
40726 123896  i14: b149         ; e42 ; top of write buffer
40727 123898                          ;
40728 123898  e.
40729 123898  
40729 123898  ; ************************************************
40730 123898  ; ************************************************
40731 123898  \f


40731 123898  
40731 123898  
40731 123898  
40731 123898  
40731 123898  
40731 123898  ; command syntax:   clearcat
40732 123898  
40732 123898  b. i10, j10 w.
40733 123898  
40733 123898  g40:                   ; clearcat:
40734 123898       rl  w2     b22    ;    entry := first chain in name table;
40735 123900       jl.        i3.    ;    (skip)
40736 123902  i1:                    ; next chain:
40737 123902       rl. w2     j1.    ;    restore (entry);
40738 123904  i2:  al  w2  x2+2      ;    increase (entry);
40739 123906  i3:  sn  w2    (b24)   ;    if all chains tested then
40740 123908       jl.        f31.   ;      goto next command;
40741 123910  
40741 123910       rl  w3  x2+0      ;    chain := name table (entry);
40742 123912       rl  w0  x3+d61-a88;
40743 123914       sn  w0     0      ;    if docname(0) = 0 then
40744 123916       jl.        i2.    ;      goto next chain;
40745 123918  
40745 123918       rs. w2     j1.    ;    save (entry);
40746 123920  
40746 123920       rl  w1  x3+d61+8-a88;  devno := (document name table address.chain
40747 123922       ws  w1     b4     ;           - first device in name table )
40748 123924       ls  w1    -1      ;           / 2 ;
40749 123926       rs. w1     d43.   ;
40750 123928  
40750 123928       jl. w3     f24.   ;    dismount kit;
40751 123930       jl.        i1.    ;+2:   error:  goto next chain;
40752 123932  ; 
40753 123932  ; note : the following is done tomakeit possible to load a 
40754 123932  ; monitor version older than 9.0  where the chainhead field 
40755 123932  ; "no of keys " is used to hold first slice of chaintable chain.
40756 123932  ; always 0. the following code can be removed in a later release.
40757 123932  ;
40758 123932       al  w0     -1     ; 
40759 123934       rs. w0     e2.    ; docname unchanged
40760 123936       jl. w3    f26.    ; read chain
40761 123938       jl.        i1.    ;+2 error : goto next chain
40762 123940       rl  w2  x3+d57    ;
40763 123942       sl  w2    513     ; if size.catalog <= 512  then
40764 123944       jl.        i1.    ; 
40765 123946       al  w0      0     ; noof keys := 0
40766 123948       hs  w0  x3+d67    ; (previous first slice of chain )
40767 123950       al  w0     -17    ; new drum disc bit mask (see m38 in p fnc2)
40768 123952       la  w0  x3+d53    ; chainkind := new chainkind excluded
40769 123954       hs  w0  x3+d53    ;              new chainkind bit;
40770 123956       al  w0     -1     ;
40771 123958       rs. w0     e2.    ;  docname unchanged
40772 123960       jl. w3    f27.    ; write chain
40773 123962       jl.        i1.    ;+2 error : goto next chain
40774 123964  
40774 123964       jl.        i1.    ;    goto next chain;
40775 123966  
40775 123966  j1:  0                 ; cur entry for chain 
40776 123968  
40776 123968  e.                     ;
40777 123968  
40777 123968  
40777 123968  
40777 123968  ; command syntax:   nokit <device number>
40778 123968  
40778 123968  g41:                   ; nokit:
40779 123968       jl. w3     f35.   ;    devno :=
40780 123970       rs. w0     d43.   ;      next integer;
40781 123972  
40781 123972       jl. w3     f24.   ;    dismount kit;
40782 123974       jl.        f31.   ;+2:   error:  goto next command;
40783 123976  
40783 123976       jl.        f31.   ;    goto next command;
40784 123978  
40784 123978  
40784 123978  
40784 123978  ; command syntax:   maincat <maincat name> <maincat size>
40785 123978  ;             or:   maincat <maincat name> <partitions> <no of keys>
40786 123978  
40786 123978  b. i10, j10 w.
40787 123978  
40787 123978  g42:                   ; maincat:
40788 123978       rl. w2     j9.    ;    maincatname :=
40789 123980       jl. w3     f36.   ;      readname;
40790 123982       jl. w3     f35.   ;    first integer := next integer;
40791 123984       rs. w0     j1.    ;
40792 123986       jl. w3     f33.   ;    type := nextparam;
40793 123988       rs. w0     j4.    ;
40794 123990       se  w0     2      ;    if type = integer then
40795 123992       jl.        i1.    ;    begin comment no of partitions and no of keys;
40796 123994       rl. w0     j1.    ;      if noofpart <= 0 then 
40797 123996       sh  w0     0      ;
40798 123998       jl.        i4.    ;        goto number error;
40799 124000       rl. w0     (d45.) ;
40800 124002       rs. w0     j3.    ;      noofkeys := nextinteger;
40801 124004                         ;
40802 124004       sh  w0     0      ;      if noofkeys < 1 or
40803 124006       jl.        i4.    ;
40804 124008       sl  w0     513    ;         noofkeys > 512 then
40805 124010       jl.        i4.    ;         goto number error;
40806 124012                         ;
40807 124012       rl. w1     j1.    ;      size := noofkeys * first integer;
40808 124014       wm  w0     2      ;
40809 124016       rs. w0     j1.    ;
40810 124018       rs. w1     j2.    ;      noofparti := first integer;
40811 124020       jl.        i2.    ;    end else
40812 124022                         ;
40813 124022  i1:  rl. w0     j1.    ;    begin
40814 124024                         ;      comment size have been given;
40815 124024       sh  w0     0      ;      if size <= 0 then
40816 124026       jl.        i4.    ;        goto number error;
40817 124028       rl  w1     0      ;
40818 124030                         ;
40819 124030       ls  w1     -9     ;
40820 124032       ea. w1     1      ;      noofpart := (size//512) + 1;
40821 124034       so  w1     2.1    ;      if mod(noofpart,2) = 0 then 
40822 124036       ea. w1     1      ;        noofpart := noofpart + 1;
40823 124038       rs. w1     j2.    ;
40824 124040                         ;
40825 124040       al  w3     0      ;      noofkeys := size//noofpart;
40826 124042       rl. w0     j1.    ;
40827 124044       wd  w0     2      ;
40828 124046       rs. w0     j3.    ;
40829 124048                         ;
40830 124048       wm  w0     2      ;      size := noofkeys * noofpart;
40831 124050       rs. w0     j1.    ;    end;
40832 124052                         ;
40833 124052                         ;comment type maincatalog size information;
40834 124052  i2:                    ;
40835 124052       rl. w1     j9.    ;    writetext(catalogname);
40836 124054       jl. w3     f43.   ;
40837 124056       al. w1     j5.    ;    writetext(<:size:>);
40838 124058       jl. w3     f43.   ;
40839 124060       rl. w1     j1.    ;    writeinteger(size);
40840 124062       jl. w3     f49.   ;
40841 124064                         ;
40842 124064       al. w1     j6.    ;    writetext(<:partitions:>);
40843 124066       jl. w3     f43.   ;
40844 124068       rl. w1     j2.    ;    writeinteger(noofpart);
40845 124070       jl. w3     f49.   ;
40846 124072                         ;
40847 124072       al. w1     j7.    ;    writetext(<:keys:>);
40848 124074       jl. w3     f43.   ;
40849 124076       rl. w1     j3.    ;    writeinteger(noofkeys);
40850 124078       jl. w3     f49.   ;
40851 124080       jl. w3     f3.    ;    typenewline;
40852 124082                         ;
40853 124082       rl. w2     j9.    ;
40854 124084       rl. w0     j3.    ;
40855 124086       hs  w0  x2+d12-d9+1;   save noofkeys in maincatalog;
40856 124088       rl. w0     j1.    ;
40857 124090       rs  w0  x2+d10-d9 ;    save size of maincat in maincat;
40858 124092                         ;
40859 124092  i3:  rl. w0     j4.    ;    if type = integer then
40860 124094       sn  w0     2      ;      goto next command
40861 124096       jl.        f31.   ;
40862 124098       jl.        f32.   ;    else goto exam command;
40863 124100                         ;
40864 124100  i4:                    ; number error:
40865 124100       rs. w0     j1.    ;    save erroneous number
40866 124102       al. w1     j10.   ;    writetext(<:erroneous number::>);
40867 124104       jl. w3     f43.   ;
40868 124106       rl. w1     j1.    ;    writeinteger(number);
40869 124108       jl. w3     f49.   ;
40870 124110       jl. w3     f3.    ;    typetextline;
40871 124112       jl.        i3.    ;    goto return;
40872 124114                         ;
40873 124114                         ;
40874 124114  j1:  0                 ; first integer
40875 124116  j2:  0                 ; no of partitions
40876 124118  j3:  0                 ; no of keys
40877 124120  j4:  0                 ; type
40878 124122  j5: <:  size:<0>:>
40879 124128  j6: <:  partitions:<0>:>
40880 124138  j7: <:  keys:<0>:>
40881 124144  j9:  d9                ; maincatalog name address
40882 124146  j10: <:erroneous number:<0>:>
40883 124158  
40883 124158  e.                     ;
40884 124158  
40884 124158  
40884 124158  
40884 124158  ; command syntax:  oldcat
40885 124158  
40885 124158  b. i10, j15 w.
40886 124158  
40886 124158  ; oldcat action:
40887 124158  g48:                   ; oldcat-command:
40888 124158       al. w3     f31.   ;    return := next command;
40889 124160  g11:                   ; automatic oldcat:
40890 124160       rs. w3     j6.    ;    save (return);
40891 124162       rl. w0     j7.    ;
40892 124164       rs. w0     j9.    ;    number index := first bs device;
40893 124166       al. w0     i0.    ;
40894 124168       rs. w0     j10.   ;    read action := get next from list;
40895 124170       jl.        i1.    ;    goto next kitnumber;
40896 124172  
40896 124172  i0:                    ; get next from list:
40897 124172       rl. w1     j9.    ;    if number index = top of list then
40898 124174       sn. w1    (j8.)   ;
40899 124176       jl.       (j6.)   ;      return;
40900 124178       rl  w0  x1        ;
40901 124180       rs. w0    (d45.)  ;    param := device number (number index);
40902 124182       al  w1  x1+2      ;    increase (number index);
40903 124184       rs. w1     j9.    ;
40904 124186       rl  w1     0      ;
40905 124188       ls  w1    +1      ;
40906 124190       wa  w1     b4     ;
40907 124192       sl  w1    (b4)    ;    if devno not within external then
40908 124194       sl  w1    (b5)    ;       skip it and goto get next from list;
40909 124196       jl.        i0.    ;
40910 124198       rl  w1  x1        ;
40911 124200       rl  w2  x1+a10    ;    if device(devno).kind = idamain then
40912 124202       se  w2     20     ;    begin
40913 124204       jl.        i3.    ;
40914 124206       al  w1  x1+a11    ;
40915 124208       al. w2     j5.    ;
40916 124210       jl. w3     f46.   ;      connect(idamain,param);
40917 124212       am         j14    ;      +0: if error then text := <:connect error:>
40918 124214       al. w1     j12.   ;      +2: else text := <:disc 0 0  connected to:>;
40919 124216       rs. w0     j13.   ;      <*save logical status*>
40920 124218       jl. w3     f43.   ;      write(text);
40921 124220       rl. w0     j13.   ;
40922 124222       se  w0     1<1    ;
40923 124224       am        -4      ;
40924 124226       rl  w1     4      ; 
40925 124228       se  w0     1<1    ;      if logical status <> ok then
40926 124230       am         f53-f49;           writebits(logical status)
40927 124232       jl. w3     f49.   ;      else writeinteger(devno);
40928 124234       al  w0     10     ;
40929 124236       jl. w3     f0.    ;      type char(nl);
40930 124238       rl. w0     j13.   ;
40931 124240       se  w0     1<1    ;      if connect status <> ok then
40932 124242       jl.        i0.    ;      goto get next from list;
40933 124244       al  w0  x2        ;
40934 124246       jl. w3     f50.   ;      linkall(devno);
40935 124248  c.(:a399>21a.1:)-1
40936 124248       jl. w3     f59.   ;      initial_preparedump;
40937 124248  z.
40938 124248       jl.        i0.    ;      goto get next from list;
40939 124250                         ;    end
40940 124250  i3:                    ;    else begin
40941 124250       al  w0     2      ;    param kind := integer;
40942 124252       jl.        i5.    ;    return to kit;
40943 124254  
40943 124254  
40943 124254  
40943 124254  
40943 124254  ; command syntax:  kit <docname> (<auxcatname> (<kind>)) <device number>
40944 124254  ;             or:  kit (<device number>)*
40945 124254  ; g47 entrypoint used from resident linkall command
40946 124254  ;      at entry: w2: devno
40947 124254  ;                w3: link
40948 124254  
40948 124254  g47:
40949 124254  
40949 124254       rs. w2    (d45.)   ; kit: 2nd entry point
40950 124256       rs. w3     j10.    ;
40951 124258       al  w0    -1       ;
40952 124260       rs. w0     e2.     ;    docname := unchanged;
40953 124262       rs. w0     d3.     ;    bskind  := unchanged;
40954 124264       al  w0     2       ;    param.kind := integer;
40955 124266       jl.        i5.     ;    goto test;
40956 124268  
40956 124268  g43:                   ; kit:
40957 124268       al. w3     f33.   ;    read action := next param;
40958 124270       rs. w3     j10.   ;
40959 124272  
40959 124272       al  w0    -1      ;
40960 124274       rs. w0     e2.    ;    docname := unchanged;
40961 124276       rs. w0     d3.    ;    bskind := unchanged;
40962 124278  
40962 124278       jl. w3     f33.   ;    next param;
40963 124280       se  w0     1      ;    if kind <> name then
40964 124282       jl.        i5.    ;      goto test;
40965 124284  
40965 124284       al. w2     e2.    ;    docname := name;
40966 124286       jl. w3     f37.   ;
40967 124288  
40967 124288       rl. w0     j0.    ;    (prepare no auxcatname parameter)
40968 124290       rs. w0     e1.    ;
40969 124292  
40969 124292       al. w2     e1.+2  ;    auxcatname := <:cat:> + docname;
40970 124294       jl. w3     f37.   ;
40971 124296  
40971 124296       jl. w3     f33.   ;    next param;
40972 124298       se  w0     1      ;    if kind <> name then
40973 124300       jl.        i5.    ;      goto test;
40974 124302       al. w2     e1.    ;    auxcatname := name;
40975 124304       jl. w3     f37.   ;
40976 124306  
40976 124306       jl. w3     f33.   ;    next param;
40977 124308       se  w0     1      ;    if kind <> name then
40978 124310       jl.        i5.    ;      goto test;
40979 124312       jl. w3     f29.   ;    get bskind;
40980 124314       jl.        i2.    ;    goto get devno;
40981 124316  
40981 124316  i1:                    ; next kitnumber:
40982 124316       al  w0    -1      ;
40983 124318       rs. w0     e2.    ;    docname := unchanged;
40984 124320       rs. w0     d3.    ;    bskind := unchanged;
40985 124322  i2:                    ; get devno:
40986 124322       jl. w3    (j10.)  ;    next param;
40987 124324  i5:                    ; test:
40988 124324       se  w0     2      ;    if kind <> integer then
40989 124326       jl.        f32.   ;      goto exam command;
40990 124328  
40990 124328       rl. w0    (d45.)  ;    devno :=
40991 124330       rs. w0     d43.   ;      param;
40992 124332  
40992 124332       jl. w3     f21.   ;    read chain;
40993 124334       jl.        i1.    ;+2:   error:  goto next kitnumber;
40994 124336  
40994 124336  ; w3 = chainhead address
40995 124336  
40995 124336       dl  w1  x3+d61+2  ;    outtextline ( <docname> mounted on <devno>);
40996 124338       lo. w0     j1.    ;
40997 124340       lo. w1     j1.    ;
40998 124342       ds. w1     j3.    ;
40999 124344       dl  w1  x3+d61+6  ;
41000 124346       lo. w0     j1.    ;
41001 124348       lo. w1     j1.    ;
41002 124350       ds. w1     j4.    ;
41003 124352  
41003 124352       al. w1     j2.    ;
41004 124354       jl. w3     f2.    ;
41005 124356  
41005 124356       rl  w0     b25    ;    if no maincat yet then
41006 124358       se  w0     0      ;
41007 124360       jl.        i8.    ;      begin
41008 124362       jl. w3     f25.   ;      mount maincat;
41009 124364       jl.        f47.   ;+2:     error:  goto catalog error;
41010 124366  i8:                    ;      end;
41011 124366  
41011 124366       jl. w3     f23.   ;    insert all entries;
41012 124368       jl.        i1.    ;+2:   error:  goto next kitnumber;
41013 124370  
41013 124370  ; w3 = chainhead address
41014 124370  
41014 124370       al  w2  x3+d61    ;
41015 124372       jd         1<11+106;   insert bs (docname.chainhead);
41016 124374       sn  w0     0      ;    if result ok then
41017 124376       jl.        i1.    ;      goto next kitnumber;
41018 124378  
41018 124378       al. w2     i1.    ;    typeresult ( <:insert bs:>, result);
41019 124380       jl. w3     f5.    ;    goto next kitnumber;
41020 124382       <:insert bs   <0>:>  ;
41021 124392  
41021 124392  j0:  <:cat:>           ; standard start of cat-name
41022 124394  j1:  <:   :>           ; spaces for converting text to fixed length
41023 124396  j2:  0, r.4            ; text: <docname>
41024 124404    j3=j2+2              ;
41025 124404    j4=j2+6              ;
41026 124404       <: mounted :>     ;
41027 124410  d47: <:on :>           ;
41028 124412  d48: 0, r.3            ; <device number as text>
41029 124418       0                 ; (end of text)
41030 124420  
41030 124420  j6:  0                 ; return from oldcat
41031 124422  
41031 124422  j7:  d1                ; start of device number list for oldcat
41032 124424  j8:  d2                ; top   of device number list
41033 124426  j9:  0                 ; number index
41034 124428  j10: 0                 ; address of read action
41035 124430  j5:                    ; connect param area
41036 124430       0                 ; control module
41037 124432       0                 ; slave unit
41038 124434       b136              ; devno of connection
41039 124436  h.   6, 0   w.         ; disc kind=6, irr
41040 124438       5                 ; max outstanding operation
41041 124440  j11: <:createlink error<0>:>
41042 124452  j12: <:first physical disc linked to<0>:>
41043 124472  j13: 0
41044 124474  j14 = j11 - j12
41045 124474  e.                     ;
41046 124474  
41046 124474  
41046 124474  
41046 124474  ; command syntax:  kitlabel  <devno> <docname> <auxcatname> <bskind> ,
41047 124474  ;                             <catsize> <slicelength> (<number of slices> ) 
41048 124474  
41048 124474  b. i10, j10 w.
41049 124474  
41049 124474  g44:                   ; kitlabel:
41050 124474       jl. w3     f35.   ;    device number := next integer;
41051 124476       rs. w0     d43.   ;
41052 124478  
41052 124478       rl. w0    (d45.)  ;
41053 124480       rs. w0     d43.   ;    device number := param;
41054 124482  
41054 124482       al. w2     e2.    ;    docname := read name;
41055 124484       jl. w3     f36.   ;
41056 124486  
41056 124486       al. w2     e1.    ;    auxcatname := read name;
41057 124488       jl. w3     f36.   ;
41058 124490  
41058 124490  
41058 124490       jl. w3     f35.   ;    catsize := next integer;
41059 124492       rs. w0     d4.    ;
41060 124494  
41060 124494       jl. w3     f35.   ;    slicelength := next integer;
41061 124496       rs. w0     d5.    ;
41062 124498       jl. w3     f33.   ;    next param;
41063 124500       rs. w0     j4.    ;    save kind := kind;
41064 124502  ; if next param = integer then no of slices has been defined
41065 124502  ; compute max number of slices.
41066 124502  
41066 124502       al  w3     1      ;
41067 124504       rs. w3     d3.    ;    bskind:=disc;
41068 124506       rl. w3     d43.   ;
41069 124508       ls  w3    +1      ;    disc := nametable(devno);
41070 124510       wa  w3     b4     ;
41071 124512       sl  w3    (b4)    ;    if disc within external then
41072 124514       sl  w3    (b5)    ;    begin
41073 124516       jl.        i6.    ;
41074 124518       rl  w3  x3        ;
41075 124520       rs. w3     j1.    ;
41076 124522       rl  w1  x3+a74    ;      number of slices :=
41077 124524       al  w0     0      ;      disc.no of segments // slicelength;
41078 124526       wd. w1     d5.    ;
41079 124528       rs. w1     d6.    ;
41080 124530       rl. w0     j4.    ;      if savekind = integer and
41081 124532       se  w0     2      ;         integer > 0 and
41082 124534       jl.        i9.    ;         integer < number of slices then
41083 124536       rl. w1    (d45.)  ;         number of slices := integer;
41084 124538       sl  w1     0      ;
41085 124540       sl. w1    (d6.)   ;
41086 124542       rl. w1     d6.    ;
41087 124544       rs. w1     d6.    ;
41088 124546  i9:                    ;
41089 124546       sh  w1     2046   ;      if number of slices > max number of slices then
41090 124548       jl.        i7.    ;      begin
41091 124550       al. w3     i0.    ;        write(:<slicelength...:>);
41092 124552       jl. w1     f2.    ;        goto next label;
41093 124554  <:slicelength too small<0>:>
41094 124570                         ;      end;
41095 124570  i6:                    ;    end else
41096 124570       al. w3     i0.    ;    begin
41097 124572       jl. w1     f2.    ;      typetextline(<:illegal devno:>);
41098 124574  <:illegal devno<0>:>   ;      goto next label;
41099 124584                         ;    end;
41100 124584  i7:                    ;
41101 124584  
41101 124584  ; notice: if the device is already included in the bs-system, it will
41102 124584  ;         not automaticly be dismounted
41103 124584  
41103 124584       rl. w3     j0.    ;    w3 := start of chainhead buffer;
41104 124586  
41104 124586                         ;    move:
41105 124586  
41105 124586       rl. w1     d4.    ;           auxcat size
41106 124588       rs  w1  x3+d57    ;
41107 124590  
41107 124590       rl. w1     d5.    ;           slice length
41108 124592       rs  w1  x3+d64    ;
41109 124594  
41109 124594       rl. w1     d6.    ;           last slice
41110 124596       al  w1  x1-1      ;                      (= number of slices - 1)
41111 124598       hs  w1  x3+d66    ;
41112 124600  
41112 124600       al  w1  x1+a88+1+511;         first slice of aux catalog
41113 124602       ls  w1    -9      ;
41114 124604       al  w0     0      ;             ( = (size of chainhead + number of slices)
41115 124606       wd  w1  x3+d64    ;               / slice length )
41116 124608       se  w0     0      ;
41117 124610       al  w1  x1+1      ;             (rounded up to an integral number of slices))
41118 124612       hs  w1  x3+d54    ;
41119 124614  
41119 124614       al  w1     0      ;           first slice in chaintable
41120 124616       hs  w1  x3+d67    ;                      (= 0)
41121 124618  
41121 124618  ; setup chains for the whole chaintable etc
41122 124618  
41122 124618       al  w0     1      ;
41123 124620       bz  w1  x3+d66    ;    w1 := last slice number;
41124 124622  
41124 124622  i5:                    ; next slice:
41125 124622       am      x3+a88    ;
41126 124624       hs  w0  x1        ;    slice (w1) := 1;
41127 124626       al  w1  x1-1      ;    decrease (w1);
41128 124628       sl  w1     0      ;    if not all slices initialized then
41129 124630       jl.        i5.    ;      goto next slice;
41130 124632  
41130 124632       jl. w3     f22.   ;    write chain;
41131 124634       jl.        i0.    ;+2:   error:  goto next label;
41132 124636  
41132 124636  ; clear auxcat
41133 124636  
41133 124636       rl. w1     d29.   ;    w1 := last  of load buffer;
41134 124638       rl. w2     d28.   ;    w2 := first of load buffer;
41135 124640        am      -2048   ;
41136 124642       jl. w3     f11.+2048;    clear (from, to);
41137 124644  
41137 124644       al  w0     0      ;    last word of buffer := 0;
41138 124646       rs  w0  x1        ;
41139 124648  
41139 124648       al. w1     d30.   ;    w1 := load buffer message;
41140 124650       rs  w0  x1+6      ;    segment.message := 0;
41141 124652  
41141 124652       al. w3     e1.    ;    name := auxcat name;
41142 124654  
41142 124654  i8:                    ; next segment:
41143 124654       jl. w2     f12.   ;    outsegment (auxcat, buffer);
41144 124656       jl.        i10.   ;+2:   trouble:  goto dismount;
41145 124658  
41145 124658       rl  w0  x1+6      ;    w0 := segment number of message;
41146 124660       se. w0    (d4.)   ;    if segment.message <> auxcat size then
41147 124662       jl.        i8.    ;      goto next segment;
41148 124664  
41148 124664       jd         1<11+64;    remove process (aux catalog);
41149 124666       rl. w1     j1.    ;
41150 124668       rl  w0  x1+a10    ;    if disc = idadisc and 
41151 124670       se  w0     6      ;       disc.type = logical then
41152 124672       jl.        i0.    ;    begin
41153 124674       zl  w0  x1+a57    ;
41154 124676       so  w0     2.01   ;
41155 124678       jl.        i0.    ;
41156 124680                         ;
41157 124680       rl  w1  x1+a50    ;      for autodisc := disc.main.next logical disc, next do
41158 124682  i1:  rl  w1  x1+a70    ;          if autodisc = 0 then
41159 124684       sn  w1     0      ;             goto next label
41160 124686       jl.        i0.    ;          else
41161 124688       rl  w0  x1+a73    ;          if autodisc.first segment = 0 then
41162 124690       se  w0     0      ;             goto found0;
41163 124692       jl.        i1.    ;
41164 124694                         ; found0:
41165 124694       rl  w2     b4     ;      for external := first external, next do
41166 124696  i2:  sn  w2    (b5)    ;          if external = area then 
41167 124698       jl.        i0.    ;             goto next label
41168 124700       rl  w3  x2        ;          else
41169 124702       sn  w3  x1        ;          if external = autodisc then
41170 124704       jl.        i3.    ;             goto found1;
41171 124706       al  w2  x2+2      ;
41172 124708       jl.        i2.    ;
41173 124710                         ; found1:
41174 124710  i3:  ws  w2     b4     ;      devno of autodisc :=
41175 124712       ls  w2    -1      ;      (nametable(autodisc) - nametablestart) / 2;
41176 124714       rs. w2     j2.    ;
41177 124716                         ;
41178 124716       al  w1  x2        ;
41179 124718       al  w0     0      ;
41180 124720       jl. w3     f51.   ;      read segment(autodisc.devno, 0);
41181 124722       jl.        i0.    ;      +0: if error then goto next label;
41182 124724                         ;      +2:
41183 124724       rl. w1     j3.    ;      pointer :=
41184 124726       rl  w2  x1+0      ;      (buffer.no of file * 2 + 1) * 2;
41185 124728       ls  w2    +1      ;
41186 124730       al  w2  x2+1      ;
41187 124732       ls  w2    +1      ;      pointer :=
41188 124734       am      x1        ;      pointer + buffer start + 2;
41189 124736       al  w2  x2+2      ;      <*skip no of logical disc*>
41190 124738       al  w1  x1+512    ;      if pointer outside buffer then goto next label;
41191 124740       sl. w2    (j3.)   ;      <*uninitialized buffer*>
41192 124742       sl  w2  x1        ;
41193 124744       jl.        i0.    ;
41194 124746       zl  w1  x2-2      ;      size := buffer(pointer - 2);
41195 124748       rs. w1     j5.    ;
41196 124750                         ;
41197 124750       rl. w1     j1.    ;
41198 124752       sz                ;
41199 124754  i4:  wa. w2     j5.    ;      for descr := buffer(pointer) step descr size do
41200 124756       dl  w0  x2+2      ;      begin
41201 124758       sn  w3    -1      ;
41202 124760       jl.        i0.    ;        if descr.first segment = -1 then
41203 124762                         ;           goto next label;
41204 124762       sn  w3 (x1+a73)   ;        if descr.first segment = disc.first segment and
41205 124764       se  w0 (x1+a74)   ;           descr.no of segments= disc.no of segments then
41206 124766       jl.        i4.    ;        begin
41207 124768                         ;
41208 124768       al  w0     2.010  ;          descr.type := descr.type or with catalog;
41209 124770       ls  w0    +12     ;
41210 124772       lo  w0  x2+4      ;
41211 124774       rs  w0  x2+4      ;
41212 124776       al  w0     0      ;
41213 124778       rl. w1     j2.    ;
41214 124780       jl. w3     f52.   ;          write segment(autodisc.devno, 0);
41215 124782       jl.        i0.    ;          +0:
41216 124784                         ;          +2:
41217 124784                         ;        end;
41218 124784                         ;      end;
41219 124784                         ;    end *** ida disc ***;
41220 124784  
41220 124784       jl.        i0.    ;    goto next label;
41221 124786  
41221 124786  
41221 124786  i10:                   ; dismount:
41222 124786       jd         1<11+64;    remove process (aux catalog);
41223 124788       jl. w3     f24.   ;    dismount kit;
41224 124790       jl.        i0.    ;+2:   error:  goto next label;
41225 124792  i0:                    ; next label: <*next command!!*>
41226 124792       rl. w0     j4.    ;    if saved kind <> integer then
41227 124794       se  w0     2      ;         examine command
41228 124796       jl.        f32.   ;    else
41229 124798       jl.        f31.   ;         next command;
41230 124800  
41230 124800  j0:  h8                ; start of chainhead
41231 124802  j1:  0                 ;    disc process address
41232 124804  j2:  0                 ;    devno of autodisc
41233 124806  j3:  b139              ;    start of disc description buffer
41234 124808  j4:  0                 ;    kind of next param
41235 124810  j5:  0                 ;    size of log disc description
41236 124812  
41236 124812  e.                     ;
41237 124812  
41237 124812  jl.  f60. , f60= k-2   ; stepping stone
41238 124814  
41238 124814  
41238 124814  
41238 124814  ; command syntax:  repair
41239 124814  
41239 124814  g45:                   ; repair:
41240 124814       al  w0    -1      ;    repair allowed := true;
41241 124816       rs. w0     d44.   ;
41242 124818       jl.        f31.   ;    goto next command;
41243 124820  
41243 124820  
41243 124820  
41243 124820  ; command syntax:  auxclear (<bskind>) <device number> (<lower> <upper> <name>)*
41244 124820  
41244 124820  b. i10, j10 w.
41245 124820  
41245 124820  g49:                   ; auxclear:
41246 124820       al. w3     e1.    ;
41247 124822       jd         1<11+68;    get wrk-name (auxcat name);
41248 124824       al. w3     e2.    ;
41249 124826       jd         1<11+68;    get wrk-name (docname);
41250 124828  
41250 124828       al  w0    -1      ;
41251 124830       rs. w0     d3.    ;    bskind := unchanged;
41252 124832  
41252 124832       jl. w3     f33.   ;    next param;
41253 124834       se  w0     1      ;    if kind = name then
41254 124836       jl.        i1.    ;      begin
41255 124838       jl. w3     f29.   ;      get bskind;
41256 124840       jl. w3     f33.   ;      next param;
41257 124842  i1:                    ;      end;
41258 124842  
41258 124842       se  w0     2      ;    if kind <> integer then
41259 124844       jl.        f30.   ;      goto syntax error;
41260 124846  
41260 124846       rl. w0    (d45.)  ;
41261 124848       rs. w0     d43.   ;    devno := integer;
41262 124850  
41262 124850       jl. w3     f21.   ;    read chain;
41263 124852       jl.        f30.   ;+2:   error:  goto syntax (or better: goto ready);
41264 124854  
41264 124854       al  w3  x3+d55    ;
41265 124856       jd         1<11+64;    remove process (aux cat);
41266 124858  
41266 124858  i3:                    ; next entry:
41267 124858       jl. w3     f33.   ;    next param;
41268 124860       se  w0     2      ;    if kind <> integer then
41269 124862       jl.        i9.    ;      goto dismount;
41270 124864  
41270 124864       rl. w0    (d45.)  ;
41271 124866       rs. w0     j1.    ;    lower interval := param;
41272 124868       jl. w3     f35.   ;
41273 124870       rs. w0     j2.    ;    upper interval := next integer;
41274 124872  
41274 124872       al. w2     j3.    ;    entry name :=
41275 124874       jl. w3     f36.   ;      read name;
41276 124876  
41276 124876       al. w1     j0.    ;    w1 := entry;
41277 124878       al. w2     e2.    ;    w2 := docname;
41278 124880       jd         1<11+122;   remove aux entry (entry, docname);
41279 124882       sn  w0     0      ;    if result ok then
41280 124884       jl.        i3.    ;      goto next entry;
41281 124886  
41281 124886       al. w1     j5.    ;
41282 124888       jl. w3     f1.    ;    typeout (<:remove aux entry:>);
41283 124890  
41283 124890       al. w3     j2.    ;    w3 := entry name;
41284 124892       jl. w2     f5.    ;    typeresult (result, entry name);
41285 124894  
41285 124894       jl.        i3.    ;    goto next entry;
41286 124896  
41286 124896  i9:                    ; dismount:
41287 124896       jl. w3     f24.   ;    dismount kit;
41288 124898       jl.        f32.   ;+2:   error:  goto exam command;
41289 124900       jl.        f32.   ;    goto exam command;
41290 124902  
41290 124902  j0 = k-2               ; entry:
41291 124902  j1:  0                 ;   lower interval
41292 124904  j2:  0                 ;   upper interval
41293 124906  j3:  0, r.4            ;   entry name
41294 124914  
41294 124914  j5:  <:remove aux entry<0>:>
41295 124926  
41295 124926  e.                     ;
41296 124926  
41296 124926  
41296 124926  
41296 124926  ; command syntax:  binin <modekind> <docname> (<position>)*
41297 124926  
41297 124926  b. i10, j21 w.
41298 124926  
41298 124926  m.
41298 124926                       binin included

41299 124926  g46:                   ; binin:
41300 124926       jl. w3     f34.   ;    next name;
41301 124928       rl. w3     d46.   ;
41302 124930       dl  w0  x3+2      ;    w3w0 := parameter;
41303 124932       jl.        i9.    ;    goto search modekind
41304 124934  
41304 124934  i0:
41305 124934  ; w2 = entry in mode-table
41306 124934  
41306 124934       rl  w3  x2+j4     ;    modekind := table-contents;
41307 124936       rs. w3     d40.   ;
41308 124938  
41308 124938       al. w2     e1.    ;    device name := read name;
41309 124940       jl. w3     f36.   ;
41310 124942  
41310 124942       jl. w3     f35.   ;    position := next integer;
41311 124944  
41311 124944       jl.        g13.   ;    goto initialize input;
41312 124946  
41312 124946  i5:                    ; modekind illegal:
41313 124946       al. w1     j8.    ;    type textline (<:modekind illegal:>);
41314 124948       jl. w3     f2.    ;
41315 124950  
41315 124950       jl.        f31.   ;    goto next command;
41316 124952  
41316 124952  g54:                   ; end:
41317 124952       jl. w3     f17.   ;    end transfer;
41318 124954       jl. w3     f33.   ;    next param;
41319 124956       se  w0     2      ;    if kind <> integer then
41320 124958       jl.        f32.   ;      goto exam command;
41321 124960       rl. w0    (d45.)  ;    position := param;
41322 124962  
41322 124962  g13:                   ;
41323 124962       rs. w0     d41.   ;    save (position);
41324 124964  
41324 124964  ; initialize input
41325 124964       al  w0      0      ;
41326 124966       al  w1     -1      ;   characters := 0;
41327 124968       ds. w1    d18.     ;   cur char := -1;
41328 124970       rs. w0    d35.     ;   sum := 0;
41329 124972       jl. w3    f15.     ;   start transfer input;
41330 124974  
41330 124974    g1: rl. w1  d24.      ; input commands:
41331 124976        rs. w1  d26.      ;   cur command:=
41332 124978        al  w2  x1      ;   null-char allowed at start of buffer;
41333 124980    g2: jl. w3  f8.       ;   top command:=command buf;
41334 124982        jl.     g54.      ;
41335 124984        jl.     g4.       ;   repeat
41336 124986        sh. w1 (d25.)     ;   input word(input, end-action,next command);
41337 124988        jl.     g3.       ;   if top command>command end then
41338 124990        al. w1  e11.      ;   begin
41339 124992                         ; type textline (<:input sizeerror:>);
41340 124992        jl. w3  f2.       ;   goto end-action;
41341 124994        jl.     g54.      ;   end;
41342 124996    g3: rs  w0  x1+0      ;   word(command top):=input;
41343 124998        al  w1  x1+2      ;   command top:=command top+2;
41344 125000        jl.     g2.       ;   until no limit;
41345 125002    g4: rs. w1  (j9.)     ;
41346 125004    g5: rl. w1  (j7.)     ; next command:
41347 125006        rl. w3  (j9.)     ;
41348 125008        sl  w1   x3       ;   if cur command>=command end
41349 125010        jl.     g1.       ;   then goto input commands;
41350 125012       dl  w1  x1+2       ;   w0 := first word of command;
41351 125014       ds. w1     j20.    ;   save command;
41352 125016                          ;   cur action := action table;
41353 125016    g6: rl. w2 (j18.)     ;   repeat
41354 125018    g7: sn  w0 (x2+0)     ;   if word(cur action)=word(cur command)
41355 125020        jl.     g8.       ;   then goto before command;
41356 125022        al  w2  x2+6      ;   cur action:=cur action+6;
41357 125024        rl. w1 (j17.)     ;
41358 125026        sh  w2  x1        ;
41359 125028        jl.     g7.       ;   until cur action>action end;
41360 125030        jl. w2  f4.       ;   typecommand;
41361 125032        al. w1  e13.      ;
41362 125034        jl. w3  f2.       ;   type textline(<:syntaxerror:>);
41363 125036        jl.     g54.      ;   goto end-action;
41364 125038    g8: rs. w2 (j16.)     ; before command:
41365 125040        rl. w3 (j7.)      ;
41366 125042        al  w3  x3+4      ;
41367 125044        al  w1  x3+8      ;
41368 125046        jl     (x2+2)     ;   goto word(cur action+2);
41369 125048  ;     w1=cur command+12   w3=cur command+4
41370 125048  
41370 125048    g9: rl. w2 (j16.)     ; after command:
41371 125050        rl. w1 (j7.)      ;
41372 125052        wa  w1  x2+4      ;   cur command:=
41373 125054        rs. w1 (j7.)      ;   cur command+word(cur action+4);
41374 125056        jl.     g5.       ;   goto next command;
41375 125058  
41375 125058  ; local procedure type command;
41376 125058  ;
41377 125058  ; call: w2=link
41378 125058  ; exit: w0,w2,w3=unch, w1=undef
41379 125058  f4:  rs. w2     j21.   ; type command:
41380 125060       ds. w0     j6.    ;   save regs;
41381 125062       al. w1     j19.   ;
41382 125064       jl. w3     f1.    ;   typetext (command name);
41383 125066       dl. w0     j6.    ;   restore regs;
41384 125068       jl.       (j21.)  ;   return;
41385 125070  j21: 0
41386 125072  
41386 125072                          ; create:
41387 125072    g20:jd  1<11+48       ;   (remove maybe an old entry)
41388 125074        jd  1<11+40       ;   create entry(name,tail,result);
41389 125076        jl.     g25.      ;   goto test result;
41390 125078  
41390 125078                          ; change:
41391 125078    g21:jd  1<11+44       ;   change entry(name,tail,result);
41392 125080        jl.     g25.      ;   goto test result;
41393 125082  
41393 125082                          ; rename:
41394 125082    g22:jd  1<11+46       ;   rename entry(name,result);
41395 125084        jl.     g25.      ;   goto test result;
41396 125086  
41396 125086                          ; remove:
41397 125086    g23:jd  1<11+48       ;   remove entry(name,tail,result);
41398 125088        jl.     g25.      ;   goto test result;
41399 125090  
41399 125090    g24:rl  w1  x1+0      ; perman:
41400 125092        jd  1<11+50       ;   permanent entry(name,key,result);
41401 125094        
41401 125094                          ; test result:
41402 125094    g25:sn  w0  0         ;   if result<>0 then
41403 125096        jl.     g9.       ;   begin
41404 125098        jl. w2  f4.       ;   typecommand;
41405 125100        jl. w2  f5.       ;   typeresult(result, name);
41406 125102        jl.     g54.      ;   goto end-action;
41407 125104                          ;   end;
41408 125104                          ;   goto after command;
41409 125104  
41409 125104    g30:al  w0  0         ; load:
41410 125106        rl  w1  x1+0      ;   input seg:=0;
41411 125108        ds. w1 (j12.)     ;   max seg:mand param;
41412 125110        sh  w1  0         ;   if max seg<=0
41413 125112        jl.     g9.       ;   then goto after command;
41414 125114        am.    (j14.)     ;
41415 125116        rs  w0  +6        ;   cur seg:=0;
41416 125118        jd  1<11+52       ;   create area process(name,result);
41417 125120        se  w0  0         ;   if result<>0
41418 125122        jl.     g25.      ;   then goto test result;
41419 125124        jd  1<11+8        ;   reserve process(name,result);
41420 125126    g31:rl. w1 (j13.)     ; next buf: addr:=load buf;
41421 125128        al  w2  0         ;   null-char := not allowed;
41422 125130    g32:jl. w3  f8.       ; next word:
41423 125132        jl.     g35.      ;
41424 125134        jl.     g33.      ;   inword(binword,after trouble,next segment;
41425 125136        rs  w0  x1+0      ;   word(addr):=bin word;
41426 125138        al  w1  x1+2      ;   addr:=addr+2;
41427 125140       rl. w3 (j15.)     ;    if addr<=load end
41428 125142       sh  w1  x3        ;
41429 125144        jl.     g32.      ;   then goto next word;
41430 125146        rl. w1  j14.      ;
41431 125148        rl. w3 (j7.)      ;
41432 125150        al  w3  x3+4      ;
41433 125152        jl. w2  f12.      ;   outseg(name, area output,
41434 125154        jl.     g35.      ;            after trouble);
41435 125156        jl.     g31.      ;   goto next buf;
41436 125158    g33:rl. w3 (j11.)     ; next segment:
41437 125160        al  w3  x3+1      ;
41438 125162        rs. w3 (j11.)     ;   input seg:=input seg+1;
41439 125164       rl. w2 (j12.)     ;    if input seg<>max seg
41440 125166       se  w3  x2        ;
41441 125168        jl.     g32.      ;   then goto next word;
41442 125170       rl. w2 (j13.)     ;
41443 125172       sn  w1  x2        ;
41444 125174        jl.     g34.      ;   if addr<>load buf then
41445 125176       rl. w1  j14.      ;
41446 125178        rl. w3 (j7.)      ;
41447 125180        al  w3  x3+4      ;
41448 125182        jl. w2  f12.      ;   outseg(name, area output,
41449 125184        jl.     g35.      ;            after trouble);
41450 125186    g34:rl. w3 (j7.)      ; after load:
41451 125188        al  w3  x3+4      ;
41452 125190        jd  1<11+64       ;   remove process(name,result);
41453 125192        jl.     g9.       ;   goto after command;
41454 125194  
41454 125194    g35:rl. w3 (j7.)      ; after trouble:
41455 125196        al  w3  x3+4      ;
41456 125198        jd  1<11+64       ;   remove process(name,result);
41457 125200        jl.     g54.      ;   goto end-action;
41458 125202  j7:   d26               ;
41459 125204  j9:   d27               ;
41460 125206  j11:  d33               ;
41461 125208  j12:  d34               ;
41462 125210  j13:  d28               ;
41463 125212  j14:  d30               ;
41464 125214  j15:  d29               ;
41465 125216  j16:  d21               ;
41466 125218  j17:  d20               ;
41467 125220  j18:  d19               ;
41468 125222  
41468 125222  m0 = 0                 ; bs-kind
41469 125222  m1 = 2                 ; mt-kind
41470 125222  m2 = 4                 ; tr-kind
41471 125222  
41471 125222  ;    name    , modekind,  tabelentry size
41472 125222       j3=0    ,  j4=2   ,  j1=j4+2
41473 125222  j0:                    ; start of table:
41474 125222  ;           mode<12 + devicekind
41475 125222       <:bs:>  ,      m0 ;
41476 125226       <:mto:> ,    0+m1 ;
41477 125230       <:nrz:> , 4<12+m1 ;
41478 125234       <:tro:> ,      m2 ;
41479 125238       <:flx:> ,      m1 ;
41480 125242       <:mt0:> ,12<12+m1 ; mt08
41481 125246       <:mt3:> , 8<12+m1 ; mt32
41482 125250       <:mt1:> , 4<12+m1 ; mt16
41483 125254       <:mt6:> , 0<12+m1 ; mt62
41484 125258  j2:                    ; top of table
41485 125258  
41485 125258  i9:  al. w2     j0.-j1 ;    search modekind:
41486 125260  
41486 125260  i1:                    ;
41487 125260       al  w2  x2+j1     ;    if modekind unknown then
41488 125262       sn  w0     0      ;
41489 125264       sn. w2     j2.    ;
41490 125266       jl.        i5.    ;     goto alarm;
41491 125268       se  w3 (x2+j3)    ;     if name in table<>param then
41492 125270       jl.        i1.    ;     then goto next in table else
41493 125272       jl.        i0.    ;     goto found;
41494 125274  
41494 125274  j8:  <:modekind illegal<0>:>
41495 125286  j19:   0               ; current command name
41496 125288  j20:   0               ;
41497 125290         0               ;   (end of name)
41498 125292  j5:    0               ; saved w3
41499 125294  j6:    0               ; saved w0
41500 125296  e.                     ; end binin-command
41501 125296  \f


41501 125296  
41501 125296  ; initialize main
41502 125296  ; call w3=link, return: all registers changed
41503 125296  ;
41504 125296  b. p2,s12,m3 w.
41505 125296  s0:
41506 125296  t.
41506 125296* type 

41507 125296  
41507 125296  m.
41507 125296   initialize dlc/ioc main

41508 125296  
41508 125296     <:iocmain1:>  , 0, 5
41509 125306  
41509 125306  n.m.
41509 125306                      link dlc/ioc main processes included

41510 125306  s1=k                    ; end of dlc/ioc devices
41511 125306  p0=0                    ; name
41512 125306  p1=8                    ; max buffers
41513 125306  p2= 10                  ; length
41514 125306  ;
41515 125306  s2:  0                  ; return
41516 125308  s3:  0                  ; current main
41517 125310  s10: <:clock:>,0,0,0   ;   clock-name and name table entry
41518 125320  
41518 125320  s11: 0<12              ;   delay message
41519 125322       5                 ;   time (in seconds) 
41520 125324  s12: 0,r.8             ;   answer area
41521 125340  
41521 125340  f57: rs. w3     s2.    ;
41522 125342       al. w3  s10.      ; wait:
41523 125344       al. w1  s11.      ;
41524 125346       jd      1<11+16   ;   send message(clock,wait);
41525 125348       al. w1  s12.      ;
41526 125350       jd      1<11+18   ;   wait answer(answer area);
41527 125352                         ;
41528 125352       al. w1     s0.    ; first main
41529 125354  m0:  rs. w1     s3.    ;
41530 125356       sl. w1     s1.    ; if list exchausted then
41531 125358       jl.        (s2.)  ; return
41532 125360  m2:  rl. w1     s3.    ;   end;
41533 125362       rl  w2  x1+8      ;  w1:=name; w2:=param
41534 125364       jl. w3     f60.   ;  initialize main
41535 125366       am         0      ;
41536 125368       rl. w1     s3.    ;
41537 125370       al  w1  x1+p2     ;  next main
41538 125372       jl.        m0.    ;
41539 125374  e.
41540 125374  
41540 125374  c.(:a399>21a.1:)-1
41541 125374  ; initial prepare dump
41542 125374  b. i5,j17 w.
41543 125374  f59: rs. w3     j3.    ;
41544 125374       al. w3     j4.    ;
41545 125374       al. w1     j5.    ;
41546 125374       jd         1<11+42; lookup_entry(name,tail);
41547 125374       se  w0     0      ; if dumparea exist then
41548 125374       jl.        i5.    ; begin
41549 125374       rl  w0  x1        ;
41550 125374       sl. w0     (j6.)  ;   if tail.size < min_size then
41551 125374       jl.        i0.    ;   begin
41552 125374       rl. w0     j6.    ;
41553 125374       rs  w0  x1        ;
41554 125374       jd         1<11+44;     change_entry(name,tail);
41555 125374       se  w0     0      ;     if new size set then
41556 125374       jl.        i5.    ;     begin
41557 125374  i0:  jd         1<11+52;       create area process;
41558 125374       jd         1<11+4 ;       processs description;
41559 125374       sn  w0     0      ;       if process exist then
41560 125374       jl.        i5.    ;       begin
41561 125374       rs. w0     j14.   ;
41562 125374       rl. w2     j5.    ;         segm_count:=file_size;
41563 125374                         ;       end;
41564 125374                         ;     end;
41565 125374                         ;   end;
41566 125374                         ; end;
41567 125374  
41567 125374  i1:                    ; calculate_low_and_high_addresses:
41568 125374       sl  w2     (b225) ; if sgm_count > 8388608/512 then
41569 125374       rl  w2     b225   ; segm_count:=16384;
41570 125374       ls  w2     9      ; last_file_addr:=segm_count*512;
41571 125374       sl  w2     0      ; if last_file_addr>8388607 then
41572 125374       rl  w2     b212   ; last_file_addr:=8388607;
41573 125374       sl  w2     (b12)  ; if last_file_addr>top_core then
41574 125374       rl  w2     b12    ; last_file_addr:=top_core;
41575 125374       ls  w2     -1     ;
41576 125374       ls  w2     1      ;
41577 125374       rl. w3     j15.   ;
41578 125374       sh  w3     (b3)   ; if process descr in low core then
41579 125374       jl.        i3.    ;
41580 125374  i2:                    ; set_low:
41581 125374                         ; begin
41582 125374       rs. w2     j11.   ;   low.last:=  last_file_addr;
41583 125374       rs. w2     j11.   ;   low.last:=  last_file_addr;
41584 125374       rs. w2     j11.   ;   high.first:=last_file_addr;
41585 125374       jl.        i4.    ;   goto start_pp;
41586 125374                         ; end;
41587 125374  i3:  sh  w2  x3        ; if last_file_addr>s_top then
41588 125374       jl.        i2.    ; begin
41589 125374       rs. w3     j11.   ;   low.last:=s_top;
41590 125374       rl  w1     b3     ;
41591 125374       rs. w1     j12.   ;   high.first:=name table start;
41592 125374       ws  w2     6      ;   top_size:=last_file_addr-s_top;
41593 125374       ld  w3     -24    ;   extend top_size;
41594 125374       al  w0      0     ;
41595 125374       aa  w3      2     ;   last_address:=high.first+top_size;
41596 125374       ls  w3      1     ;
41597 125374       ls  w3     -2     ;
41598 125374       ls  w3      1     ;
41599 125374       rs. w3     j13.   ;   high.last:=last_file_addr-s_top+name_table_start;
41600 125374                         ; end;
41601 125374  
41601 125374  i4:                    ; start_pp:
41602 125374       al. w2     j10.   ;
41603 125374       rl. w1     j14.   ;
41604 125374       jl. w3     f58.   ; prepare_dump(pda ext/area_proc,address_buff);
41605 125374       am         0      ;
41606 125374       jl.        (j3.)  ;
41607 125374  
41607 125374  j3:  0                 ; return address
41608 125374  j4:  <:dumparea:>,0    ;
41609 125374  j5:  0,r.10            ; tail
41610 125374  j6:  b151              ; min size (=162 segments)
41611 125374  j10: a398              ; low.first
41612 125374  j11: 0                 ; low.last
41613 125374  j12: 0                 ; high.first
41614 125374  j13: 0                 ; high.last
41615 125374  ;
41616 125374  j14: 0                 ; pda of external_proc or area_proc
41617 125374  j15: h12               ; s_top
41618 125374  j16: b139              ; first of data buffer
41619 125374  j17: b152  ; e102      ; device number for first physical disc
41620 125374  ;
41621 125374  i5:  rl. w3     (j17.) ;
41622 125374       ls  w3     1      ;
41623 125374       wa  w3     b4     ;
41624 125374       rl  w3  (x3)      ;
41625 125374       se  w3     q6     ; if kind=disc_kind then
41626 125374       jl.        (j3.)  ; begin
41627 125374       al  w0     0      ;
41628 125374       rl. w1     (j17.) ;
41629 125374       jl. w3     f51.   ;   read_segm(devno,segm_no);
41630 125374       jl.        (j3.)  ;
41631 125374       rl. w3     j16.   ;
41632 125374       rl  w1  x3        ;
41633 125374       sh  w1     0      ;   if empty then
41634 125374       jl.        (j3.)  ;   return else
41635 125374       rl  w2  x3+4      ;   segm_count:=dump_area.last_segm;
41636 125374       ls  w1     2      ;
41637 125374       al  w1  x1+4      ;   disc_descr:=first_logical_disc_descr;
41638 125374       el  w3  x1+5      ;
41639 125374       ls  w3     1      ;
41640 125374       wa  w3     b4     ;
41641 125374       rs. w3     j14.   ;   save process description address
41642 125374                         ; end;
41643 125374       jl.        i2.    ; goto caculate_low_and_high_addr;
41644 125374  z.
41645 125374  
41645 125374  
41645 125374  d1=k  ; first chain head
41646 125374   t.
41646 125374* type 

41647 125374  ; initiation information.
41648 125374  
41648 125374  m.
41648 125374    init catalog definition

41649 125374     30   ; iocmain1
41650 125376  n.m.
41650 125376                  init catalog definition of bs included

41651 125376  d2=k  ; chain head end
41652 125376  
41652 125376  
41652 125376  ; action table:
41653 125376  ; each command is described by its name, the address of
41654 125376  ; the command action, and the number of command bytes.
41655 125376  
41655 125376  w.h0=k
41656 125376        <:cre:>, g20,32   ; <:create:><name><tail>
41657 125382        <:cha:>, g21,32   ; <:change:><name><tail>
41658 125388        <:ren:>, g22,20   ; <:rename:><name><new name>
41659 125394        <:rem:>, g23,12   ; <:remove:><name>
41660 125400        <:per:>, g24,14   ; <:perman:><name><cat key>
41661 125406        <:loa:>, g30,14   ; <:load:><name><segments>
41662 125412        <:new:>, g9 ,4    ; <:newcat:>
41663 125418        <:old:>, g9 ,4    ; <:oldcat:>
41664 125424    h1: <:end:>, g54,2    ; <:end:>
41665 125430  
41665 125430  h3 = -k                ; start of initcat command-table:
41666 125430       <:binin:>   ,  1<20 + g76-b110
41667 125436       <:clearc:>  ,  1<18 + g70-b110
41668 125442       <:kit<0>:>  ,  1<18 + g73-b110
41669 125448       <:kitlab:>  ,  1<18 + g74-b110
41670 125454       <:kitoff:>  ,  1<18 + g71-b110
41671 125460       <:kiton:>   ,  1<18 + g73-b110
41672 125466       <:mainca:>  ,  1<21 + g72-b110
41673 125472       <:nokit:>   ,  1<18 + g71-b110
41674 125478       <:oldcat:>  ,  1<18 + g78-b110
41675 125484       <:repair:>  ,  1<18 + g75-b110
41676 125490       <:auxcle:>  ,  1<18 + g79-b110
41677 125496       0
41678 125498  
41678 125498    h4=k                  ; command buf:
41679 125498    h5=h4+510             ; command end:
41680 125498  
41680 125498    h6=h5+2               ; load buf:
41681 125498    h7=h6+510             ; load end:
41682 125498    h8=h7+2               ; chain buf
41683 125498    h11 = a116           ; (minimum size of chaintable buffer)
41684 125498    c. a114-a116, h11 = a114 z.;
41685 125498    h9 = h8+(:h11+511:)>9<9-2; last of chainbuffer
41686 125498    h10=h9+2             ; start of 1. input buffer
41687 125498    h12=h10 + 2 * 512    ; top of input buffer (top of initcat code
41688 125498  \f


41688 125498  
41688 125498  
41688 125498  ; initial start up of external processes and creation of
41689 125498  ; local links to front ends. before linkup the external
41690 125498  ; process description is released.
41691 125498  
41691 125498  b.i30,j10,p15 w.
41692 125498  
41692 125498  p6=0    ; start of message
41693 125498  p7=16   ; start of data
41694 125498  p11=22  ; device name or main process name
41695 125498  p8=30   ; jh.linkno
41696 125498  p9=38   ; process name
41697 125498  p10=46  ; length of item
41698 125498  
41698 125498  i2=k                   ; start of linkup list
41699 125498  t.
41699 125498* type 

41700 125498  
41700 125498  m.
41700 125498   init linkup list

41701 125498  
41701 125498  1<12+7<1, k+14, k+34, 17, 5142,  0<12 +  0, 0, 0
41702 125514      8,  1,  86, <:terminal1<0>:>,   2, 0, 0, 0,<:console1<0>:>, 0
41703 125544  1<12+7<1, k+14, k+34, 17, 5142,  0<12 +  0, 0, 0
41704 125560     22,  1, 576, <:fd0<0>:>, 0, 0,   6, 0, 0, 0,<:fd0<0>:>, 0, 0
41705 125590  1<12+7<1, k+14, k+34, 17, 5142,  0<12 +  0, 0, 0
41706 125606     18,  1,6960, <:mt0<0>:>, 0, 0,  10, 0, 0, 0,<:mt0<0>:>, 0, 0
41707 125636  n.m.
41707 125636                  init linkup list included

41708 125636  i3=k                   ; top of linkup list
41709 125636  i6:  i2-p10            ;   start of linkup list
41710 125638  i7:  i3                ;   top of linkup list
41711 125640  
41711 125640  i8:  0,r.4,0           ;   name of fpa, name table entry
41712 125650  
41712 125650  i9:  8<12+0            ;   master clear message
41713 125652  
41713 125652  i10: 0, r.8            ;   answer area
41714 125668  i11: 0                 ;   link
41715 125670  i12: 0                 ;   saved pointer
41716 125672  
41716 125672  i13: <:host:>,0,0,0    ;   host-name and name table entry
41717 125682  
41717 125682  i21: <:clock:>,0,0,0   ;   clock-name and name table entry
41718 125692  
41718 125692  i22: 0<12              ;   delay message
41719 125694       5                 ;   time (in seconds) 
41720 125696  
41720 125696  f20: rs. w3  i11.      ; init externals: save link;
41721 125698       rl  w3  b4        ;
41722 125700  j0:  rl  w0 (x3)       ;   for devno:=0 step 1 until maxdevno do
41723 125702       se  w0  80        ;     proc:=proc(devno);
41724 125704       jl.     j1.       ;     if kind(proc)=mainproc kind then
41725 125706       rs. w3  i12.      ;       name:=name(proc);
41726 125708       rl  w3  x3        ;
41727 125710       al  w0  0         ;   if start flag(proc)<>0 then
41728 125712       rx  w0  x3+a56    ;     start flag(proc):=0;
41729 125714       rs  w0  x3+44      ;   main.ready flag := startflag;
41730 125716       se  w0  0         ;     goto cont;
41731 125718       jl.     j3.       ;
41732 125720       dl  w2  x3+a11+2  ;
41733 125722       ds. w2  i8.+2     ;
41734 125724       dl  w2  x3+a11+6  ;
41735 125726       ds. w2  i8.+6     ;
41736 125728       al. w3  i8.       ;
41737 125730       jd      1<11+8    ;   reserve process(name);
41738 125732       al. w1  i9.       ;       message:=master clear;
41739 125734       jd      1<11+16   ;       send message(name,message);
41740 125736       al. w1  i10.      ;
41741 125738       jd      1<11+18   ;       wait answer(answer area);
41742 125740       jd      1<11+10   ;   release process(name);
41743 125742  j3:  rl. w3  i12.      ;
41744 125744  j1:  al  w3  x3+2      ;
41745 125746       se  w3 (b5)       ;
41746 125748       jl.     j0.       ;
41747 125750       al. w3  i21.      ; wait:
41748 125752       al. w1  i22.      ;
41749 125754       jd      1<11+16   ;   send message(clock,wait);
41750 125756       al. w1  i10.      ;
41751 125758       jd      1<11+18   ;   wait answer(answer area);
41752 125760  
41752 125760       rl. w1  i6.       ; insert links:
41753 125762       rs. w1  i12.      ;
41754 125764  j2:  rl. w1  i12.      ;   for dev:=first item in linkup list until last do
41755 125766       al  w1  x1+p10    ;    begin
41756 125768       rs. w1  i12.      ;
41757 125770       sl. w1 (i7.)      ;
41758 125772       jl.     j8.       ;
41759 125774       al. w3  i13.      ;
41760 125776       al. w3  i13.      ;     receiver:= host;
41761 125778       rl  w2  x1+p8     ;
41762 125780       ls  w2  1         ;
41763 125782       am      (b4)      ;     if linkup list.jh-linkno.kind =
41764 125784       rl  w0  (x2+0)    ;        free itc_subprocess then
41765 125786       se  w0  68        ;     then
41766 125788       jl.     j4.       ;        receiver:= linkup list.main proc name;
41767 125790       dl  w0  x1+p11+2  ;
41768 125792       ds. w0  i8.+2     ;
41769 125794       dl  w0  x1+p11+6  ;
41770 125796       ds. w0  i8.+6     ;
41771 125798       al. w3  i8.       ;
41772 125800  j4:                    ;
41773 125800       jd      1<11+16   ;     send message(receiver,operation);
41774 125802       al. w1  i10.      ;
41775 125804       jd      1<11+18   ;     wait answer(answer area);
41776 125806       bz. w3  i10.+1    ;
41777 125808       sn  w0  1         ;     if result=ok
41778 125810       se  w3  0         ;     and function result=ok then
41779 125812       jl.     j2.       ;
41780 125814       rl. w3  i12.      ;
41781 125816       rl  w1  x3+p8     ;
41782 125818       al  w3  x3+p9     ;
41783 125820       jd      1<11+54   ;       create peripheral process;
41784 125822       jl.     j2.       ;    end;
41785 125824  j8:
41786 125824       jl.     (i11.)    ; exit: return to link;
41787 125826  e.
41788 125826  \f


41788 125826  
41788 125826  
41788 125826  
41788 125826  
41788 125826  ; program used for autoload of local device controllers.
41789 125826  ; jr -  07.10.76
41790 125826  ;
41791 125826  ; the communication takes place via the transmitter part of a fpa 801.
41792 125826  ; after autoload this program reads commands from the device controller
41793 125826  ; simulating a magtape station locally connected to the device controller.
41794 125826  ; the load file must be placed on backing storage in consecutive segments.
41795 125826  ; the load file consists of a number of records with the format:
41796 125826  ;   <ident> <data>
41797 125826  ; where ident > 0 : size of data block (in characters)
41798 125826  ;             = 0 : tapemark (datablock empty)
41799 125826  ;             =-3 : end of tape (datablock empty)
41800 125826  ;
41801 125826  ; information about load device and load file is part of monitor options,
41802 125826  ; and shall be packed in this way:
41803 125826  ;   <name of load device(fpa transmitter)>
41804 125826  ;   <device number of bs device holding the load file>
41805 125826  ;   <first segment (load file)>
41806 125826  ;
41807 125826  ; the device controllers are loaded one by one according to the options.
41808 125826  
41808 125826  b.m10,n10,p10,q10,r10,s40 w.
41809 125826  
41809 125826  ; format of options:
41810 125826  p0=0                   ; load device
41811 125826  p1=p0+8                ; device number of bs device
41812 125826  p2=p1+2                ; first segment
41813 125826  p3=p2+2                ; length of load command
41814 125826  
41814 125826  ; counters.
41815 125826  p4=10                  ; maxnumber of autoloads
41816 125826  p5=1                   ; max number of errors
41817 125826  
41817 125826  s30:
41818 125826  
41818 125826  ; start of options
41819 125826  t.
41819 125826* type 

41820 125826  
41820 125826  m.
41820 125826   device autoload list

41821 125826  
41821 125826     <:main36001:> , 0, 30, 4
41822 125838     <:iocmain2:> , 0, 30, 1
41823 125850  
41823 125850  n.m.
41823 125850                  device autoload list included

41824 125850  
41824 125850  s31=k
41825 125850  
41825 125850  ; reset process.
41826 125850  s0:  4<12+0            ;   operation:=reset all subprocesses
41827 125852  
41827 125852  ; transmit status message.
41828 125852  s1:  5<12+2.11         ;   operation:=transmit, mode:=reset, receive
41829 125854       s6                ;   first:=first of sense area
41830 125856       s7                ;   last:=last of sense area
41831 125858       8                 ;   charcount:=8
41832 125860       249               ;   startchar:=sense block
41833 125862  
41833 125862  ; transmit status message.
41834 125862  s2:  5<12+2.01         ;   operation:=transmit, mode:=receive
41835 125864       s6                ;   first:=first of sense area
41836 125866       s7                ;   last:=last of sense area
41837 125868       8                 ;   charcount:=8
41838 125870       249               ;   startchar:=sense block
41839 125872  
41839 125872  ; transmit data block.
41840 125872  s3:  5<12+2.01         ;   operation:=transmit, mode:=receive
41841 125874       0                 ;   first
41842 125876       s24               ;   last (max upper limit)
41843 125878       0                 ;   charcount
41844 125880       251               ;   strtchar:=data block
41845 125882  
41845 125882  ; autoload.
41846 125882  s4:  6<12+2.11         ;   operation:=autoload, mode:=reset, receive
41847 125884                         ;   dummy
41848 125884  
41848 125884  ; answer area.
41849 125884  s5:  0                 ;   status
41850 125886       0                 ;   bytes transferred
41851 125888       0                 ;   chars transferred
41852 125890       0                 ;   command character (status character)
41853 125892       0, r.4            ;   dummy
41854 125900  
41854 125900  ; sense information area.
41855 125900  s6:  0                 ;   char0,1:=status(0:15), char2:=size(0:7),
41856 125902       0                 ;   char3:=size(8:15),char4,5:=filenumber(0:15),
41857 125904  s7:  0                 ;   char6,7:=blocknumber(0:15)
41858 125906  
41858 125906  ; name of destination
41859 125906  s8:  0, r.4, 0         ;
41860 125916  s28: 0                 ; link params: 
41861 125918       0                 ;
41862 125920       0                 ;             device number
41863 125922       0                 ;             kind,type
41864 125924       5                 ;             max outstanding operations
41865 125926  
41865 125926  s9:  s31               ;   last command (changed by f18)
41866 125928  
41866 125928  s10: 0                 ;   status
41867 125930  s11: 0                 ;   size(data)
41868 125932  s12: 0                 ;   filenumber
41869 125934  s13: 0                 ;   blocknumber
41870 125936  
41870 125936  s14: 0                 ;   first(record)
41871 125938  s15: 0                 ;   link
41872 125940  s16: 0                 ;   current load command
41873 125942  s17: 0                 ;   errorcount
41874 125944  s18: 8<12+0            ; position
41875 125946       6                 ;
41876 125948  s19: 0                 ; file number ( or segment number )
41877 125950       0                 ; (segment no if position to disc)
41878 125952  
41878 125952  ; input message.
41879 125952  s20: 3<12+0            ;   operation:=read
41880 125954       s27               ;   first:=first of record buffer
41881 125956       s24               ;   last:=last of record buffer
41882 125958       0                 ;   first segment number
41883 125960  
41883 125960  ; name of source.
41884 125960  s21: 0, r.4            ;   (work) name of source
41885 125968       0                 ;   (s21+8) name table entry of bs device
41886 125970  
41886 125970  ; delay message. and sense message
41887 125970  s25: 0<12+2            ;   operation:=wait, mode:=msec
41888 125972       0,15000           ;   time:=1,5 sec
41889 125976  
41889 125976  ; name of clock.
41890 125976  s26: <:clock:>,0,0     ;   name of clock device
41891 125984       0                 ;   name table entry
41892 125986  
41892 125986  s29: 4                 ;   result from input message
41893 125988  s32: 0                 ;   return address (used by f18)
41894 125990  s33: -1-15<15          ;   status mask: all bits except eof,load point,tape mark and write enable
41895 125992  f18:                   ; load ida-ifp controllers;
41896 125992       rs. w3     s32.   ;
41897 125994       al. w3     s30.   ;   process descriptions(cur-command.load device)
41898 125996  m3:  jd      1<11+4    ;
41899 125998       se  w0     0      ;   if proc known then
41900 126000       rl  w0    (0)     ;      prockind := proc.kind;
41901 126002                         ;   <* set command pointers *>
41902 126002       al  w3  x3-p3     ;
41903 126004       rs. w3     s16.   ;   cur command := command.prev;
41904 126006       al  w3  x3+p3+p3  ;
41905 126008       rs. w3     s9.    ;   last command := command.suc;
41906 126010       al. w3     m4.    ;   return from next load := next in list;
41907 126012       rs. w3     s15.   ;
41908 126014       se  w0     20     ;   if prockind = idamain or
41909 126016       sn  w0     26     ;      prockind = ifpmain then
41910 126018       sz                ;
41911 126020       jl.        m4.    ;
41912 126022       
41912 126022       al  w0     0      ;   wait for source device ready
41913 126024       rs. w0     s21.   ;
41914 126026  m1:  rl. w1     s30.+p1;   repeat
41915 126028       al. w3     s21.   ;     source.name := wrkname
41916 126030       jd     1<11+54    ;      
41917 126032       jd     1<11+8     ;     reserve source device
41918 126034       al. w1     s25.   ;     sense source device
41919 126036       jd     1<11+16    ;
41920 126038       al. w1     s5.    ;
41921 126040       jd     1<11+18    ;
41922 126042       se  w0     1      ;   until ready
41923 126044       jl.        m1.    ;
41924 126046       jl.        m0.    ;   autoload controller;
41925 126048                         ;   <* if process unknown w0=0 autoload is skipped*>
41926 126048  m4:                    ; next in list:
41927 126048       sl. w3     s31.   ;   if list exchausted then
41928 126050       jl.       (s32.)  ;      return
41929 126052       jl.        m3.    ;   else check and autoload;
41930 126054                         ;
41931 126054                         ; end  ** load of ida-ifp controllers **;
41932 126054  
41932 126054  
41932 126054  f19: rs. w3  s15.      ; start: save link;
41933 126056       al. w3  s30.-p3   ;
41934 126058       rs. w3  s16.      ;
41935 126060       al. w1  s25.      ;   message:=wait;
41936 126062       al. w3  s26.      ;  name:=clock;
41937 126064       jl. w2  n1.       ;   send and wait;
41938 126066       am      0         ;    ok:
41939 126068  m0:  rl. w3  s16.      ; next load:
41940 126070       al  w3  x3+p3     ;   current command:=current command+length of command;
41941 126072       rs. w3  s16.      ;
41942 126074       sl. w3 (s9. )     ;   if no more commands then
41943 126076       jl.    (s15.)     ;     return to link;
41944 126078       jd      1<11+8    ;   reserve destination;
41945 126080       jl. w3  n2.       ;   transfer command;
41946 126082       jl.     r4.       ;   goto autoload;
41947 126084  
41947 126084  m2:  rl. w0  s5.+6     ; execute:
41948 126086       sn  w0  0         ;   if command char=0 then
41949 126088       jl.     q0.       ;     goto transmit next block;
41950 126090       sn  w0  1         ;   if command char=1 then
41951 126092       jl.     q1.       ;     goto retransmit block;
41952 126094       sn  w0  2         ;   if command char=2 then
41953 126096       jl.     q2.       ;     goto rewind;
41954 126098       sn  w0  4         ;   if command char=4 then
41955 126100       jl.     q3.       ;     goto upspace block;
41956 126102       sn  w0  8         ;   if command char=8 then
41957 126104       jl.     q4.       ;     goto upspace file;
41958 126106       sn  w0  12        ;   if command char=12 then
41959 126108       jl.     q5.       ;     goto end;
41960 126110       sn  w0  128       ;   if command char=128 then
41961 126112       jl.     q6.       ;     goto sense;
41962 126114       sn  w0  255       ;   if command char=255 then
41963 126116       jl.     q7.       ;     goto wait;
41964 126118       jl.     q8.       ;   goto error;
41965 126120  
41965 126120  b.j10 w.
41966 126120  
41966 126120  ; after error, reset and transmit status, receive command.
41967 126120  r1:  al  w0  0         ; reset,trm status:
41968 126122       rs. w0  s17.      ;   errorcount:=0;
41969 126124       jl. w3  n3.       ;   set up status area;
41970 126126  j0:  al. w1  s1.       ; repeat0: message:=reset,transmit status,receive;
41971 126128       al. w3  s8.       ;   name:=name(load device);
41972 126130       jl. w2  n1.       ;   send and wait;
41973 126132       jl.     m2.       ;  ok: goto execute;
41974 126134       al  w3  1         ;  error:
41975 126136       wa. w3  s17.      ;   errorcount:=errorcount+1;
41976 126138       rs. w3  s17.      ;
41977 126140       sh  w3  p5        ;   if errorcount=<maxerrorcount then
41978 126142       jl.     j0.       ;     goto repeat0;
41979 126144       jl.     q5.       ;   goto load next;
41980 126146  
41980 126146  ; transmit status.
41981 126146  r2:  jl. w3  n3.       ; transmit status: setup status area;
41982 126148       al. w1  s2.       ;   message:=transmit status;
41983 126150       al. w3  s8.       ;   name:=name(load device);
41984 126152       jl. w2  n1.       ;   send and wait;
41985 126154       jl.     m2.       ;  ok: goto execute;
41986 126156       jl.     r1.       ;  error: goto restart;
41987 126158  
41987 126158  ; transmit data.
41988 126158  r3:  rl. w2  s14.      ; transmit data:
41989 126160       al  w2  x2+2      ;   first(data):=first(record)+2;
41990 126162       rs. w2  s3.+2     ;   size:=size(data);
41991 126164       rl. w2  s11.      ;   if size=0 then
41992 126166       sn  w2  0         ;     size:=1;
41993 126168       al  w2  1         ;
41994 126170       rs. w2  s3.+6     ;   char count:=size;
41995 126172       al. w1  s3.       ;   message:=transmit block;
41996 126174       al. w3  s8.       ;   name:=name(load device);
41997 126176       jl. w2  n1.       ;   send and wait;
41998 126178       jl.     m2.       ;  ok: goto execute;
41999 126180       jl.     r1.       ;  error: goto restart;
42000 126182  
42000 126182  ; autoload.
42001 126182  r4:  al  w0  0         ; autoload:
42002 126184       rs. w0  s17.      ;   errorcount:=0;
42003 126186       al. w1  s0.       ;   message:=reset;
42004 126188       al. w3  s8.       ;   name:=namee(load device);
42005 126190       jl. w2  n1.       ;   send and wait;
42006 126192       jl.     j1.       ;    ok: goto start load;
42007 126194       jl.     q5.       ;    error: goto load next;
42008 126196  j1:  rl. w1  (s8.+8)   ; if destination.kind <> fpa then
42009 126198       rl  w0  x1        ;
42010 126200       se  w0  80        ;  goto simple load
42011 126202       jl.     r5.       ;  else
42012 126204       al. w1  s4.       ; start load: message:=autoload;
42013 126206       al. w3  s8.       ;   name:=name(load device);
42014 126208       jl. w2  n1.       ;   send and wait;
42015 126210       jl.     m2.       ;  ok: goto execute;
42016 126212       al  w3  1         ;
42017 126214       wa. w3  s17.      ;
42018 126216       rs. w3  s17.      ;   errorcount:=errorcount+1;
42019 126218       sh  w3  p5        ;   if errorcount=<maxerrorcount then
42020 126220       jl.     j1.       ;     goto repeat;
42021 126222       jl.     q5.       ;   goto load next;
42022 126224  
42022 126224  ;   simple load       ;
42023 126224  r5:  al  w1     1     ;
42024 126226       rs. w1     s29.  ; result:= ok (initialize);
42025 126228       rl. w1  s20.+2   ; setup output addresses
42026 126230       rs. w1  s3.+2    ;
42027 126232  j2:  al. w3  s8.      ;
42028 126234       al. w1  s3.      ;
42029 126236       jl. w2  n1.      ; send output
42030 126238       jl.     j3.      ; ok: get next segment
42031 126240       jl.     q5.      ; error or finished: load next device
42032 126242  j3:  rl. w1  s20.+6   ; update filecount in input mess
42033 126244       al  w1  x1+1     ;
42034 126246       rs. w1  s20.+6   ;
42035 126248       al. w3  s21.     ; setup input
42036 126250       al. w1  s20.     ;
42037 126252       jl. w2  n1.      ; send input
42038 126254       jl.     j2.      ; ok : goto next block
42039 126256       sz. w1  (s33.)   ; if not end of file then
42040 126258       rs. w1  s29.     ; result:=not ok;
42041 126260       jl.     q5.      ; error or eof: goto load next device
42042 126262  
42042 126262  e.
42043 126262  
42043 126262  ; transmit next block.
42044 126262  q0:  jl. w3  n0.       ; transmit next block: next block;
42045 126264       jl.     r3.       ;   goto transmit block;
42046 126266  
42046 126266  ; retransmit block.
42047 126266  q1=r3                  ; retransmit block: goto transmit block;
42048 126266  
42048 126266  ; rewind.
42049 126266  q2:  jl. w3  n2.       ; rewind: transfer command;
42050 126268       jl.     r2.       ;   goto transmit status;
42051 126270  
42051 126270  ; upspace block.
42052 126270  q3:  jl. w3  n0.       ; upspace block: next block;
42053 126272       al  w3  1<2       ;
42054 126274       sz  w0  1<8+1<4   ;   if status=end of tape or end of file then
42055 126276       rs. w3  s10.      ;     status:=position error;
42056 126278       al  w3  0         ;   size(data):=0;
42057 126280       rs. w3  s11.      ;
42058 126282       jl.     r2.       ;   goto transmit status;
42059 126284  
42059 126284  ; upspace file.
42060 126284  q4:  jl. w3  n0.       ; upspace file:
42061 126286       sn  w0  0         ;   while status=0 do
42062 126288       jl.     q4.       ;     next block;
42063 126290       al  w3  0         ;
42064 126292       sz  w0  1<8       ;   if status=end of file then
42065 126294       rs. w3  s10.      ;     status:=ok;
42066 126296       rs. w3  s11.      ;   size(data):=0;   
42067 126298       jl.     r2.       ;   goto transmit status;
42068 126300  
42068 126300  ; end.
42069 126300  q5:                     ; end;
42070 126300       al. w3     s21.    ;
42071 126302       jd      1<11+10    ; release input device;
42072 126304       al  w0     0       ;
42073 126306       rs. w0     s21.    ;
42074 126308       rl. w3  s16.       ;
42075 126310       jd      1<11+10    ; release process(name);
42076 126312       rl. w1     s29.    ;
42077 126314       se  w1     1       ; if result = ok then
42078 126316       jl.        m0.     ; begin
42079 126318       al. w1  s25.       ;
42080 126320       al. w3  s26.       ;
42081 126322       jl. w2   n1.       ;   send and wait(clock)
42082 126324       am      0          ;
42083 126326       rl. w1     (s8.+8) ;
42084 126328       rl  w0  x1         ;
42085 126330       se  w0     q20     ;   if kind = idamain or
42086 126332       sn  w0     q26     ;      kind = ifpmain then
42087 126334       sz                 ;
42088 126336       jl.        m0.     ;   begin
42089 126338       al. w1     s8.     ;
42090 126340  ;    al. w2     s28.    ;
42091 126340   ;   rl  w3  x1+8       ;
42092 126340    ;  ws  w3     b4      ;
42093 126340     ; ls  w3     -1      ;
42094 126340      ;rs  w3  x2+4       ;     insert device number
42095 126340       al  w2     5       ;
42096 126342       jl. w3     f60.    ;     link device(name,link_params)
42097 126344       am         0       ;     error
42098 126346                          ;   end;
42099 126346                          ; end;
42100 126346       jl.        m0.     ;   goto load next;
42101 126348  
42101 126348  ; sense.
42102 126348  q6=r2                  ; sense: goto transmit status;
42103 126348  
42103 126348  ; wait.
42104 126348  q7:  al. w1  s25.      ; wait:
42105 126350       al. w3  s26.      ;
42106 126352       jl. w2  n1.       ;   send and wait(clock);
42107 126354       am      0         ;
42108 126356       jl.     r1.       ;
42109 126358  
42109 126358  ; error.
42110 126358  q8=r2                  ; error: goto transmit status;
42111 126358  
42111 126358  
42111 126358  ; procedure next block.
42112 126358  ; this procedure finds the start of the next record.
42113 126358  ;
42114 126358  ; status: 0     ok
42115 126358  ;         1<4   end of tape
42116 126358  ;         1<8   end of file
42117 126358  ;         1<14  disc error
42118 126358  ;
42119 126358  ;        call:         return:
42120 126358  ; w0                   status
42121 126358  ; w1                   size(data)
42122 126358  ; w2                   destroyed
42123 126358  ; w3     link          destroyed
42124 126358  b.i4,j5 w.
42125 126358  i0:  0                 ; saved link
42126 126360  i1:  3                 ; constant
42127 126362  i2:  1<14              ; disc error
42128 126364  i3:  1<18              ;   end of medium
42129 126366  
42129 126366  n0:  rs. w3  i0.       ; next block:
42130 126368       rl. w1 (s14.)     ;
42131 126370       al  w1  x1+2+3    ;   first(next record):=
42132 126372       al  w0  0         ;     (size(data)+3)+2)//3*2+first(record);
42133 126374       wd. w1  i1.       ;
42134 126376       ls  w1  1         ;
42135 126378       wa. w1  s14.      ;
42136 126380       rs. w1  s14.      ;   first(record):=first(next record);
42137 126382       sh. w1  s23.      ;   if first(record)>first(buf)+510 then
42138 126384       jl.     j0.       ;     first(record):=first(record)-512;
42139 126386       al  w1  x1-512    ;     first segmentno:=first segmentno+1;
42140 126388       rs. w1  s14.      ;
42141 126390       al  w2     0      ; move last segment to low part of buffer
42142 126392  j5:  dl. w1  x2+s24.   ;
42143 126394       ds. w1  x2+s23.   ;
42144 126396       al  w2  x2-4      ;
42145 126398       se  w2  -512      ;
42146 126400       jl.         j5.   ;
42147 126402  
42147 126402       al  w0  1         ;
42148 126404       wa. w0  s20.+6    ;
42149 126406       rs. w0  s20.+6    ;
42150 126408       al. w1  s20.      ;     message:=input;
42151 126410       al. w3  s21.      ;     name:=name(load file device);
42152 126412       jl. w2  n1.       ;     send and wait;
42153 126414       jl.     j0.       ;  ok: goto cont;
42154 126416       rl. w3  s5.+2     ;  error:
42155 126418       sz. w1 (i3.)      ;   if status=end of medium
42156 126420       se  w3  512       ;   and bytes transferred=1 segment then
42157 126422       jl.     j4.       ;   goto cont;
42158 126424       jl.     j0.       ;
42159 126426  j4:  rl. w0  i2.       ;   status:=disc error;
42160 126428       al  w1  0         ;   size:=0;
42161 126430       dl. w3  s13.      ;   fileno:=fileno, blockno:=blockno;
42162 126432       jl.     j3.       ;   goto exit;
42163 126434  j0:  rl. w1 (s14.)     ; cont:
42164 126436       sh  w1  0         ;   if ident(record)>0 then
42165 126438       jl.     j1.       ;     size(data):=ident(record);
42166 126440       al  w0  0         ;     status:=0;
42167 126442       dl. w3  s13.      ;     filenumber:=filenumber;
42168 126444       al  w3  x3+1      ;     blocknumber:=blocknumber+1;
42169 126446       jl.     j3.       ;   else
42170 126448  j1:  se  w1  0         ;     if size(record)<>0 then
42171 126450       am      1<4-1<8   ;       status:=1end of tape
42172 126452       al  w0  1<8       ;     else status:=end of file;
42173 126454  j2:  al  w1  0         ;     size(data):=0;
42174 126456       al  w2  1         ;     filenumber:=filenumber+1;
42175 126458       wa. w2  s12.      ;     blocknumber:=1;
42176 126460       al  w3  1         ;
42177 126462  j3:  ds. w1  s11.      ; exit:
42178 126464       ds. w3  s13.      ;
42179 126466       jl.    (i0.)      ;   return;
42180 126468  e.
42181 126468  
42181 126468  ; procedure send and wait.
42182 126468  ; the procedure returns to link in case of result ok (which is
42183 126468  ; status=0 and result=1), else to link+2.
42184 126468  ;        call:         return:
42185 126468  ; w0                   result
42186 126468  ; w1     message       status-writing enable
42187 126468  ; w2     link          destroyed
42188 126468  ; w3     name          destroyed
42189 126468  b.i1 w.
42190 126468  n1:  rs. w2  i0.       ; send and wait:
42191 126470       jd      1<11+16   ;   send message;
42192 126472       al. w1  s5.       ;   answer area:=std answer area;
42193 126474       jd      1<11+18   ;   wait answer;
42194 126476       rl. w1  s5.+0     ;   if result<>1
42195 126478       la. w1     i1.       ;   remove writing enable
42196 126480       rl. w2  i0.       ;
42197 126482       sn  w0  1         ;   or status<>0 then
42198 126484       se  w1  0         ;     return to link+2
42199 126486       jl      x2+2      ;   else return to link;
42200 126488       jl      x2+0      ;
42201 126490  i0:  0                 ;   saved link
42202 126492  i1:  -1 -1<15             ;   status mask
42203 126494  e.
42204 126494  
42204 126494  ; procedure transfer command.
42205 126494  ;       call           return:
42206 126494  ; w0                   destroyed
42207 126494  ; w1                   destroyed
42208 126494  ; w2                   destrlyed
42209 126494  ; w3    link           destroyed
42210 126494  b.i1, j1w.
42211 126494  n2:  rs. w3  i0.       ; transfer command:
42212 126496       rl. w2  s16.      ;
42213 126498       dl  w1  x2+p0+2   ;
42214 126500       ds. w1  s8.+2     ;
42215 126502       dl  w1  x2+p0+6   ;   transfer name(load device);
42216 126504       ds. w1  s8.+6     ;
42217 126506       rl  w3  x2+p1     ;
42218 126508       ls  w3  1         ;
42219 126510       wa  w3  b4        ;   name table entry(bs device):=deviceno*2+start(name table);
42220 126512       rs. w3  s21.+8    ;
42221 126514       rl  w3  x3        ;   proc(bs device):=word(name table entry);
42222 126516       dl  w1  x3+4      ; move name to work
42223 126518       se  w0     0      ; if name(0) = 0 then
42224 126520       jl.        j0.    ;    create peripheral process(wrkname);
42225 126522       rl  w1  x2+p1     ;
42226 126524       al. w3     s21.   ;
42227 126526       jd      1<11+54   ;
42228 126528       jl.        j1.    ;
42229 126530  j0:  ds. w1  s21.+2    ;
42230 126532       dl  w1  x3+8      ;
42231 126534       ds. w1  s21.+6    ;
42232 126536       al. w3  s21.      ; reserve source device(mandatory if source is ida801)
42233 126538  j1:  jd      1<11+8    ;
42234 126540       ld  w1  -100      ;
42235 126542       ds. w1  s11.      ;   ident,size:=0,0;
42236 126544       al  w0  1         ;
42237 126546       rs. w0  s12.      ;   filenumber:=1;
42238 126548       rs. w0  s13.      ;   blocknumber:=1;
42239 126550       rl  w1  x2+p2     ;   first segment:=first segment number(load file);
42240 126552       rs. w1  s19.      ; save position 
42241 126554       rs. w1  s20.+6    ;
42242 126556       al. w1  s18.      ; send positon message (mandatory if ida801)
42243 126558       jl. w2  n1.       ;
42244 126560       am      0         ; skip the answer
42245 126562       al  w0  768-3     ;   assure that first and second segment are
42246 126564       rs. w0  s22.      ;     transferred to core first time the
42247 126566       al. w0  s22.      ;     record buffer are used;
42248 126568       rs. w0  s14.      ;
42249 126570       al. w1  s20.      ; input first segment
42250 126572       al. w3  s21.      ;
42251 126574       jl. w2  n1.       ; send and wait
42252 126576       am      0         ; skip the  answer
42253 126578       jl.    (i0.)      ; exit: return;
42254 126580  i0:  0                  ;   save link
42255 126582  e.
42256 126582  
42256 126582  ; procedure setup status area.
42257 126582  ;        call:         return:
42258 126582  ; w0                   destroyed
42259 126582  ; w1                   destroyed
42260 126582  ; w2                   destroyed
42261 126582  ; w3     link          destroyed
42262 126582  b.w.
42263 126582  n3:  rl. w0  s10.      ; setup status area:
42264 126584       rl. w1  s11.      ;
42265 126586       se  w0  0         ;   if status<>ok then
42266 126588       al  w1  0         ;     size(data):=0;
42267 126590       ls  w1  8         ;
42268 126592       ld  w1  8         ;
42269 126594       lo. w1  s12.      ;   sense status area:=
42270 126596       rl. w2  s13.      ;     status(0:15)<8+size(0:7),
42271 126598       ls  w2  8         ;     size(8:15)<16+filenumber(0:15),
42272 126600       ds. w1  s6.+2     ;     blocknumber(0:15)<8;
42273 126602       rs. w2  s6.+4     ;
42274 126604       jl      x3        ; exit: return;
42275 126606  e.
42276 126606  
42276 126606  s22=k                  ; start of record buffer
42277 126606  s23=s22+510            ; last of first segment in record buffer
42278 126606  s24=s22+512*2-2        ; last of record buffer
42279 126606  s27=s23+2              ; first of second segment in record buffer
42280 126606  
42280 126606  e.
42281 126606  
42281 126606  
42281 126606  b.i24                   ; begin
42282 126606  w.
42283 126606  i0:                    ; initialize segment:
42284 126606       rl. w0     i3.    ;   initialize (top of initcat code);
42285 126608       rs. w0    (i4.)   ;
42286 126610       rl  w1     b12    ;   if coresize >= 1 000 000 hw then
42287 126612       sl. w1    (i8.)   ;      first logical address := top of init cat;
42288 126614       rs. w0    (i9.)   ;      (automatic relocation)
42289 126616  c. (:a80>16a.1:)-1
42290 126616       rl. w0     i6.    ;   initialize forward reference in segment 8
42291 126618       rs. w0    (i7.)   ;   from linkall to kiton!
42292 126620  z.
42293 126620  
42293 126620       rl. w2     i5.    ;
42294 126622  
42294 126622       dl  w1  x3-2      ;   move initcat switches;
42295 126624       ds  w1  x2+d37-d36;
42296 126626  
42296 126626       dl  w1  x3-10     ;   move startup area name;
42297 126628       ds  w1  x2+d49+2-d36;
42298 126630       dl  w1  x3-6      ;
42299 126632       ds  w1  x2+d49+6-d36;
42300 126634  
42300 126634       jl        (10)    ;   goto system start;
42301 126636  
42301 126636  i3:  h12               ; top of initcat code
42302 126638  i4:  b120              ; pointer to ...
42303 126640  i5:  d36               ; pointer to initcat switches
42304 126642  c.(:a80>16a.1:)-1
42305 126642  i6:  g47               ;   entrypoint to kiton
42306 126644  i7:  b135              ;   address of reference to kiton
42307 126646  z.
42308 126646  i8:  1000000           ;   coresize limit for automatic relocation
42309 126648  i9:  b141              ;   pointer to: first logical address
42310 126650  
42310 126650        jl.     i0.       ;   goto initialize segment;
42311 126652    c25=k - b127 + 2
42312 126652  e.                      ; end
42313 126652  i.
42314 126652  e.     ; end of initialize catalog on backing store
42315 126652  \f


42315 126652  
42315 126652  
42315 126652  ; segment 10
42316 126652  ; rc 05.08.70 bjørn ø-thomsen
42317 126652  ;
42318 126652  ; this segment moves segment 2 - 9 in this way:
42319 126652  ;
42320 126652  ; segment 2 is moved to cell 8 and on, after which
42321 126652  ; control is transferred to the last moved word with the
42322 126652  ; following parameters:
42323 126652  ;     w2 = top load address (= new address of last  moved 
42324 126652  ;                              word + 2)
42325 126652  ;     w3 = link
42326 126652  ;
42327 126652  ; after initializing itself, the program segment returns
42328 126652  ; to this segment with:
42329 126652  ;     w2 = load address of next segment
42330 126652  ;
42331 126652  ; the next segment will then be moved to cell(w2) and on,
42332 126652  ; after which it is entered as described above.
42333 126652  ;
42334 126652  ; when initialize catalog (segment 9) is entered, the values
42335 126652  ; of the two switches (writetext, medium) may be found in
42336 126652  ; the words x3-4 and x3-2.
42337 126652  ;
42338 126652  ; segment 10 is entered from segment 1 in its last word
42339 126652  ;   entry conditions:
42340 126652  ;     w0,w1 = init catalog switches
42341 126652  ;     w2    = start address of segment 2
42342 126652  
42342 126652  
42342 126652  
42342 126652  
42342 126652  s.   i10,  j10
42343 126652  w.
42344 126652                  j3.     ;   length of segment 10
42345 126654  j9:              0, r.4 ;x3-12:  init cat switch: startup area name 
42346 126662  j0:              0      ;x3-4:  init cat switch: writetext
42347 126664  j1:              0      ;x3-2:  init cat switch: medium
42348 126666  
42348 126666  
42348 126666  ; return point from initializing of some segment
42349 126666  
42349 126666  i0:  rl. w1     j2.     ; get load address;
42350 126668  i1:  wa  w1  x1+0       ; calculate top address:
42351 126670       rx. w1     j2.     ;   change(old load address, top address);
42352 126672       al  w1  x1+2       ;   skip segment length;
42353 126674  
42353 126674  ; now w1, w2 = old, new load address
42354 126674  
42354 126674  ; move segment:
42355 126674  
42355 126674       sh  w2  x1        ;   if new addr > old addr then
42356 126676       jl.        i2.    ;     begin
42357 126678  
42357 126678       ds. w2     j5.    ;     save (old, new);
42358 126680       ws  w2     2      ;     diff := new - old;
42359 126682       sh  w2     i5     ;    (at least size of move loop);
42360 126684       al  w2     i5     ;
42361 126686  
42361 126686       al. w1     j2.    ;     from := last of segment;
42362 126688                         ; move to higher:
42363 126688  i4:  rl  w0  x1        ;     move word(from)
42364 126690       am      x2        ;       to word(from + diff);
42365 126692       rs  w0  x1        ;
42366 126694       al  w1  x1-2      ;
42367 126696       sn. w1     j0.    ;     if exactly all moveloop moved then
42368 126698       jl.     x2+i4.    ;       goto the moved moveloop...
42369 126700  
42369 126700       sl. w1    (j4.)   ;     if not all moved then
42370 126702       jl.        i4.    ;       goto move to higher;
42371 126704  
42371 126704       rl. w1     j4.    ;     old := old + diff;
42372 126706       wa  w1     4      ;
42373 126708       wa. w2     j2.    ;     top address := top address + diff;
42374 126710       rs. w2     j2.    ;
42375 126712       rl. w2     j5.    ;     restore(new);
42376 126714                         ;     end;
42377 126714  
42377 126714  i2:  rl  w0  x1+0       ;   move word from old
42378 126716       rs  w0  x2+0       ;     to new address;
42379 126718       al  w1  x1+2       ;   update old addr;
42380 126720       al  w2  x2+2       ;   update new addr;
42381 126722       se. w1    (j2.)    ;   if old addr <> top addr
42382 126724       jl.        i2.     ;   then goto move segment;
42383 126726  
42383 126726  ; now the segment has been moved
42384 126726  ; jump to the last moved word
42385 126726  
42385 126726       al. w3     i0.     ;   insert return;
42386 126728       jl      x2-2       ;   goto word(top addr - 2);
42387 126730  
42387 126730  ; comment:  jump to last loaded word with
42388 126730  ;           w2         = top load address
42389 126730  ;           w3         = link
42390 126730  ;           word(x3-4) = init cat switch, writetext
42391 126730  ;           word(x3-2) = init cat switch, medium
42392 126730  
42392 126730  
42392 126730  ; initialize segment 10
42393 126730  
42393 126730  i3:  ds. w1     j1.     ;   save init cat switches
42394 126732       rs. w2     j2.     ;   
42395 126734  
42395 126734  ; ************* note: uses special knowledge to format of autoboot-program
42396 126734       dl  w1     30     ;   get startup area name from fixed part of autoboot!!!
42397 126736       ds. w1     j9.+2  ;
42398 126738       dl  w1     34     ;
42399 126740       ds. w1     j9.+6  ;
42400 126742  
42400 126742  ; get monitor mode and clear all interrupts
42401 126742  
42401 126742       gg  w3     b91    ;   w3 := inf;
42402 126744  
42402 126744       rl. w0     j6.    ;   w0 := monitor mode;
42403 126746       al. w1     i6.    ;   w1 := new entry;
42404 126748       al. w2     j7.    ;   w2 := regdump;
42405 126750  
42405 126750       rs  w2  x3+a326   ;   user regdump := regdump;
42406 126752       rs  w0  x3-a325+a328+6; monitor status := monitor mode;
42407 126754       rs  w1  x3-a325+a328+2; monitor call entry := new entry;
42408 126756       jd         1<11+0 ;   call monitor;  i.e. enter below, in monitor mode;
42409 126758  
42409 126758  i6:  al  w0     1      ; after monitor mode got:
42410 126760       gp  w0     b91    ;   inf := 1;  i.e. prevent any response;
42411 126762  
42411 126762       al  w1     1<3    ;   device := 1;
42412 126764  
42412 126764  i7:  am.       (j8.)   ; next device:
42413 126766       do      x1+2      ;   reset device (device);
42414 126768       al  w1  x1+1<3    ;   increase (device);
42415 126770       sh  w1     255<3  ;   if device <= 255 then
42416 126772       jl.        i7.    ;     goto next device;
42417 126774  
42417 126774       al  w2     8      ;   new load address := 8;
42418 126776       jd.        i0.    ;   goto get load address;
42419 126778  
42419 126778  j6:  1 < 23            ; monitor mode;
42420 126780  j7:  0, r. a180>1      ; regdump
42421 126796  j8:  1 < 23            ; device address bit
42422 126798  j4:  0                 ; saved old
42423 126800  j5:  0                 ; saved new
42424 126802  i5 = k - j0            ; aproximate size of moveloop
42425 126802  
42425 126802  j2:              0      ;   top address
42426 126804       jl.        i3.     ;   goto initialize segment 10
42427 126806  j3:                     ; top address of segment 10:
42428 126806  
42428 126806  e.   ;  end segment 10
42429 126806  i.
42430 126806  
42430 126806  ; last segment
42431 126806  
42431 126806  s.w.
42432 126806       0   ; last segment empty
42433 126808  
42433 126808  e. ; end of last segment
42434 126808  m.
42434 126808                  end of monitor

42435 126808  e.
slang ok 11/73548/144
\f



  k     def     993    996    997   1217   1424   1907   2008
               2024   2220   2232   2866   3281   6358  10580
              10582  10584  10585  25700  25707  25709  25710
              26603  26604  26624  26625  26827  26830  26879
              26879  26884  28259  28274  33105  33105  33118
              33118  33132  33133  33139  33144  33145  33197
              33198  38940  38940  39243  39246  39287  39288
              42314  42428  42433
  a4    use   39036
  a8    use    1217   1424   1907   2008   2024   2220   2232
               2866   3281   6358  28259  28274
  a10   use   14369  14382  14392  14399  14502  35537  39070
              39079
  a11   use   14381  35530  37949  37951  39040  39041  39042
              39043
  a12   use   39071
  a13   use   30382  39072
  a17   use   39044
  a18   use   39045  39081
  a19   use   10519  10520  39073
  a20   use   39074
  a21   use   39075
  a22   use   39078
  a24   use   39076
  a25   use   39077
  a26   use   39047
  a27   use   39048
  a32   use   39055
  a33   use   39056
  a34   use   39057
  a42   use   39063
  a43   use   39064
  a44   use   39065  39066
  a45   use   39067  39068
  a48   use   39038
  a49   use   39039
  a50   use   14391  35536
  a54   use   10530
  a61   use   14402
  a67   use   37257
  a68   use   37259
  a73   use   14511
  a74   use   14404
  a88   use   26737  26738  26740  26741
  a89   use   39047
  a104  use   39072
  a107  use   26384  26387  26390  26393  26396  26399  26402
              26405  26408  26411  26414  26417  26420  26423
              26426  26429  26432  26435  26438  26441  39038
              39063  39065  39067
  a108  use   26384  26387  26390  26393  26396  26399  26402
              26405  26408  26411  26414  26417  26420  26423
              26426  26429  26432  26435  26438  26441  39039
              39064  39066  39068
  a110  use   26742  29040
  a113  use   25743
  a114  use   26741  41684
  a133  use      47  11413  11413  16861  16861  19865  19865
              21912  21912  25672  25672  26843  26843  28496
              28496  33172  33172  35926  35926  39263  39263
  a134  use      47     48    943   3793  11413  11414  11414
              16861  16862  16862  19865  19866  19866  21912
              21913  21913  25672  25673  25673  26843  26844
              26844  28496  28497  28497  33172  33173  33173
              35926  35927  35927  39263  39264  39264
  a138  use   10450  10456  10471  10472  10533  10536  10550
              10551
  a141  use   37945
  a150  use   10466  10483
  a151  use   10510  10513  14428  14446  14454
  a152  use   14424  14459  14463  14471  14481  14489  14494
  a153  use   10495  10508  14495  14512
  a154  use   14482  14486  14492
  a155  use   14374  14500  14510
  a157  use   10451  14487
  a170  use   39049
  a171  use   39082
  a172  use   39051
  a173  use   39052
  a174  use   39083
  a175  use   39054
  a181  use   39084
  a182  use   39059
  a183  use   39060
  a184  use   39085
  a185  use   39062
  a200  use   14407  14498
  a201  use   14501
  a215  use   26386  26389  26392  26395  26398  26401  26404
              26407  26410  26413  26416  26419  26422  26425
              26428  26431  26434  26437  26440  26443
  a301  use   39046
  a302  use   39069
  a398  use   39052  39060  41611
  a401  use   26384  26387  26390  26393  26396  26399  26402
              26405  26408  26411  26414  26417  26420  26423
              26426  26429  26432  26435  26438  26441
  a550  use   10511
  a551  use   10515
  a553  use   10496  10509
  a570  use   10483  10495  10508  10510  10513
  b3    use   26770  41578  41590
  b4    use   14376  37237  41623  41640
  b6    use   14375
  b12   use   14433  26767  41573  41574
  b18   use   14422  21053
  b19   use   14368  14396  14497  21124  21139
  b21   use   10517  14506
  b22   use   26734
  b23   use   26743
  b27   use    1154  14490  38980
  b28   use    1156  14488  26769  26771
  b54   use   39054  39054  39062  39062
  b89   use   25663
  b139  use   41618
  b151  use   38811  41610
  b152  use   41619
  b160  use   26593  39044  39056
  b212  use   41572
  b214  use   38548
  b216  use   36729
  b221  use   14442
  b225  use   41568  41569
  c12   use   33222
  c26   use   34550
  c29   use    7005   7076
  c37   use   34554  34556
  c38   use   34555
  c99   use   10558
  c107  use   33232  38811
  d2    use   37222  37295
  d5    use   10529
  d6    use   10531
  d14   use   37273  37307  37981
  d15   use   21510  37206  37896
  d16   use   29040  37212  37214  37217  37219  37902  37904
              37909  37911
  d19   use   37233  37269
  d20   use   37277  37309  37929  37983
  d21   use   37256  37262  37271  37305  37927  37978
  d22   use   36991  37258  37260  37265
  d23   use   37278  37310  37930  37984
  d30   use   38992
  d32   use   34551  36987
  d42   use   37279  37311  37931  37985
  d49   use   28360  28362  33105
  d50   use   28361  33105
  d51   use   35620  37230
  d52   use   35621  37299
  d53   use   35622
  d54   use   35623
  d55   use   35624
  d56   use   35625
  d57   use   35626
  d58   use   35527  35627  37923
  d59   use   35628
  d109  use   10521
  d113  use   14413
  d125  use   14507
  d144  use   10556
  d149  use   10564
  d150  use   10445  10545
  d151  use   10452  10552
  d152  use   10557
  d153  use   10479
  d154  use   10568
  e25   use   34553
  e30   use   33114
  e32   use   35548
  e80   use   36057
  e82   use   34491  36063  38993
  e106  use   35545  35559  36009  38056
  f0    use   10444  10447  10544  10547  26593
  f1    use   10443  10448  10543  10548
  f2    use   10442  10449  10453  10542  10549  10553
  f47   use   30383
  f51   use   41629
  f58   use   41604
  f59   use   40936  41543
  g2    use   38006  38549
  g3    use   11816
  g5    use   14379  14384  14388  14397  14409  14432  14434
              14439  14484
  g6    use   14414  14416
  g8    use   34552  34558  36730
  g11   use   26736  26744
  g18   use   38651
  g35   use   37283  37925  37933  37970  37987
  g36   use   37284  37297
  g45   use   38749  38750  38751
  g47   use   37312  37908  37915  37920  37932  37986
  g50   use   14425  14426  14452  14461
  g57   use   38749
  g58   use   38751
  g59   use   38750
  g67   use    7075
  g68   use    7004
  g100  use   26386  26416
  g101  use   26389
  g102  use   26392
  g103  use   26395
  g104  use   26398
  g105  use   26401
  g106  use   26404
  g107  use   26407
  g108  use   26410
  g109  use   26413
  g111  use   26419
  g112  use   26422  37204  37997
  g113  use   26425  37294  37301  37313  37998
  g114  use   26428  37999
  g115  use   26431  38000
  g116  use   26434  38001
  g117  use   26437  38002
  g118  use   26440  38003
  g119  use   26443
  g121  use   37896  38004
  g122  use   37942  38005
  h0    use    1217   1424   1907   2008   2024   2220   2232
               2866   3281   6358  28259  28274
  h1    use   28377
  h4    use   28360  28375
  h5    use   28361  28374
  h6    use   28362  28371  28372  28376
  h9    use   25743
  h11   use    7594  41684
  h12   use   41617
  h23   use   37188
  h24   use   37189
  h25   use   10441
  h34   use   20040
  i0    use      47  10401  10463  10464  10468  10478  11413
              11413  16861  16861  19865  19865  21142  21912
              21912  25672  25672  26843  26843  28496  28496
              33172  33172  34549  34556  35926  35926  36988
              36990  37894  37895  37926  39263  39263  41551
              41557
  i1    use      47     48    943   3793  10404  10541  11413
              11414  11414  14412  14519  16861  16862  16862
              19865  19866  19866  21113  21125  21128  21140
              21143  21912  21913  21913  25672  25673  25673
              26843  26844  26844  28496  28497  28497  33172
              33173  33173  35535  35554  35566  35926  35927
              35927  37286  39263  39264  39264  41567
  i2    use   10405  10455  14372  14520  35527  35549  35567
              41580  41588  41643
  i3    use   35528  35563  35568  37939  37971  41579  41587
  i4    use   10412  10467  14405  14468  14469  14472  14474
              14521  37940  37971  37972  41585  41601
  i5    use   21111  35526  37203  37293  37938  37941  37972
              37973  41542  41548  41556  41560  41621
  i6    use   14420  14423  14427  14445  14453  14458  14462
              14470  14477  14522  38954  38954
  i7    use   38954  38954
  i8    use   38954  38954
  i10   use   10398  14366
  i18   use   11932  39037
  i25   use   38953  38954  39073
  i26   use   38953  38954  39074
  i27   use   38953  38954  39075
  i28   use   38992  39088
  i29   use   38984  38993
  i41   use    7596   7603
  j0    use   14401  14404  21118  21123  21133  21138  35536
              35539  37894  37924  37926  37944  37971
  j1    use   10461  10475  14391  14394  31071  31073  37231
              37267  37962  37972
  j2    use   10474  10477  30384  35534  35541  35561  37266
              37275  37938  37969  37973
  j3    use   41543  41606  41607  41626  41630  41634
  j4    use   41544  41608
  j5    use   10494  21111  35526  37203  37293  41545  41562
              41609
  j6    use   41550  41552  41610
  j9    use   14423  14455  14464  14479
  j10   use   14448  14457  41602  41611
  j11   use   14444  14467  41582  41583  41584  41589  41612
  j12   use   14504  14509  41591  41613
  j13   use   14508  14514  41599  41614
  j14   use   41561  41603  41616  41641
  j15   use   10398  41577  41617
  j16   use   41618  41631
  j17   use   41542  41619  41621  41628
  j20   use   14366
  l53   use   10442  10542
  m0    use   35529  35542
  m1    use   14371
  m2    use   14367
  n0    use   21112
  n1    use   21127
  n2    use   35531  35544
  n100  use   14517
  o6    use   10486  10492
  o27   use   10489  10497  10527
  o28   use   10523  10539
  o29   use   10458  10561
  o33   use   10488  10505
  o40   use   10398
  p1    use   37174  37270
  p2    use   37175  37261
  p3    use   37176  37304
  p4    use   37177
  p5    use   37178
  p6    use   37179
  p7    use   37180
  p8    use   37181
  p9    use   37182  37208  37210  37229  37898  37900  37916
              37948
  p10   use   37183  37211  37227  37901  37922
  p11   use   37188
  p12   use   37189
  p13   use   37190  37239
  p14   use   37191  37243
  p15   use   37192  37245
  p16   use   37193  37247
  p17   use   37194  37249
  p18   use   37195  37251
  p19   use   37196  37253
  p20   use   37197  37255
  p64   use   21301
  p66   use   21299
  p71   use   19891
  p72   use   19892
  p73   use   19893
  p74   use   20280
  p86   use   20489  20519
  p87   use   20521
  p91   use   19894
  p92   use   19895
  p93   use   19896
  p94   use   20581  20686
  p301  use   19891
  p302  use   19892
  p303  use   19893
  p321  use   19894
  p322  use   19895
  p323  use   19896
  q4    use   14385  14400  14503
  q6    use   14386  35538  37242  41625
  q8    use   37244
  q14   use   37246
  q18   use   37248
  q20   use   14370  14393  35540  37250
  q26   use   37252
  q28   use   37254
  r0    use   21115
  r20   use   21130
  s2    use   21056
  s3    use   20488  21055  21323
  s31   use   21114  21129
  s100  use   21298
  s101  use   20518  21298  21300
  s102  use   20518
  u82   use   34335  34491
  v19   use   37226  37298
  v21   use   37207  37897
  v23   use   37209  37899
  v32   use   37953
  v51   use   37234  37263  37957  37959  37966  37977
  v78   use   37223  37281
  v106  use   37942  37964  38056
      0 b. a800, b300, q70
  42435 e.
  a0    def     122  10766  11148  17365  19940  21951
        use    3934   3934   3936   3936   3936   3936   3936
               3936   3936   3938   8491   8491   8491   8491
               8491   9410   9410   9714   9714   9714   9714
               9714   9714   9714   9714   9714  10934  10934
              10934  10935  10935  10935  10935  11149  11149
              11149  11149  11150  11151  11151  11151  11152
              11153  11153  11153  11154  11154  11154  11154
              11154  11154  11154  11154  11154  11154  11154
              11154  11154  11154  11154  11841  11842  11843
              11844  11845  11846  11847  11849  11849  11849
              11849  11851  11912  11913  11914  11915  11916
              11917  11918  11919  11920  11921  11922  11923
              11924  11925  11926  11929  11936  11936  11936
              11936  11937  11937  11937  11937  11937  11937
              11937  11937  11939  11941  14263  14263  14263
              14263  14263  14263  14263  14263  14263  14263
              14263  14264  14264  14264  14264  14264  14264
              14265  14265  14265  14265  14265  14265  14265
              14265  14265  14265  14265  14266  14266  14266
              14266  14266  14266  14266  14267  14267  14267
              14267  14267  14268  14268  14268  14269  14269
              14269  14269  14269  14269  14269  14270  14270
              14270  14270  14270  14270  14270  14272  15590
              15590  15590  15590  15590  15591  15591  17366
              17366  17366  17366  17366  17366  17366  17367
              17367  17367  17367  19941  19941  19941  19941
              19941  19942  19942  19942  19942  19942  19942
              19942  19942  19942  19942  19942  19942  19942
              19943  19943  19944  19944  19944  19944  21962
  a1    def     124    166
        use   25738  26572  38951
  a2    def     386
        use   26572  26707
  a3    def     125    167
        use     174    339  25740  26574  26604  38912  38951
  a4    def     312
        use   26574  26604  26727  26794  31004  31531  36066
              39092  39145  39194  39199  39203
  a5    def     126    168
        use   26578  26604  38951
  a6    def     802
        use    1054  26578  26604
  a7    def     803
        use    3219  26761  31407  31476
  a8    def     889
        use    1216   1423   1906   2007   2023   2218   2230
               2865   3280   3400   6357  26635  28257  28272
  a9    def     127
  a10   def     229
        use    1544   1626   2661   3022   3039   3052   3610
               4006   4020   4118   4130   4329   4610   4699
               5128   5144   5202   5291   5513   5639   5702
               5752   5843   5849   5852   5878   5917   5953
               6019   6025   6046   6118   6286   6332   6626
               6629   6692   6695   6705   6829   6850   6878
               6934   7010   7065   7356   7365   7759   7805
               7811   7871   8310   8965  10078  10142  10166
              10632  10656  11014  11203  11285  11808  12888
              13823  14179  14557  14579  14680  14695  14700
              14728  14907  14935  15053  15109  15129  15144
              15229  15665  15680  15703  15825  15860  15919
              16043  16079  16176  16198  16382  16484  16647
              16678  16687  16752  17202  17205  18192  18212
              18272  19968  20035  20356  20610  20634  20648
              20791  20958  20977  21647  21671  22018  22022
              22571  24245  24287  24377  24398  26645  29452
              29925  30001  30016  30940  31248  31355  31451
              31481  31486  31551  31603  31631  31703  31773
              35160  35497  39026  39032  39126  39135  39179
              39188  39230  39236  40666  40911  41150
  a11   def     230
        use    2881   2882   2885   2886   2919   5135   5220
               5222   5939   5940   5945   5946   6097   6099
               7900   7902   7932   7934   7944   7946   7971
               7973   7990   7992   8328   8330   9389   9391
              13831  15869  15871  15881  15883  16111  16150
              16531  16796  16798  16833  16835  18063  18065
              20186  20188  20650  21657  21659  21673  21674
              21794  21795  21796  21799  21807  21810  21811
              23914  23918  23924  24340  24342  24736  25170
              27703  27705  27821  27923  27924  27927  27928
              27958  28288  29838  30026  30028  30113  30971
              31391  31403  31429  31441  31456  34101  34103
              34143  34147  34176  34178  34401  34403  35166
              35168  35280  35334  35381  35430  36886  36895
              36949  38582  39003  39004  39005  39006  39096
              39097  39098  39099  39149  39150  39151  39152
              40914  41732  41734
  a12   def     241
        use    1638   1639   1949   1950   2505   2508   2533
               2535   2545   2547   6586   6588   7579   7581
               7599   7601   8447   8449   8867   8869   8896
               8898   9375   9377   9586   9588   9691   9693
              27520  31202  31208  31210  31222  36910  39027
              39127  39180
  a13   def     242
        use    1223   1473   1495   1640   1645   1952   2013
               2016   2045   2468   2538   2542   2577   3287
               3307   3353   3356   5155   5184   5213   6530
               6590   6708   6937   7013   7070   7575   8114
              31111  31138  31190  31193  31206  31300  31436
              31634  31706  34855  36913  39028  39128  39181
  a14   def     243
        use    2381   2638   2643   2645   2653   2698   2700
               2743   2745   2746   2761   2771   2773   2775
               2783   2785   2786   2788   2941   2943   2944
               2946   2951   2966   2972   2974   2976  11254
              24189  26716  26717  27528  27530  27564  30529
  a15   def     244
        use    1476   3239   3241   5182   5184   5188   5189
               5245   5249   5253   6077   6079   6165   6178
               6208   6527   6529   6538   6542  10613  10620
              26724  26727  28455  37021  37022
  a16   def     246
        use    1239   1947   1955   2017   2046   2056   2073
               2076   2077   2083   3357   6545  25756  26785
              26786  28456  31198  31201  39191
  a17   def     248
        use    2412   2558   2829   3159   3180   3198   5275
               6615   6658   6676   6716   6942   6947   6952
               7377   7403   7472  11229  22051  25756  31075
              31311  31638  34232  34889  34892  36068  36749
              36899  36904  39007  39100  39153
  a18   def     249
        use    2413   2830   3160   3181   3199   5276   6616
               6659   6677   6717   6941   6948   7024   7031
               7378   7404   7420   7473  22052  25758  31011
              31049  31068  31078  31312  31639  34223  34894
              34896  36903  38086  39008  39139  39154
  a19   def     250
        use    1730   1731   2264   2268   2323   2325   2555
               2557   2988   2992   3029   3031   3635   3637
               4620   4622   5249   5957   5961   6129   6131
               6198   6200   6231   6597  10284  10285  10648
              10650  14164  14166  15303  15517  15519  16194
              21412  21414  21770  21772  22379  22382  25758
              31082  31083  31106  31175  31177  31230  31232
              31595  31597  31606  31608  34573  36598  36971
              39029  39129  39182
  a20   def     251
        use    6440  27683  27684  29962  29981  29985  30099
              30100  31088  31089  34578  36601  36976  39030
              39130  39183
  a21   def     252
        use   25761  30995  31013  31098  31100  31104  31515
              31518  31520  34583  36604  36981  39131  39184
  a22   def     253
        use    4049   6349   6415   8947   8983  28607  31064
              31065  31380  36607  39031  39134  39187
  a23   def     387
        use   31423  31425  31507  31509  31762  31766
  a24   def     255
        use    6972  39132  39185
  a25   def     256
        use   31041  39133  39186
  a26   def     257
        use   31016  39010  39103  39156
  a27   def     258
        use    3484   5455   5460   5461  25763  25765  26452
              31001  36790  39011  39104  39157
  a28   def     277
        use     316   1235   1494   2180   3473   3474   3475
               3476   5159   5188   5217   5253   5465   5652
               5877   5891   5911   5969   6006   6059   6091
               6125   6139   6219   6244   6567   6859   7275
               7289   7301   7302   7657   7754   7906   7908
               7909  25768  25801  26453  28450  31309  31310
              31317  31322  31324
  a29   def     278
        use    3155   3194   3473   3491   5163   5225   5494
               5882   5975   6063   6133   6226   6361   6379
               6407   6421   6423   6427   6446   6490   6496
               6554   6613   6656   6736   6808   6881   6940
               6950   7001   7073   7322   7402   7738  28217
              30305  30386  30463  30910  31649  31679  31711
              31736  36794
  a30   def     279
        use    1492   2998   3163   3165   3213   5157   5189
               5242   5972   5974   5999   6002   6013   6032
               6092   6103   6162   6210   6230   6246   6257
               6320   6685   6860   7272   7332   7494   7749
              28221  31184  31186  31627  31654  31698  31716
              31769  39190
  a31   def     280
        use    2825   3163   3474   3493   5218   5451   5927
               6024   6030   6095   6458   6502   6580   6584
               6614   6833   6871   6925   6997   7259   7621
               7661  25775  28225  31650  31680  36796
  a32   def     281
        use    5466   5470  25775  25777  31315  31317  31319
              31322  39013  39111  39164
  a33   def     282
        use    3311   3313   3475   3495   3506   6591   7043
               7045   7308   7909  25777  25779  25801  31081
              31194  31197  31309  31310  36798  39014  39112
              39165
  a34   def     265
        use    1648   2544   5880   6585   6876   6893   6932
               6959   7008   7019   7068   7082  20983  27485
              27526  31107  31207  31516  36887  36948  39113
              39166
  a35   def     266
        use    1956   1957   1993   1995   1996   2048   2073
  a36   def     267
        use    2076   2077  25828  31521  31522  31523
  a38   def     268
        use   31109
  a39   def     269
        use    1998
  a40   def     270
        use    1647   2543   6583  27511  31188  31221  31533
  a42   def     271
        use   39019  39119  39172
  a43   def     272
        use    2832   2843  30251  30391  31021  36373  38064
              39020  39120  39173
  a44   def     274
        use    5594   5595   6303   6304  28654  30306  30313
              31018  31023  31027  31028  39021  39022  39121
              39122  39174  39175
  a45   def     276
        use   30310  30314  30322  30323  30410  30411  31020
              31030  31034  31035  34604  34608  36594  39023
              39024  39123  39124  39176  39177
  a46   def     301
        use     312  26731  30597  31524  31525
  a47   def     311
        use     312  31004  31531
  a48   def     227
        use     353  16572  16573  18138  39001  39094  39147
  a49   def     228
        use    2890   5592   6301  15873  15874  16173  21707
              21708  24239  27696  27931  28127  30011  30970
              39002  39095  39148
  a50   def     356
        use     621   1628   3025   3051   3102   3103   3632
               4134   4210   4703   5137   5147   5205   5623
               5690   5703   5778   5920   6021   6049   6120
               6334   6628   6694   6707   7358   7367   7810
               8416   8575   8579   9094  10144  11017  11034
              11678  12009  12019  13835  13836  14560  14739
              14896  15054  15142  15176  15237  15238  15255
              15317  15711  15853  15856  16200  16251  16679
              16754  17204  17652  17832  18190  18466  18520
              18533  18537  18548  18671  18816  18888  18892
              18896  19288  19434  19483  19514  19972  19985
              20263  20288  20357  20417  20427  20433  20475
              20484  20508  20534  20543  20551  20602  20625
              20670  20724  20765  20794  20830  20861  20899
              20944  21045  21049  21059  21287  21294  21314
              21320  21354  21370  21431  21438  21447  21452
              21484  21570  21583  21590  21644  21649  21662
              21675  21709  21710  21750  22020  22099  22112
              22160  22166  22270  22467  22626  22730  22766
              22796  22896  22917  22972  23022  23054  23084
              23124  23135  23290  23294  23301  23337  23351
              23380  23419  23449  23492  23495  23542  23545
              23609  23982  24020  24034  24071  24117  24212
              24289  24291  24310  24395  24400  24602  24663
              24678  24740  24986  25008  25061  25099  25160
              25174  25175  25571  27822  28291  30022  31397
              31422  31453  31483  31488  31504  31506  31573
              31605  31633  31705  31771  35506  35507  41157
  a52   def     357
        use    2380   2636   2758   2950   2953   2967   8311
               8321  13832  16112  16151  16162  16532  18672
              19289  21676  24179  24737  25171  29840  30528
              31392
  a54   def     469
        use    1517   2327   2331   2460   2461   3104   4566
               4573   8046   8107   8108   8644   9216   9260
               9499   9791  10116  10157  10164  10302  10835
              10838  10858  10859  10863  10901  10902  10960
              11004  13118  13809  13810  15138  15850  15852
              16049  16117  16686  16692  16700  16702  16736
              16737  17516  18316  18318  21534  21536  21631
              21632  21711  21712  21747  22061  22326  22332
              22582  22583  24382  24383  24588  24589  25019
              26687  31256  31257
  a55   def     470
        use   10861  10864  15140  21713  26689
  a56   def     471
        use    2332   3107   3109   5646   5762   8935   8950
               8978   8993   9000   9001  11049  11118  11812
              11893  12630  12675  12754  12909  13032  13188
              13268  13284  13805  16957  17488  17512  17515
              18040  18703  18805  18809  19318  19423  19427
              22973  22978  24914  24954  41728
  a57   def     358
        use    5131   5133   5310   5312   5608   8577   8788
               8882   8912   8953   8968   8973   8974   8977
               8986   8991   9002   9004   9092  15146  15230
              28289  29593  29970  35508  41153
  a58   def     358
        use   29913  40392
  a59   def     534
        use   15112  15359  16001  16268  16395  16414  16446
              26683  31571  37878
  a60   def     379
        use    4225  12114  25005  30007  30679  31770
  a61   def     380
        use    8428   8438   8468  11820  12006  24965  24975
              30009  30662  40389
  a62   def     381
        use   12012  27699  27701  30003  30005  30670  30671
              30674  30675
  a63   def     477
        use     478   5764  10634  11022  16972  16972  29455
              30962
  a64   def     478
        use   16974  16974
  a65   def   17071
  a66   def     157  18498
        use   26808
  a67   def     619
        use   37425
  a68   def     620
        use     621   7994  14731  15156  15157  37427
  a70   def     473
        use     477   4749   4754   4756   4759   4764   5611
               7865   8050   8789  11025  14563  14910  15073
              15091  15160  15162  15165  15166  15256  15258
              15261  15262  15264  15972  16089  16109  16148
              30952  30956  30965  30968  41158
  a71   def     474
        use    4224   4229   4750   4753   4761  10641  10642
              11685  14733  15239  15705  15843  16165  16190
              16214  16620  16845  22588  23831  24182  24282
              24347  29893
  a72   def     475
        use    4214   4216   4230   4257  11686  15134  29806
              29841
  a73   def     524
        use    4231   4760   8876   8903  14734  15077  15087
              15097  15706  15844  41161  41204
  a74   def     525
        use    5655   5856   8327   8849   8858   8939  14941
              15080  15098  15149  15886  15924  16168  16837
              41076  41205
  a75   def     526
        use    4237   4241   4708   9185   9190   9396   9397
              14735  14976  15152  15153  15707  15845  15934
              15942  15943  15968  16114
  a76   def     529
        use    4838   4891  14926  15320  15862  15992  16293
  a77   def     530
        use    4840   4893  10146  14575  14742  15154  15155
              15318  15714  15863
  a78   def     531
        use    1296   1297   1394   1395   3711   4140   4148
               4338   4339   4344   4356   4368   4369   4940
               4949   4950   7770   7771   8418   8649   8650
               8666   8667   8797   9221   9222   9232   9233
              10121  10122  10137  10138  10214  10223  10224
              10264  10266  14175  14573  14574  14607  14741
              14882  14903  14930  14933  15059  15180  15298
              15312  15313  15315  15713  15858  15994  15997
              16092  16250  16288  16289  16291  16314  16316
              16354  16359  16381  16649  16651  30947
  a79   def   16971
        use   21705
  a80   def     129    169
        use    1126  11073  11630  16884  23811  24416  24765
              25276  25662  35182  35619  37169  37595  37996
              38872  42289  42304
  a81   def     532
        use    1398   1399   3062   3086   4127   4162   4548
               4549   5657   5858   8310   8311   8318   8660
               9235  10130  15135  15137  15847  15849  16345
              16372  16403  16404  16702  16704  26684  26686
  a82   def     130
        use   11631  17069
  a83   def     128
        use    3288
  a84   def     131
        use    1127  17068
  a85   def     132
        use    1060   2071  25834
  a86   def     527
        use    4243   4998   4999   5014   5055   5056   5078
               9197   9198   9385   9582   9688  10098  10099
              14609  15867  15947  15965  15987  16319  16344
              16371
  a87   def     528
        use    5012   5076  14292  14323  14736  15150  15151
              15708  15846  15865  15939  15946  15963  15985
              16385
  a88   def     189
        use    6447   6459   6462   6482   6485   6485   6489
               6495  26566  26567  26574  26576  26750  26751
              26753  26754  26899  26997  34708  34711  34713
              34764  34766  35656  35660  39393  39945  40080
              40085  40325  40327  40329  40742  40746  41112
              41125
  a89   def     133
        use   31539  39010  39103  39156
  a90   def     134
        use    3435   5316
  a91   def     135
  a92   def     136
        use   28358  28370  33103  33110  33113
  a93   def     137
        use   33278
  a94   def     323
        use    1224   1496   1951   2014   3289
  a95   def     324
        use    2044   2807   2809   3354  25752  26926  39128
              39181
  a96   def     325
        use    3351
  a97   def     326
        use   26928
  a98   def     327
        use   26930
  a99   def     328
        use    1649   2548   6938   7014   7071   7576  26927
  a100  def     329
        use    7577  26929
  a101  def     330
        use    6523   6589
  a102  def     331
        use    1971   5214   6531   6541  39028
  a103  def     332
        use    1973   1975   5156
  a104  def     333
        use    1474   1971   1973   5185   5247
  a105  def     335
        use    1642   2471   2539   2578   3308   6709   8115
              31635  31707
  a106  def     336
        use    1644   2541
  a107  def     189
        use    1888   1890  25887  25891  25898  25902  25929
              25933  25937  25951  25968  25982  25993  26001
              26011  26025  26036  26044  26057  26073  26082
              26086  26091  26101  26120  26136  26145  26148
              26151  26154  26157  26160  26163  26166  26169
              26172  26175  26178  26181  26184  26187  26190
              26193  26196  26199  26206  26220  26231  26239
              26293  26296  26299  26302  26305  26308  26311
              26314  26317  26320  26323  26326  26329  26332
              26335  26338  26341  26344  26347  26350  26353
              26356  26359  26362  26365  26368  26371  26374
              26377  26380  34943  36049  38123  39001  39019
              39021  39023  39094  39119  39121  39123  39147
              39172  39174  39176  39385  40723
  a108  def     189
        use    1889   1891  25887  25891  25898  25902  25929
              25933  25937  25951  25968  25982  25993  26001
              26011  26025  26036  26044  26057  26073  26082
              26086  26091  26101  26120  26136  26145  26148
              26151  26154  26157  26160  26163  26166  26169
              26172  26175  26178  26181  26184  26187  26190
              26193  26196  26199  26206  26220  26231  26239
              26293  26296  26299  26302  26305  26308  26311
              26314  26317  26320  26323  26326  26329  26332
              26335  26338  26341  26344  26347  26350  26353
              26356  26359  26362  26365  26368  26371  26374
              26377  26380  34944  36050  38124  39002  39020
              39022  39024  39095  39120  39122  39124  39148
              39173  39175  39177  39385  40724
  a109  def     138
        use    1067  29251  29265  29323  29364  29365  29391
              29506  29724  29742  30428  30446  34760
  a110  def     139
        use     312   6477  26755  28312  29039  29254  29332
              29340  29403  29433  29727  30125  30128  30429
              30465  30607  34762  38159  38601  38815  39384
              40574
  a111  def     140
        use    1067  30405
  a112  def     182
        use     183    312  33229  33324  38949
  a113  def     141
        use     182  25743  26576  26604  26733
  a114  def     142  26566  26566
        use   26566  26566  26566  26576  26604  29656  41684
  a115  def     172
        use     182  25745  25745  26578  26604  26746
  a116  def     143    173  26567  26567
        use   26567  26567  26567  26578  26604  26754  29657
              41683  41684
  a117  def     174
        use   33226  38950
  a118  def     183
        use     183
  a119  def     183
  a123  def     148
        use   26005  26048  26243
  a124  def     149
        use   25976  26005  26019  26048  26214  26243
  a125  def     176
        use    2094  25976  26005  26019  26048  26214  26243
  a127  def   26568
        use   34693
  a128  def     144
  a130  def     151    164
        use    2095  39340  39342  39343  39344  39345  39346
              39347
  a131  def     152    165
        use    2096  39342  39343  39344  39345  39346  39347
  a133  def      44    942   3792
        use      46     47    941    942   3791   3792  11412
              16860  19864  21911  25671  26842  28495  33171
              35925  39262  39325  39326  39327  39328  39329
              39330
  a134  def      44    942   3792
        use      48    943   3793  39325  39326  39327  39328
              39329  39330
  a135  def      39
        use    1041   2115  39316  39317
  a136  def      40
        use    1041   2115  39316  39317
  a138  def     786
        use     802    803   1406   2528   3056   3060   3080
               3084   3530   3531   3543   3549   3596   3597
               3617   3619   3622   3651   3669   4108   4109
               4533   4556   4605   4882   4883   4900   4902
               4945   4946   5200   6335   7796   7818   7822
               8440   8565   8583   8592   8593   8621   8653
               8656   8680   8681   8860   9083   9097   9106
               9107   9165   9225   9228   9265   9268   9282
               9283   9368   9484   9492   9572   9666   9765
               9776   9784   9803   9804   9980   9986  10001
              10002  10124  10127  10160  10163  10219  10220
              10305  10308  10322  10323  11053  11056  14194
              15543  16411  31264
  a139  def     787
        use    5973   6000   6224   6225  31185
  a140  def     788
        use     803   3087   4157   4164   8407   8661   8778
               9236   9360   9473   9566   9656  10132  10612
              10619  10836  16123  16764  21667  24404  24593
              31267  31277
  a141  def     790
        use    2993   2994   3033   3072   3627   4005   4115
               4609   5125   5140   5201   5287   5289   7800
               7929   8572   8943   9090   9480   9772  12883
              14167  14168  15520  15521  16483  16489
  a142  def     791
        use    1623   3017   3021   4004   4012   5141   6007
               6224   6700   7345   8057   8111   8446   8866
               8895   8946   8982   9374   9388   9585   9690
              11251  14720  14752  15307  15327  15695  15724
              16751  21646  24397  31259
  a145  def     800
        use    7348   7490  11637
  a146  def     801
        use     802   7491
  a150  def     792
        use     800   3562   3571   3573   3579   3580   4023
               4046   4449   4478   4540   4842   4844   5198
               5268   6701   8085   8119   8140   8422   8456
               8612   8618   8784   8795   9125   9248   9676
               9679   9996  10021  10781  10840  10871  10877
              11006  11029  14187  14221  14581  14723  14748
              14829  15042  15169  15526  15568  15698  15720
              16125  16128  16742  16745  21637  21640  24326
              24388  24391  24595  24598
  a151  def     793
        use    2273   3550   3551   3666   4396   4451   4452
               4453   4454   4541   7925   8060   8078   8135
               8629   8630   8890   8905   9172   9173   9381
               9578   9672  10063  10074  10075  10204  10260
              10275  10278  11033  11057  14210  14215  14217
              14316  14711  14888  15006  15104  15114  15221
              15304  15352  15557  15562  15564  15685  16131
              16748  21643  24394  24601
  a152  def     794
        use    3566   3567   3568   3658   4280   4394   4542
               4563   4847   5271   5282   7372   8080   8138
               8452   8473   8626   8873   8888   8893   8906
               9169   9176   9206   9379   9384   9576   9581
               9670   9675   9683   9684   9686  10061  10071
              10090  10106  10202  10780  10802  10876  10887
              10904  10966  10967  11059  14208  14213  14730
              14879  14927  14975  15007  15045  15185  15420
              15423  15555  15560
  a153  def     795
        use    2275   3552   3553   4234   4422   7927   8090
               8426   8454   8847   8875   8877   8940   8956
               9179   9180   9183   9399   9657   9766  10093
              10094  10194  10263  10273  11067  14293  14673
              14744  15078  15081  15085  15094  15354  15659
              15716
  a154  def     796
        use    3581   3582   4218   4219   4247   4272   4398
               4421   4427   4428   4849   8433   8443   8474
               8779   8854   8863   8904   9084   9191   9192
               9195   9201   9202   9210   9390   9392   9567
              10058  10064  10097  10102  10103  10108  14704
              15086  15096  15148  15187  15923  15925  16006
  a155  def     797
        use    3554   3555   8408   8455   8475   8566   8632
               8637   9361   9474  10081  10087  15937  15962
  a156  def     798
        use    3583   3584   4851  10066  15932
  a157  def     799
        use     801   3556   3557   3585   3586   4853   9981
              10062  10067  10111  15971
  a170  def     259
        use    1232   5456   5457   5460   5472   7032   7039
              25765  39012  39105  39158
  a171  def     260
        use    7093   7098  25768  39140  39159
  a172  def     261
        use   31038  39107  39160
  a173  def     262
        use   39108  39161
  a174  def     263
        use   31060  39141  39162
  a175  def     264
        use   31062  39110  39163
  a176  def     283
        use    3483   5458   5487   5928   6289  28458
  a177  def     284
        use    3476   3500
  a178  def     317
  a179  def     316
        use    1225   1237   3337   3461
  a180  def    3477
        use    3505   5452  10594  25799  33111  33393  33410
              36803  42420
  a181  def     285
        use     316    317   6818   6843   7101  25779  39142
              39167
  a182  def     286
        use    2270   2869   3490   3504   5164   5219   5226
               5280   5281   5932   5976   5990   5993   6064
               6096   6102   6132   6661   6682   6722   6809
               6815   6825   6834   6840   6846   6930   6951
               6953   6970   6971   7040   7042   7406   7466
               7476   7908   8061  11184  14216  15563  28232
              31037  31039  31050  31051  31646  31652  31712
              31723  31731  34225  34231  34890  34897  36793
              36802  36900  38085  39015  39115  39168
  a183  def     287
        use    6811   6836  39016  39116  39169
  a184  def     288
        use    6812   6837   6975   6978  31059  39033  39143
              39170
  a185  def     289
        use   25785  31057  31061  39018  39118  39171
  a186  def     290
        use    1681
  a194  def     155
        use    1914   3412
  a197  def     153    177
  a198  def     154
        use    1025  26524  26525  26526  26527  26531  26532
              26533  26534  26535  26537  26563
  a199  def     156
        use   33396  34100  37138  40647
  a200  def     567
        use    3639   3646  15003
  a201  def     568
        use    3641   3647  10077  10083  10096  10141  14914
              15244  15324
  a215  def     621
        use   26147  26150  26153  26156  26159  26162  26165
              26168  26171  26174  26177  26180  26183  26186
              26189  26192  26195  26198  26201  26295  26298
              26301  26304  26307  26310  26313  26316  26319
              26322  26325  26328  26331  26334  26337  26340
              26343  26346  26349  26352  26355  26358  26361
              26364  26367  26370  26373  26376  26379  26382
  a216  def     563
        use    4152   4154  14808  14833  15322  16706
  a217  def     565
        use    4346   4350   4354
  a218  def     566
        use    4359   4362  14809  14834  15323  16707
  a219  def     571
        use   26063  26063  26063  26079  26079  26079  26126
              26126  26126  26142  26142  26142
  a220  def     411    451
        use     451   7482  17091  17092
  a221  def     412    451
        use     451   7483  26654
  a225  def     420    452
        use     452   1536   1538   1585   1594   1602   7396
               7611   7614
  a226  def     422    452
        use     423    452   7961
  a227  def     423    452
        use     452   7392
  a228  def     425    453
        use     426    453  26490  26496  26501  26503  26524
              26527  26537  26563
  a229  def     426    453
        use     453   1374   1391
  a230  def     428    454
        use     429    430    431    454   1444   6563   7268
               7634  10827  11313  11314  11316  12699  13466
              13678  26525  26526  26531  26532  26533  26534
              26535
  a231  def     429    454
        use     454   7918   7948  13686  18764  18904  18968
              19522  19622
  a232  def     430    454
        use     454
  a233  def     431    454
        use     454   7636   7950  12701  12702  13463  18779
              18906  18970  19063  19384  19524  19624
  a235  def     433    455
        use     455   1536   1539   3609   4328   7663   7761
              10172  10827  10928  11295  12516  12916  13204
              13285  14590  17434  18696  18740  18831  18860
              19313  19363  19451  19492
  a240  def     435    456
        use     436    456  26480  26487  26488  26489  26491
              26493  26494  26495  26498  26499  26500  26502
  a241  def     436    456
        use     437    456   1266   1282   1312   1444   1471
               1491   1572   1575   3689   6571
  a242  def     437    456
        use     438    456   1557   3704   5018   5073   5085
               7628   7637   7663   7696  10923  10925  10928
              14611  16320
  a243  def     438    456
        use     456
  a244  def     439    457
        use     441    457   1519   1572   5017   5084   7696
               7917  10923  10925  11318  12873  13388  15764
              16353  16380  18908  18972  19059  19526  19626
              19707
  a245  def     441    457
        use     457   1520
  a246  def     442    457
        use     443    457   1491
  a247  def     443    457
        use     457   1515
  a250  def     345    354
        use     354    384    450   1467   1590   2705   3027
               3040   5207   6022   6122   6631   6697   7270
               7360   7369   7746  17093  30014  30015  30941
              31249  39218  39220
  a300  def   26469
        use   26523  26552  26553  26554
  a301  def     254
        use    2047   2056   2083   5172   5173   5234   5235
               6884   6901   6903  25761  25763  31114  31115
              36907  39009  39102  39155
  a302  def     291
        use    2271   2288   6157   7306  25785  25787  31113
              39025  39125  39178
  a303  def     318
        use   25787
  a304  def     315
        use    6158   7307
  a305  def     298
        use     318
  a306  def     299
        use    6979   6982
  a310  def     480
        use    3417   7625
  a311  def     481
        use    6562   7267  10824
  a312  def     482
  a313  def     483
        use    1555  10179  14599
  a314  def     484
        use    3414  10831
  a315  def     486
        use    7538
  a316  def     487
  a317  def     488
  a318  def     489
  a320  def     494
        use    7233   7418
  a321  def     491
        use    7234
  a322  def     492
        use    7235
  a323  def     493
        use    7236
  a325  def    1192
        use    1234   1236   5473  42406  42407
  a326  def    1186
        use    1192   1236  42405
  a327  def    1187
  a328  def    1188
        use    1234   5473  42406  42407
  a329  def    1189
  a330  def    1190
  a331  def    1191
  a339  def     293
        use    3481
  a340  def     294
  a341  def     295
  a342  def     296
  a343  def     297
  a349  def     384
        use     385    386  26570  26696
  a350  def     876
        use    3402
  a351  def     877
        use    3398
  a352  def     878
        use    3392
  a353  def     879
        use    3395
  a354  def     880
        use    3404
  a355  def     881
        use    3406
  a398  def     158
        use   31044  39007  39016  39108  39116  39153  39161
              39169
  a399  def     159    178
        use    1151   7003   7074  14329  14332  26592  26766
              26877  31069  33116  33221  33231  34334  34490
              35515  35571  36008  36062  36688  36728  37892
              37990  38055  38547  38810  38938  38952  38979
              38991  39034  40935  41540
  a400  def     162
  a401  def     339
        use     340  16562  25883  25887  25891  25898  25902
              25910  25913  25916  25919  25923  25926  25929
              25933  25937  25941  25951  25968  25982  25993
              26001  26011  26025  26036  26044  26057  26073
              26082  26086  26091  26101  26120  26136  26145
              26148  26151  26154  26157  26160  26163  26166
              26169  26172  26175  26178  26181  26184  26187
              26190  26193  26196  26199  26206  26220  26231
              26239  26245  26248  26251  26254  26257  26260
              26263  26266  26269  26272  26275  26278  26281
              26284  26287  26290  26293  26296  26299  26302
              26305  26308  26311  26314  26317  26320  26323
              26326  26329  26332  26335  26338  26341  26344
              26347  26350  26353  26356  26359  26362  26365
              26368  26371  26374  26377  26380  29080
  a402  def     348    354
        use     354   2647   2658  16535  16563  16564  20655
              21678  26656  26672  26713  27492  27496  27554
              27571  29078
  a403  def     340
        use     341    348    384   2658  16537  20659  21680
              27496  27571
  a404  def     341
        use    2701   2772   2774   2784   2787
  a405  def     385
        use    2704
  a411  def     382
        use    8459  12897  12898  27689
  a412  def     383
        use     386   8459   8460  12897  27690  27709  29971
  a500  def     536
        use     571   1273   1285   1292   1300   1316   3575
               3696  15771  15914  16038  16284  16304  16400
              26524  26527  26537  26563
  a501  def     537
        use    3524   3656   7998  15762
  a502  def     538
        use   15816  15861  15991  16003  16292
  a503  def     539
        use    1302   5068   8000  15918  16015  16042  16073
              16247  16267
  a510  def     540
        use     572   8002
  a511  def     541
        use   16084  16104  16204  16222  16287  16323
  a512  def     542
  a513  def     543
  a514  def     544
        use   15818  15868  15870  16008  16171
  a515  def     545
  a516  def     546
  a517  def     547
        use    1274   3697
  a520  def     572
        use    3550   3552   3554   3556   3562   3566   3579
               3581   3583   3585  15923  15932  15937  15962
              15971
  a550  def     549
        use     571   4322   4342   4616   4835   4869   4871
               4873   4875   4877   4879   4889   4952   4954
               4956   4958   4960   4962   5009  10226  10228
              10230  10232  10234  10236  10276
  a551  def     550
        use    1381   1382   4836   4895   4943   9208  10217
              10280
  a552  def     551
        use    4839   4892  10203
  a553  def     552
        use    4841   4894  10147  10195  10205  10274
  a560  def     553
        use     573   4845
  a561  def     554
  a562  def     555
        use    4848
  a563  def     556
  a564  def     557
        use    4850
  a565  def     558
        use    8329
  a566  def     559
        use    4852
  a567  def     560
        use    4323   4854   8331
  a570  def     573
        use    8612   8618   8626   8629   8630   8632   8633
               8637   9125   9169   9172   9173   9176   9179
               9180   9183   9191   9192   9195   9201   9202
               9206   9210   9248  10021  10058  10061  10062
              10063  10064  10066  10067  10071  10074  10075
              10081  10082  10087  10090  10093  10094  10097
              10102  10103  10106  10108  10111  10194  10202
              10204  10260  10263  10273  10275  10278
  a580  def     561
        use     562   4868   4870   4872   4874   4876   4878
               4953   4955   4957   4959   4961   4963  10227
              10229  10231  10233  10235  10237
  a581  def     562
  b0    def    1024
        use    3268  26784
  b1    def    1059
        use    1220   1229   2842   2859   3222   3272   3306
               3480   5116   5169   5232   5274   5893   5921
               5956   5989   5997   6050   6061   6101   6138
               6192   6336   6565   6733   6746   6788   6790
               6857   6966   7046   7288   7300   7361   7401
               7417   7471   7493   7556   7620   7656   7660
               7765
  b2    def    1043
        use    1043   1044   1238   1240   1946   2052   2054
               2078   2081  25755  25755  26785  26786  39192
  b3    def    1045
        use    2876   5934   7930  11009  15967  16735  21630
              24381  24587  24629  26787  28766  31351  39197
  b4    def    1046
        use    4553   5699   5728   5884   5885   6012   7740
               7741   8958   8959  13820  14555  14685  14690
              14691  14890  14891  15047  15048  15107  15124
              15125  15223  15224  15663  15675  15676  15828
              16676  17940  18184  19961  20014  20015  20031
              20164  20351  20436  20605  20630  20642  20664
              20789  20842  20916  20951  21036  21253  21586
              26644  26681  26788  30520  30912  30913  31242
              31447  33395  34099  34685  35492  35493  37137
              37409  38973  40317  40646  40747  40906  40907
              41070  41071  41165  41174  41721  41763  42219
  b5    def    1047
        use    1125   4554   5713   5886   5912   6014   7742
               8960  11011  13833  13842  14568  14677  14692
              14892  15049  15118  15126  15225  15670  15677
              15822  16710  18187  19964  20016  20032  20352
              20603  20640  20954  25172  26692  26695  26701
              26789  27815  28661  29921  29950  30055  30082
              30521  30647  30914  31245  31502  35494  40908
              41072  41166  41745
  b6    def    1048
        use    4009   5151   5913   6321   6526   6535   6574
               6594   6889   6955   7017   7080   7792  13838
              15854  20929  20986  21719  22027  24185  24260
              24300  25177  26708  26790  27480  27523  27561
              27818  27953  28454  28662  29707  29808  29835
              29922  29945  29951  30041  30056  30083  30087
              30119  30652  30656  31000  31181  31223  31471
              31511  31594  36882  38999  39198
  b7    def    1049
        use    2857   2905   5935   6897   6964   7022   7085
              12016  16177  24242  26729  26791  27481  27536
              28767  29733  30120  31352  36883
  b8    def    1050
        use    1050   1051   1402   1403   1751   3214   3215
               3218   3221   4102   4103   4171   4172   5962
               5998   6028   6084   6085   6181   6182   6212
               6213   7089  10616  10617  16407  16408  21737
              21774  22508  23140  23272  23444  26699  26759
              26760  26763  26764  26792  26793  31179  31406
              31416  31417  31475  31497  31498
  b9    def    1065
        use    1212   1419   1902   2003   2019   2214   2226
               2861   3276   3399   6353  26636  28253  28268
  b10   def    1060
        use    2049
  b11   def    1061
        use   25827
  b12   def    1066
        use    3393  25819  26629  31045  31054  39238  42286
  b13   def    1063
        use    1927   1928   1933   1934   1997   4769   6406
               6420   6424   6428   7868  10800  10801  10880
              10905  10913  25842  27721  30224  31108  36167
  b14   def    1064
        use    1921   1922
  b15   def    1068
        use    6425   6426  10853  10854  10886  10896
  b16   def    3817
        use    3329   3886  26784
  b17   def    3886
        use    3389   3887
  b18   def    1027
        use    1518   2260   2463   2527   2573   8110  10908
              10985  11028  11032  11052  12020  12068  12120
              12172  12344  12357  12719  12833  12843  12878
              12882  12953  13057  13096  13112  13558  13611
              13616  13702  13812  13922  14580  14743  14747
              14751  14925  15072  15113  15147  15168  15182
              15715  15719  15723  15763  16005  16134  16326
              16447  16480  16482  17491  18043  18328  18673
              18706  18762  19290  19321  19383  20128  20209
              20348  20362  20390  20394  20416  20719  20762
              20815  20864  20873  20937  20963  20978  21007
              21019  21033  21039  21376  21491  21556  21738
              22016  22032  22103  22339  22514  22519  22544
              22578  22596  23129  23133  23162  23289  23437
              23439  23939  24463  24604  24918  24956  25013
              25321  25532
  b19   def    1028
        use    1516   2290   2326   2353   2379   2459   7859
               7862   8093  10653  10777  10834  10897  10959
              11202  11245  11284  11874  11892  11902  11954
              11959  12005  12015  12021  12111  12115  12225
              12351  12356  12652  12698  12867  12943  13056
              13117  13120  13123  13156  13242  13387  13391
              13448  13541  13758  13801  13825  13827  13844
              13931  14173  14291  14322  14561  14571  14604
              14699  14738  14759  14807  14897  14899  14911
              14939  14974  15002  15056  15241  15296  15358
              15371  15710  15731  15761  16132  16203  16230
              16266  16312  16394  16398  16445  16476  16501
              16680  16697  17201  17241  17243  17277  17376
              17378  17451  17498  17502  17518  18070  18241
              18245  18269  18271  18337  18426  18465  18467
              18509  18511  18514  18516  18519  18521  18739
              18804  18885  18893  19362  19422  19473  19482
              19564  20038  20131  20190  20667  20718  20764
              20860  20863  20936  20974  21006  21095  22060
              22075  22110  22164  22184  22480  22517  22581
              22822  24241  25018  25021
  b20   def    1029
        use    2253   2330   2335  10807  10922  11008  11012
              11039  11069  13215  13263  14200  14819  15368
              15375  15549  16417  16452  17386  17441  18562
              18891  19481  19511  25882
  b21   def    1030
        use    1630   2259   2287   2322   2350   2377   2552
               3634   3642   4619   5149   6156  10282  10611
              10647  14163  14170  14877  15302  15516  15523
              15872  16193  16488  21411  21413  21769  21771
              22378  22381  26794
  b22   def    1055
        use   26795  27463  27986  29524  29634  30682  30833
              30854  34705  34746  35651  40318  40734
  b23   def    1056
        use   26747  26796
  b24   def    1057
        use   26756  26797  27992  29482  29528  30868  34724
              34747  35653  40322  40739
  b25   def    1058
        use   27459  28527  28537  28546  28553  28771  29297
              29390  29670  34783  36541  40332  41005
  b26   def    1125
  b29   def   26580
        use   26604  26794  36066  39199  39203
  b30   def    1035
        use    7861   7864   8045   8106  26798
  b31   def    1036
        use    1310   2299   3350   3488  12936  18981  19635
  b32   def    2303
        use    1305   2297   8088   8091  11068
  b33   def   26581
        use   28157
  b35   def   26582
        use   28158  31180  31200  31609
  b36   def   26583
        use   26762  28159  39193  39195
  b37   def   26584
        use   28160  29836
  b38   def    1039
        use    1913   1916  26800
  b39   def   26585
        use   28161
  b40   def   26586
        use   28036  28100
  b42   def    1042
        use    1227   1246   6393
  b44   def   26587
  b45   def   26588
        use   28762  30281  30432  30435  30524  30525
  b46   def   26589
        use   28162
  b47   def   26590
        use   28197
  b48   def   26591
        use   28163  31384
  b49   def    2124
        use    3375   3397   7855
  b50   def    2123
        use    2113
  b51   def    2135
        use    1228   2217   2229   3269   3305  28256  28271
  b52   def    2148
        use    2133
  b53   def   26472
        use   26505  26784  26804
  b54   def   26505
        use   25784  26507  26805  31119  39018  39110  39110
              39118  39118
  b55   def    3891
        use    5292
  b56   def    3911
        use    4146
  b57   def    3929
        use    4028
  b58   def    1037
        use    1546  10173  14592
  b59   def    1038
        use    1675   2801   3391   3418   6366   6386  26801
  b60   def   26883
        use   39007  39007  39154  39159  39162  39167  39170
  b61   def   33121
        use   33132  33144  39008
  b62   def   33122
        use   39011
  b63   def   33123
        use   39014
  b65   def    1015
        use    1554   5330   5331   5440   6558   7263   7623
              10178  14598  26799
  b66   def    1016
  b67   def    1017
        use    3413   3422   6559   7264  10823  26802
  b68   def    1018
        use    3415   6560   7265  10832  26803
  b69   def    1019
        use    1019   1020   5019   5086   7684   7686   7695
              10919  10921
  b70   def    1021
        use    6419   6422  10914  10915
  b72   def    1022
        use   26804
  b73   def    1023
        use    3448  26805
  b74   def    1025
        use    1915
  b75   def    1026
        use    3446  10820  13486
  b76   def    1034
        use   39201
  b77   def   10600
        use   39165
  b79   def    1070
        use    3258  26806
  b80   def    3887
        use    1071  26823
  b81   def    1071
        use    3318
  b82   def    1072
        use    1244   1685   1691   3411   3420   3428   6375
               6376   6383   6384   6391
  b83   def    1073
        use    2011   3285   3286
  b84   def   10602
        use   10618  10625
  b85   def   10601
        use   10592  10639  10643
  b86   def   10590
        use   26820  39178
  b87   def   10594
        use   39157
  b89   def   18465
        use   26807
  b90   def    1159
        use    3373   3442
  b91   def    1160
        use    1231   3368   3460   5471   7854  42401  42410
  b92   def    1161
        use    3394  26628
  b93   def    1162
        use    3390
  b94   def    1163
        use    1899
  b95   def    1164
        use    1556   3449  10180  14600
  b96   def    1165
  b97   def    1166
        use   25771  25803  25811
  b98   def    1167
        use   25810
  b99   def    1168
        use   25822  25865
  b100  def    1170
        use    6740  25790  26630  27754
  b101  def    1031
        use   18535  18540  20148  20222  20290  20295  20334
              20387  20456  20513  20536  20743  20769  20819
              20883  21030  22638  22836  22868  22872  22888
              22900  23348  23391  23734  23806  23941  24010
              24132  24406  24409  24510  24513  24631  25059
              25069  25206  25333  25359  25362  25425  25574
              25580  25652  26807
  b102  def    1032
        use   26808
  b103  def    1033
  b104  def    1177
        use    2864
  b105  def    1178
        use    3403
  b106  def    1179
        use    3405
  b107  def    1180
        use    3407
  b108  def    1181
        use    1422   1905   2006   3279
  b110  def   38773
        use   39407  41666  41667  41668  41669  41670  41671
              41672  41673  41674  41675  41676
  b112  def   38774
        use   40501
  b113  def   38775
        use   40502
  b114  def   38776
        use   40503
  b115  def   38777
        use   40498
  b116  def   38778
        use   40499
  b117  def   38779
        use   40500
  b118  def   38780
        use   40279
  b119  def   38781
        use   40280
  b120  def   38782
        use   42302
  b121  def   38783
        use   40504
  b122  def   38784
        use   40505
  b123  def   38785
        use   40506
  b124  def   38786
        use   40507
  b125  def   38787
        use   40508
  b126  def   38788
  b127  def     997  10585  25710  26625  26884  33139  33198
              39288
        use   10579  25699  26602  26826  33131  33143  39242
              42311
  b128  def    2093
        use    2093  26810  26811  26812  26813  26814  26815
              26816  26817  26818  26819  26820  26821  26822
              26823
  b129  def   38789
        use   40510
  b130  def   38790
        use   40511
  b131  def   38791
        use   40512
  b132  def   38792
        use   40712
  b133  def   38793
        use   40509
  b134  def   38794
        use   40513
  b135  def   37738
        use   42306
  b136  def   38795
        use   41038
  b137  def   38796
        use   40514
  b138  def   38797
        use   40515
  b139  def   38798  38878
        use   41233
  b140  def   38799
        use   40516
  b141  def   38800
        use   42309
  b142  def   38801
        use   40716
  b143  def   38802
        use   40517
  b144  def   38803
        use   39465  40721
  b145  def   38804
        use   40623  40725
  b146  def   38805
        use   40624
  b147  def   38806
        use   40625
  b148  def   38807
        use   40722
  b149  def   38808
        use   40726
  b150  def   38809
        use   40518
  b152  def   38813
  b153  def   38814
        use   40519
  b200  def    1075
  b201  def    1076
        use    1121   5013   5077   5199
  b202  def    1077
  b203  def    1078
        use    1114   8137
  b204  def    1079
  b205  def    1080
  b206  def    1081
  b207  def    1082
  b208  def    1083
  b209  def    1084
  b210  def    1085
  b211  def    1086
  b212  def    1087
        use    1122  10177  14597  29494
  b213  def    1088
        use    1116
  b214  def    1089
        use    1124
  b215  def    1090
        use    1118
  b216  def    1091
        use    1123
  b217  def    1092
        use    1117
  b218  def    1093
        use    1315   4615  15770  16399
  b219  def    1094
        use    1299   3574
  b220  def    1095
        use    1119
  b221  def    1098
  b222  def    1099
        use    9178   9205  10092  10105  15421  15422  15933
              15938
  b223  def    1100
  b224  def    1101
  b225  def    1102
  b226  def    1103
  b227  def    1104
        use    1291   5008
  b228  def    1105
  b229  def    1106
        use    1120   8482   8927
  b230  def    1107
  b231  def    1108
  b232  def    1109
  b233  def    1110
  b234  def    1111
        use    1115
  b235  def    1096
  b236  def    1097
  b237  def    1112
  q0    def     770
  q4    def     771
        use    5129   5307  10079
  q6    def     772
        use    7883   8966  10143  14558  14705  14908  15055
              15143  15231  15920  16080  37414  37869
  q8    def     773
        use    3024   4007   5145   5853   6020   7884  10635
              14936  15859  15979  16044  16157  16688  31364
              31553  35162  37416  37870
  q9    def     774
        use    5640  15981  16158
  q14   def     775
        use   15977  37418  37872
  q18   def     776
        use    7886  14706  15959  16100  37420  37873
  q20   def     777
        use    3047   3075   4131   4611   4700   7887  14180
              14582  14701  16485  16682  26676  31377  42085
  q24   def     778
        use   16220
  q26   def     779
        use    1545   1547   3049   3076   3612   4132   4331
               4612   4701   7889  10167  14591  14594  16486
              16683  26678  31378  42086
  q28   def     780
        use    7890  15975  31363  31552  37422  37875
  q68   def     781
        use   14681  14696  15110  15130  15666  15681  15826
              16646  26674
     41 b. i30
     68 e.
  i0    def      42
        use      44     46     47     50
  i1    def      43
        use      44     48     50
  i2    def      56
        use      63
  i3    def      63
        use      67
  i10   def      50     51     52     53     54     55
        use      51     51     52     52     53     53     54
                 54     55     55     59
  i11   def      55
        use      55     59
  i12   def      54
        use      54     58
  i13   def      53
        use      53     58
  i14   def      52
        use      52     57
  i15   def      51
        use      51     57
  i20   def      50     51     52     53     54     55
        use      51     51     52     52     53     53     54
                 54     55     55     62
  i21   def      55
        use      55     62
  i22   def      54
        use      54     61
  i23   def      53
        use      53     61
  i24   def      52
        use      52     60
  i25   def      51
        use      51     60
    343 b. j0
    355 e.
  j0    def     344    345    348    353
        use     345    345    348    348    353    354    354
    408 b. j0
    458 e.
  j0    def     409    411    412    420    422    423    428
                433    435    437    438    439    441    442
                450
        use     411    411    412    412    420    420    422
                422    423    425    428    428    433    433
                435    435    437    438    439    439    441
                442    442    450    451    451    452    452
                452    453    453    454    454    454    454
                455    456    456    456    456    457    457
                457    457
    937 b. i30
    963 e.
  i0    def     938
        use     941    942    942    945
  i1    def     939
        use     942    943    945
  i2    def     951
        use     958
  i3    def     958
        use     962
  i10   def     945    946    947    948    949    950
        use     946    946    947    947    948    948    949
                949    950    950    954
  i11   def     950
        use     950    954
  i12   def     949
        use     949    953
  i13   def     948
        use     948    953
  i14   def     947
        use     947    952
  i15   def     946
        use     946    952
  i20   def     945    946    947    948    949    950
        use     946    946    947    947    948    948    949
                949    950    950    957
  i21   def     950
        use     950    957
  i22   def     949
        use     949    956
  i23   def     948
        use     948    956
  i24   def     947
        use     947    955
  i25   def     946
        use     946    955
    972 b. i3
    993 e.
  i0    def     974
        use     978
  i1    def     976
        use     985
  i2    def     989
        use     974    984
  i3    def     988
        use     981
    994 b. c200, d160, e70, f30, g70, l60, r28, v100
  26831 e.
  c0    def    3305
        use    2136
  c1    def    3256
        use    2137
  c2    def    3345
        use    3478  26472  26473  26474  26476
  c3    def    3327
        use    3271   3293   3323
  c4    def    3348
        use   26477
  c5    def    3349
        use   26478
  c6    def    3368
        use    3339  26479
  c7    def    3315
        use    3309
  c8    def    3335
        use    2130
  c10   def   18650
        use   18736  18737
  c11   def   18658
        use   18713  18736
  c12   def   18662
        use   18711  18733  18748
  c13   def   18666
        use   18701
  c24   def    1238
        use    1215   1247
  c25   def    3388
        use    1016
  c28   def    3479
        use    1202
  c29   def    1201
        use    2828   2831   3158   3161   3179   3182   3197
               3200   3216   3225   3242   3876   3884   5916
               5919   5922   5955   6015   6023   6027   6051
               6054   6117   6124   6128   6338   6417   6617
               6620   6625   6633   6660   6666   6671   6678
               6681   6691   6699   6819   6844   6883   6945
               6949   7261   7266   7271   7278   7398   7405
               7415   7421   7439   7449   7456   7474   7484
               7492   7497   7524   7549   7613   7747   7794
  c30   def    1515
        use   25897  25950  25981  25992  26024  26035  26057
              26073  26100  26120  26136  26219  26230
  c33   def    2330
        use    2447
  c34   def   12698
        use   25950  26100
  c35   def   10818
        use   25897
  c36   def   15760
        use   26057  26073  26120  26136
  c38   def   11308
  c39   def   11309
  c42   def    1397
        use    3713
  c43   def   18896
        use   25981  26024  26219
  c44   def   19514
        use   25992  26035  26230
  c45   def    1262
        use   26056  26072  26119  26135
  c46   def    1370
        use   26055  26071  26118  26134
  c47   def    3520
        use    1327   1345   1351
  c48   def    3686
        use    1328   1329   1331   1332   1335   1337   1339
               1340   1343   1347   1349
  c49   def    1417
        use   25897
  c50   def    1452
        use    1430
  c51   def    1444
        use   25882  25950  25981  25992  26024  26035  26100
              26219  26230
  c96   def    6156
        use    1029
  c98   def    2919
        use    2926  25741
  c99   def    1210
        use    1400   1429   1452   1976   2153   2181   2999
               3314   3352   3358   3507   3708   3714   4159
               4166   4175   4456   4484   4550   4971   5474
               5495   5841   5846   5848   5854   5986   6009
               6065   6106   6140   6229   6235   6238   6247
               6262   6268   6319   6339   6408   6429   6533
               6546   6572   6582   6861   7305   7309   7798
               7804   7820   8342   8688   8923   9290   9406
               9505   9600   9705   9812  10182  10187  10331
              26481
  d4    def    1674
        use    1241
  d5    def    1716
        use    1574   1740   3064   3089   3359   3706   4161
               4564   4571   4604   5075   5181   5985   6089
               6237   6269   6539   7691   7823   8317   8642
               9214   9258   9497   9789  10115  10156  10301
              10890  13116  14613  16308  16322  18111  21739
              21773  26582  26587
  d6    def    1756
        use    2328   4165   4567   4574   5023   5088   5183
               5246   6528   7698   8645   8662   9217   9237
               9261   9500   9792  10117  10133  10158  10303
              10971  11005  13119  17517  21535  21572  21748
              22062  22898  25020  26583
  d7    def    1899
        use    1953   1992   4768   6405   6418
  d8    def    1945
        use    1226   1243
  d9    def    1989
        use    2808   3310   3355   6524   6543
  d10   def    2043
        use    1497   2810   5167   5231   6532   6547   6593
  d11   def    1879
        use    5991   6826   6847   6872   6926   6998  15819
  d12   def    1832
        use    6328   6612   6655   7274   7752   7795
  d13   def    1748
        use   21775
  d14   def    2170
        use    5165   5229   6066   6107   6136
  d15   def    5119   8010
        use    1655   3676   4457   4485   4545   4625   6010
               8010   8142   8924   9407   9601   9706
  d16   def    5196
        use    5987
  d17   def    1799
        use    6518   6870   6924   6996
  d19   def    1844
        use    6169   6258
  d20   def    1859
        use    3290   3291   5175   5237
  d21   def    1861
        use    3290
  d30   def    5112
        use    6141
  d40   def    2801
        use    1860
  d41   def    2806
        use    1862
  d43   def    2823
        use    1871
  d44   def    2841
        use    1880
  d45   def    2850
        use    1887
  d53   def    2940
        use    2192
  d54   def    2949
        use    2195
  d55   def    2965
        use    2206
  d56   def    2971
        use    2209
  d58   def    2987
        use    1776
  d64   def    3131
        use    2171
  d65   def    3014
        use    1787
  d66   def    3154
        use    1798
  d67   def    3162
        use    1800
  d68   def    3212
        use    1833
  d69   def    3237
        use    1845
  d71   def    1886
        use   12014  16174  24240
  d72   def    1889
        use   12013  26588
  d73   def    1891
        use    2855  26586
  d74   def    2604
        use    4226  12117  25010
  d75   def    1786
        use    6323   6340  16192  16622  22590  24284
  d76   def    2635
        use    6856  14917  15247  26591
  d80   def    2213
        use   10600
  d81   def    2225
  d101  def    1870
        use    5490   5510   5840   5874   6282   7061
  d102  def    2742
        use    2358   4034   5578   5677   5755   5806   5889
               6294  15067  24293  26590
  d103  def    1823
        use    6044   6114
  d104  def    1974
        use    6058
  d105  def    1967
        use    6080
  d106  def    1738
        use    3111   5180   6190
  d107  def    1972
        use    6243
  d108  def    1775
        use    5241   5959   6001   6029   6088   6234   6267
               6599
  d109  def    1728
        use    5160   6060   6263  10286
  d110  def    1797
        use    5931   6075
  d111  def    1801
        use    6445   6451   6470   6474   6500   6504   6507
  d112  def    1812
        use    5454   6449   6460   6464   6493   6498   6504
  d113  def    2757
        use    2354   4015   5614   5624   5642   5693   5707
               5736   5741   5758   5779   5826   5845   6297
              15064
  d114  def    2695
        use    2665   5585
  d115  def    3164
        use    1802
  d116  def    3177
        use    1813
  d117  def    3193
        use    1824
  d118  def    2770
        use    6308
  d119  def    2782
        use    6292  26581
  d121  def    1464
        use    3709   6573   7712
  d123  def    2191
        use    4010   5871   5872  20930  20987  22028  24261
              24301  26584
  d124  def    2194
        use    3643   5851
  d125  def    2205
        use    5599   5630   5654   5667   5681   5718   5745
               5767   5783  16759  24401  26585
  d126  def    2208
        use    4013   5637   5754   5871  14755  15173  15328
              15727  15855  16202  20928  20982  21720  22025
              24296  26589
  d127  def    1491
        use    1475   6239
  d129  def    1535
        use    7287
  d130  def    1537
        use    6564
  d131  def    1572
        use    1465
  d132  def    1622
        use    3654   4538   4607  14818  16597
  d133  def    1636
        use    1591   1598   1999
  d140  def    5326
        use    3438
  d141  def    4001   8165   9828
        use    5284   8165   9828
  d142  def    4100   4793   8166   9829
        use    1410   3066   3091   4557   4793   5658   5859
               7756   7826   8166   8479   8918   9402   9596
               9701   9829
  d143  def    4207   8167   9830
        use    8167   8635   9830  10084
  d144  def    4312   8168   9831
        use    4969   8168   8340   8686   9288   9503   9810
               9831  10329
  d145  def    4392   8169   9832
        use    8169   8437   8857   9832
  d146  def    4419   8170   9833
        use    2594   8170   8439   8859   9833
  d147  def    4448   8171   9834
        use    8171   8445   8470   8483   8487   8865   8928
               8932   8980   9008   9834
  d148  def    4476   8172   9835
        use    8172   8414   9373   9664   9835
  d149  def    4530   8173   9836
        use    8173   8695   9295   9511   9818   9836  10337
  d150  def    4692   8174   9837  14135
        use    1277   1385   3700   4317   5002   5059   8174
               8305   8402   8560   8675   8773   9078   9277
               9355   9468   9561   9651   9760   9798   9837
               9975  10317  14135  16348  16375
  d151  def    4739   8175   9838  14136
        use    1278   1386   3701   4324   5003   5060   8175
               8312   8409   8567   8682   8780   9085   9284
               9362   9475   9568   9658   9767   9805   9838
               9982  10324  14136  16349  16376
  d152  def    4601   8176   9839
        use    4174   4970   8176   8687   9289   9504   9811
               9839  10186  10330
  d153  def    4824   8177   9840
        use    4967   8177   8338   8608   9122   9495   9787
               9840  10017
  d154  def    4938   8178   9841
        use    8178   8699   9299   9515   9822   9841  10341
  d155  def    4989   8179   9842
        use    4968   8179   8339   9842  10170  10328
  d156  def    5046   8180   9843  14137  15751
        use    3523   4618   8180   9843  14137  15751  16402
  e0    def    5451
        use    3818
  e1    def    6535
        use    3819
  e2    def    5487
        use    3820
  e3    def    5506
        use    3821
  e4    def    5507
        use    3822
  e5    def    5840
        use    3823
  e6    def    5871
        use    3824
  e7    def    5872
        use    3825
  e8    def    5925
        use    3826
  e9    def    6044
        use    3827
  e10   def    6075
        use    3828
  e11   def    6114
        use    3829
  e12   def    6160
        use    3830
  e13   def    6257
        use    3831
  e14   def    6808
        use    3832
  e15   def    6280
        use    3833
  e16   def    6281
        use    3834
  e17   def    6349
        use    3835
  e18   def    6405
        use    3836
  e19   def    6415
        use    3837
  e20   def    6486
        use    3838
  e21   def    6487
        use    3839
  e22   def    6488
        use    3840
  e23   def    6481
        use    3841
  e24   def    6509
        use    3842
  e25   def    6510
        use    3843
  e26   def    6511
        use    3844
  e27   def    6512
        use    3845
  e28   def    6478
        use    3846
  e29   def    6574
        use    3847
  e30   def    6596
        use    3848
  e31   def    6479
        use    3849
  e32   def    6513
        use    3850
  e33   def    6159
        use    3851
  e34   def    6514
        use    3852
  e35   def    6611
        use    3853
  e36   def    6515
        use    3854
  e37   def    6516
        use    3855
  e38   def    6483
        use    3856
  e39   def    6472
        use    3857
  e40   def    6517
        use    3858
  e41   def    6318
        use    3859
  e42   def    6654
        use    3860
  e43   def    6494
        use    3861
  e44   def    6499
        use    3862
  e45   def    6506
        use    3863
  e46   def    6501
        use    3864
  e47   def    6870
        use    3865
  e48   def    6924
        use    3866
  e49   def    6995
        use    3867
  e50   def    7254
        use    3868
  e51   def    6439
        use    3869
  e52   def    6453
        use    3870
  e53   def    6467
        use    3871
  e54   def    6468
        use    3872
  e55   def    6469
        use    3873
  e56   def    6452
        use    3874
  e57   def    6519
        use    3875
  e59   def    6473
        use    3877
  e60   def    6450
        use    3878
  e61   def    6444
        use    3879
  e62   def    5911
        use    3880
  e63   def    7061
        use    3881
  e64   def    7737
        use    3882
  e65   def    7791
        use    3883
  e67   def    7831
        use    3885
  f0    def   25716
        use   26787  26810
  f1    def   25721
        use   26568  26788  26811
  f2    def   25736
        use   26568  26789  26812
  f3    def   25739
        use   26790  26813
  f4    def   25741
        use   26791  26814
  f5    def   25750
        use   25828  26785  26786
  f7    def   26570
        use   26570  26572
  f8    def   26572
        use   26572  26574
  f9    def   26578
        use   26578  26792  26815
  f10   def   26578
        use   26598  26793  26816
  f11   def   26574
        use   26574  26576
  f12   def   26576
        use   26576  26578
  f13   def   25742
        use   26795  26817
  f14   def   25744
        use   26796  26818
  f15   def   25746
        use   26797  26819
  f16   def   26519
        use   26799  26802
  f17   def   26564
        use   26803
  f18   def   25903
        use   25720  26798
  f19   def   25907
        use   26778
  f20   def   26446
        use   26779
  f21   def   26448
        use   26469  26801  26821
  f22   def   26456
        use   26448
  f23   def   26464
        use   26800
  f24   def   26468
  f25   def   26507
        use   26806  26822
  g2    def   10705
        use   10661  10663  10664  10665  10666  10667  10669
              10670  10672  10673  10674  10675  10676  10677
              10678  10679  10680  10681  10682  10683  10684
              10687  10688  10691  10692  10693  10699  10701
              10702  11354  11354  11354  11354  25702  25702
              25702  25702  25702  25702  25702  25703  25703
              25703  25703  25703  25703  25703  25703  25703
              25703  25704  25704  25704  25704  25704  25704
              25705  25705  25705  25705  25705  25705  25705
              25706  25706  25706
  g3    def    2248
        use   10705  12796  18531
  g4    def    2249
        use   15362  16451  18553
  g5    def    2250
        use    2405   2414   2416  10798  11065  11186  11190
              11226  11895  14318  14565  14693  14708  14714
              14725  14885  14893  14898  14900  14906  14913
              14915  15005  15009  15044  15050  15057  15061
              15083  15089  15099  15102  15127  15226  15233
              15235  15242  15245  15300  15305  15538  15678
              15689  15700  16600  16601  17514  19965  19971
              20007  20017  20033  20037  20047  22053  22055
              24472
  g6    def    2251
        use    2355   2359   2383  10704  14919  14923  15065
              15068  15249  15253  18550
  g7    def    2252
        use   10795  11980  12633  14326  14614  14722  14768
              14979  15189  15195  15272  15309  15697  15740
              16600  20051
  g14   def    2349
        use   11797  11798  11871  11872  14191  14192  15532
              17372  20130  22039  22040
  g15   def    2376
        use   11165  11170  11797  11871  14191  15540  17372
              17373  18676  19293  22039
  g16   def    2398
        use   10775  11051  11244  11800  11882  14184  15530
              17375  19953
  g17   def    2316
        use   11066  11246  11963  18677  19294
  g18   def    2255
        use   11038  16011  16029  16054  16138  16296  16327
              17385  17440  17445  17494  21520  22705  24322
              24520  24607  25029  25442
  g19   def    2256
        use    2254   2493   8144  11333  12902  13813  16021
              16495  18048  18330  18807  19425  20399  22131
              22580  23152  23299  23457  24747  25546
  g20   def    2422
        use    2296   2490   8085   8119  10989  11064  11270
              11977  12632  12866  13806  14325  14610  14767
              14827  14978  15184  15194  15271  15739  16000
              16028  16053  16136  16208  16210  16295  16317
              16842  17384  17439  18039  18754  18783  18799
              19388  19417  20049  21654  22105  22120  22169
              23615  24336  24515  25026  25438
  g21   def    2423
        use    2284   2491   7979  11037  11271  11303  11315
              11349  12868  12870  13807  14822  16002  16137
              16205  16324  16831  18774  19377  19400  21515
              21655  22182  23618  24318  24338  24606  25440
  g22   def    2424
        use    2492  10794  11062  11317  11979  12872  12891
              13808  14825  15186  16004  16832  18756  18769
              19395  20050  21656  22107  22122  22176  23619
              24339  24517  25028  25441
  g23   def    2425
        use    2282   7981  11272  11299  11319  16007  16209
              16493  16834  16836  18758  18778  19379  19404
              21517  21658  21660  24320  24341  24343
  g24   def    2426
        use    2280   7983  11332  12875  15188  16009  18798
              18800  19416  19418  21519  22109  22124  24519
              24702
  g25   def    2445
        use   11336  18811  19429
  g26   def    2488
        use    2477  10910  14201  14820  15550  22347
  g27   def    2489
  g28   def    2491
        use   10992
  g29   def    2431
        use    2274   7975
  g30   def    2433
        use    2276   7977
  g31   def    2503
        use   14204  15553  20385  22680
  g32   def    2526
        use   16481  22516
  g34   def    2572
        use   14197  15546  20383  22678  24502  25354
  g37   def    2592
  g40   def    2427
  g41   def    2428
  g42   def    2429
  g48   def    1114
        use    3663   4278   8628   8892   9171   9383   9580
               9674  10073  12348  14212  14824  15559  18724
              18772  19340  19398  20673  21000
  g49   def    1115
        use    3423   6555   8486   8931  10988  11973  12914
              13802
  g50   def    1116
        use    2410   2411   5272   5273   6713   6714   7002
               7097  10633  11809  12209  12347  13913  18283
              19958  19969  20287  20792  21353  21375  22049
              22050  22207  22473  22512  22668  23271  23434
              23461  23994  24045  24671
  g51   def    1117
        use   12950
  g52   def    1118
  g53   def    1119
        use   22635  23650
  g62   def    1120
        use   11975  25025
  g63   def    1121
        use   22672
  g64   def    2458
        use    2334   2446  12910
  g65   def    1122
  g66   def    7852
        use    1036
  g67   def    1123
  g68   def    1124
  g70   def   25699
        use   10585
  l36   def    3963
        use   14883  14904  16656
  l37   def    3964
        use   15857
  l38   def    3965
        use    8419   8798  14177  15060  15179  15995  16252
              16355
  l39   def    3966
        use   14884  14905  14931
  l40   def    3967
        use    8800  16088
  l45   def    3970
        use   16147
  l46   def    3971
        use   16108
  l47   def    3972
  l50   def    1126
  l53   def    1127
        use    1264   1372   3687   4314   4990   5047   8302
               8399   8557   8671   8770   9075   9274   9352
               9465   9558   9648   9757   9795   9972  10314
              16336  16363
  r0    def    2179
        use    5572   5582   5600   5631   5641   5649   5668
               5682   5719   5746   5768   5784   5810   5828
               5894   6290   6307   6363   6394   6747   6789
               6899   6967   7047   7102   7768
  r1    def    2178
        use    5615   5625   5643   5694   5708   5737   5742
               5759   5780   5827   6298   6351   6442   7028
               7030
  r2    def    2177
        use    5544   5552   5557   5561   5573   5596   5622
               5678   5756   5807   5890   6305   6364   6382
               6710   7072   7083
  r3    def    2176
        use    5511   5521   5522   5524   5527   5528   5531
               5532   5533   5534   5535   5536   5537   5538
               5539   5540   5541   5542   5543   5545   5546
               5549   5550   5551   5553   5579   5875   5881
               6283   6288   6295   6636   6704   6791   6827
               6831   6873   6877   6880   6927   6933   6936
               6939   6999   7009   7012   7015   7020   7062
               7067   7069   7772
  r4    def    2175
        use    5588   5589   5887   6557   6561   6848   6853
               7100   7743
  r5    def    2174
  r28   def    2180
        use    5493
    996 b. j0
  10582 e.
  j0    def   10579
        use     997
   1184 b. j0
   1193 e.
  j0    def    1185   1185   1186   1187   1188   1189   1190
               1191
        use    1185   1186   1186   1187   1187   1188   1188
               1189   1189   1190   1190   1191   1191   1192
   1209 b. i2, j0
   1250 e.
  i0    def    1226
        use    1222
   1211 b. h1
   1219 e.
  h0    def    1213
        use    1216
   1261 b. i10, j21
   1358 e.
  i6    def    1356
        use    1289   1321
  j1    def    1298
        use    1294
  j2    def    1314
        use    1304   1308
  j3    def    1324
        use    1322
   1264 b. f4
   1280 e.
  f0    def    1270
        use    1267
  f1    def    1271
        use    1265
  f2    def    1279
        use    1272   1276
  f3    def    1277
        use    1268
  f4    def    1278
        use    1275
   1369 b. j5
   1412 e.
  j2    def    1408
        use    1404
   1372 b. f4
   1388 e.
  f0    def    1378
        use    1375
  f1    def    1379
        use    1373
  f2    def    1387
        use    1380   1384
  f3    def    1385
        use    1376
  f4    def    1386
        use    1383
   1418 b. h0
   1426 e.
  h0    def    1420
        use    1423
   1463 b. h10
   1484 e.
  h0    def    1483
        use    1464   1472   1482
   1532 b. i5, j5
   1560 e.
  i1    def    1533
        use    1542   1550
  j1    def    1551
        use    1541
   1583 b. h10, i10
   1606 e.
  h0    def    1604
        use    1603
  h1    def    1605
        use    1584   1592   1599
  i0    def    1595
        use    1589
  i1    def    1601
        use    1587   1597
   1635 b. i10
   1657 e.
  i0    def    1637
        use    1650   1654
  i1    def    1655
        use    1653
  i3    def    1656
        use    1636   1643
   1673 b. i5, j5
   1708 e.
  i3    def    1707
        use    1680   1704
  j1    def    1690
        use    1686
  j2    def    1693
        use    1697
  j3    def    1698
        use    1689
   1715 b. i1
   1764 e.
  i0    def    1763
        use    1716   1722   1756   1762
   1898 b. i9, j4
   2088 e.
  i0    def    2032
        use    2043   2064
  i1    def    2053
        use    2057
  i2    def    2058
        use    2055   2087
  i3    def    2071
        use    2050
  i4    def    2080
        use    2084
  i5    def    2086
        use    2082
  i6    def    1919
        use    1911
  i8    def    1932
        use    1930
  i9    def    1936
        use    1912   1917   1924   1994
  j0    def    2028
        use    1945   1963   2027
  j1    def    2029
        use    1990   2015
  j2    def    2030
        use    1991   2012
  j4    def    1916
        use    1918
   1901 b. h1
   1909 e.
  h0    def    1903
        use    1906
   2002 b. h1
   2010 e.
  h0    def    2004
        use    2007
   2018 b. h1
   2026 e.
  h0    def    2020
        use    2023
   2212 b. h0
   2235 e.
  h0    def    2215   2227
        use    2218   2230
   2247 b. i10
   2337 e.
  i0    def    2270
        use    2263   2266
  i1    def    2296
        use    2294
  i2    def    2301
  i3    def    2302
        use    2258   2286   2317   2336
  i4    def    2326
        use    2320
  i5    def    2304
        use    2298
   2348 b. i5
   2365 e.
  i0    def    2360
        use    2356
  i2    def    2363
        use    2361
  i3    def    2364
        use    2352   2362
   2374 b. i24
   2384 e.
   2397 b. i24
   2420 e.
  i0    def    2419
        use    2398   2407   2418
   2444 b. i24
   2450 e.
  i2    def    2449
        use    2445   2448
   2457 b. i24
   2480 e.
  i0    def    2459
        use    2478
  i1    def    2477
        use    2473
  i2    def    2479
        use    2458   2462   2475
   2487 b. i24
   2494 e.
   2502 b. i24
   2511 e.
  i0    def    2510
        use    2503   2509
   2525 b. i24
   2564 e.
  i0    def    2536
        use    2549
  i2    def    2562
  i3    def    2563
        use    2526   2532   2537   2540   2561
   2571 b. i24
   2583 e.
  i0    def    2582
        use    2572   2576   2579   2580
   2603 b. i8
   2617 e.
  i0    def    2608
        use    2614
  i1    def    2612
        use    2609
  i2    def    2613
        use    2607
  i3    def    2616
        use    2604   2615
   2634 b. i5, j5
   2681 e.
  i0    def    2648
        use    2659
  i1    def    2657
        use    2651   2654
  i2    def    2660
        use    2656
  i3    def    2643
        use    2639
  i4    def    2673
        use    2666
  i5    def    2675
        use    2663
  j0    def    2676
        use    2648   2660   2664   2670   2674
  j1    def    2677
        use    2635   2675
  j3    def    2678
  j4    def    2679
  j5    def    2680
        use    2669
   2694 b. i10, j10
   2735 e.
  i1    def    2730
        use    2697   2726
  i2    def    2731
        use    2703
  i3    def    2732
        use    2696   2724
  i4    def    2733
        use    2699   2712   2715
  i5    def    2734
        use    2702   2711
  j0    def    2707
        use    2722
  j1    def    2717
        use    2713
  j2    def    2719
        use    2710   2716
   2800 b. i10
   2814 e.
  i3    def    2813
        use    2806   2811
   2822 b. i25
   2927 e.
  i0    def    2910
        use    2903
  i1    def    2911
        use    2824   2841
  i2    def    2912
        use    2904
  i3    def    2913
        use    2850   2906   2907
  i4    def    2852
        use    2853
  i5    def    2914
        use    2892
  i6    def    2915
        use    2854   2895
  i7    def    2916
        use    2891
  i8    def    2917
        use    2856   2894   2897
  i9    def    2909
        use    2858   2898
  i10   def    2920
  i11   def    2921
        use    2875   2878
  i12   def    2922
  i13   def    2923
        use    2871   2884
  i14   def    2844
        use    2833
  i15   def    2878
        use    2887   2893   2896   2901
  i16   def    2879
        use    2883
  i17   def    2880
        use    2877
  i18   def    2902
        use    2874   2889
  i19   def    2924
        use    2899
  i20   def    2925
        use    2851   2900
  i21   def    2926
        use    2888
   2860 b. h1
   2868 e.
  h0    def    2862
        use    2865
   2986 b. i0
   3001 e.
  i0    def    2997
        use    2990
   3013 b. i10, j10
   3120 e.
  i0    def    3116
  i1    def    3117
        use    3016   3113
  i3    def    3118
        use    3015   3114
  j0    def    3047
        use    3053
  j1    def    3055
        use    3048   3050
  j2    def    3071
        use    3045
  j3    def    3096
        use    3074
  j4    def    3104
        use    3101
  j5    def    3111
        use    3037   3099   3105
  j6    def    3113
        use    3019   3058   3063   3078   3082   3088
   3130 b. i0
   3145 e.
  i0    def    3143
        use    3132   3141
   3211 b. i0
   3226 e.
   3236 b. i0
   3246 e.
  i0    def    3240
        use    3244
   3255 b. i3
   3296 e.
  i1    def    3294
  i2    def    3295
        use    3284   3292
  i3    def    3267
        use    3263
   3275 b. h1
   3283 e.
  h0    def    3277
        use    3280
   3367 b. h10, i10
   3463 e.
  h0    def    3375
        use    3369   3371   3443   3458
  i0    def    3449
        use    3452
  i1    def    3439
        use    3436
  i2    def    3434
        use    3416
  i3    def    3431
        use    3401
  i5    def    3414
        use    3419   3429
   3471 b. j10
   3508 e.
  j0    def    3473
        use    3492
  j1    def    3474
        use    3494
  j2    def    3475
        use    3496
  j3    def    3476
        use    3477   3501
  j4    def    3478
        use    3486
   3519 b. i10, j30
   3715 e.
  i1    def    3682
        use    3521   3615   3645   3655   3710
  i6    def    3681
        use    3525   3528
  j4    def    3569
        use    3565
  j5    def    3535
        use    3533
  j6    def    3541
        use    3536
  j7    def    3560
        use    3546
  j8    def    3587
        use    3577
  j9    def    3588
        use    3559
  j15   def    3592
        use    3538   3539
  j18   def    3605
        use    3589   3602
  j19   def    3638
        use    3633
  j20   def    3650
        use    3629   3640
  j22   def    3667
        use    3653   3661
  j23   def    3675
        use    3671
  j25   def    3678
        use    3625
  j30   def    3710
        use    3679
   3687 b. f4
   3703 e.
  f0    def    3693
        use    3690
  f1    def    3694
        use    3688
  f2    def    3702
        use    3695   3699
  f3    def    3700
        use    3691
  f4    def    3701
        use    3698
   3787 b. i30
   3813 e.
  i0    def    3788
        use    3791   3792   3792   3795
  i1    def    3789
        use    3792   3793   3795
  i2    def    3801
        use    3808
  i3    def    3808
        use    3812
  i10   def    3795   3796   3797   3798   3799   3800
        use    3796   3796   3797   3797   3798   3798   3799
               3799   3800   3800   3804
  i11   def    3800
        use    3800   3804
  i12   def    3799
        use    3799   3803
  i13   def    3798
        use    3798   3803
  i14   def    3797
        use    3797   3802
  i15   def    3796
        use    3796   3802
  i20   def    3795   3796   3797   3798   3799   3800
        use    3796   3796   3797   3797   3798   3798   3799
               3799   3800   3800   3807
  i21   def    3800
        use    3800   3807
  i22   def    3799
        use    3799   3806
  i23   def    3798
        use    3798   3806
  i24   def    3797
        use    3797   3805
  i25   def    3796
        use    3796   3805
   3815 b. h30
  10574 e.
  h1    def    8301
        use    3913
  h4    def    8398
        use    3896
  h5    def    8556
        use    3915
  h6    def    8768
        use    3897
  h7    def    9074
        use    3916
  h8    def    9351
        use    3898
  h9    def    9464
        use    3917
  h14   def    9556
        use    3901
  h15   def    9754
        use    3920
  h18   def    9647
        use    3903
  h19   def    9755
        use    3922
  h21   def    9970
        use    3923
  h27   def    9971
        use    3926
  h28   def    9557
        use    3908
  h29   def    9756
        use    3927
   4000 b. i5, j5
   4060 e.
  i1    def    4055
        use    4002   4041
  i2    def    4056
        use    4011   4022   4045
  i3    def    4057
        use    4003   4037   4040
  i4    def    4058
  i5    def    4059
        use    4019   4033
  j0    def    4014
        use    4008
  j1    def    4037
        use    4017
  j2    def    4040
        use    4031   4035   4048   4052
  j3    def    4028
        use    4025
  j4    def    4044
        use    4016
  j5    def    4033
        use    4053
   4099 b. i5, j10
   4180 e.
  i0    def    4178
        use    4113   4125   4144   4155
  i4    def    4179
        use    4101   4137
  j0    def    4112
        use    4106
  j1    def    4130
        use    4120   4135
  j2    def    4137
        use    4133
  j3    def    4147
        use    4142   4145
  j4    def    4121
        use    4104
  j5    def    4168
        use    4150
  j6    def    4146
        use    4139
   4206 b. i10, j10
   4295 e.
  i0    def    4285
        use    4274   4276
  i1    def    4286
        use    4209   4223   4282
  i2    def    4287
        use    4233   4245   4268
  i3    def    4288
        use    4208   4283
  i4    def    4289
        use    4220   4249
  i5    def    4290
        use    4215   4232
  i6    def    4291
        use    4248   4253   4261   4262   4264   4270
  i7    def    4292
        use    4244   4255   4265   4266
  i8    def    4293
        use    4211
  j0    def    4243
        use    4239
  j1    def    4251
        use    4259
  j2    def    4261
        use    4254   4256
   4311 b. i10, j10
   4376 e.
  i2    def    4374
  i3    def    4375
        use    4327   4364   4370
  j1    def    4367
        use    4335
  j2    def    4363
        use    4358
  j3    def    4355
        use    4351
  j4    def    4352
        use    4349
   4314 b. f2
   4326 e.
  f0    def    4319
        use    4316
  f1    def    4320
        use    4315
  f2    def    4325
        use    4321
   4391 b. i1, j1
   4402 e.
  i0    def    4401
        use    4393   4399
   4418 b. i1, j1
   4432 e.
  i0    def    4431
        use    4420   4425   4429
   4447 b. i1, j1
   4459 e.
   4475 b. i1, j1
   4488 e.
  i0    def    4487
        use    4477   4481
   4529 b. i10, j10
   4584 e.
  i0    def    4579
        use    4565   4572
  i1    def    4580
        use    4531   4547   4568   4575
  i2    def    4581
        use    4543
  i3    def    4582
        use    4532   4569   4576
  j2    def    4559
        use    4535
  j3    def    4570
        use    4561
   4600 b. i5, j5
   4633 e.
  i1    def    4629
        use    4626
  i2    def    4630
        use    4602   4608
  i3    def    4631
        use    4603   4627
  j1    def    4623
        use    4614
   4634 b. f12
   4791 e.
  f0    def    4668
  f1    def    4669
        use    4693   4713   4718   4781
  f2    def    4670
        use    4694
  f3    def    4671
        use    4697   4714   4719   4782
  f7    def    4673
        use    4706   4743
  f9    def    4674
        use    4712   4748   4765
   4691 b. i0, j2
   4725 e.
  i0    def    4723
        use    4695   4715   4720
  j0    def    4718
        use    4711
  j1    def    4699
        use    4704
  j2    def    4706
        use    4702
   4738 b. i6, j5
   4790 e.
  i0    def    4785
        use    4746   4772
  i1    def    4786
        use    4741   4745   4773
  i2    def    4787
  i3    def    4788
        use    4742   4783
  j0    def    4745
        use    4762
  j1    def    4753
  j2    def    4764
        use    4751
  j3    def    4773
        use    4779
  j4    def    4781
        use    4774
  j5    def    4758
   4823 b. i10, j10
   4911 e.
  i1    def    4907
        use    4825
  i2    def    4908
  i3    def    4909
        use    4826   4905
  i4    def    4910
        use    4833   4856
  j2    def    4860
        use    4832
  j3    def    4865
        use    4862
  j4    def    4885
        use    4867
  j8    def    4899
        use    4859   4864   4884
  j9    def    4904
        use    4858   4896
   4931 b. i10, j10
   4973 e.
  i0    def    4933
        use    4939   4966
  i6    def    4936
  j2    def    4965
        use    4942
   4988 b. i3, j2
   5029 e.
  i1    def    5026
  i2    def    5027
        use    5007   5024
  i3    def    5028
        use    5006   5025
  j0    def    5024
        use    5011   5016
   4990 b. f4
   5005 e.
  f0    def    4995
        use    4992
  f1    def    4996
        use    4991
  f2    def    5004
        use    4997   5001
  f3    def    5002
        use    4993
  f4    def    5003
        use    5000
   5045 b. i3, j2
   5096 e.
  i1    def    5093
        use    5063   5090
  i3    def    5095
        use    5064   5089
  j0    def    5089
        use    5067   5072   5083
   5047 b. f4
   5062 e.
  f0    def    5052
        use    5049
  f1    def    5053
        use    5048
  f2    def    5061
        use    5054   5058
  f3    def    5059
        use    5050
  f4    def    5060
        use    5057
   5097 b. i24
   5315 e.
  i0    def    5098
  i1    def    5099
        use    5113   5119   5177   5196   5243
  i2    def    5100
        use    5227   5240
  i3    def    5101
        use    5114   5120   5178   5197   5244
  i4    def    5295
        use    5285
  i5    def    5294
        use    5277   5279
  i7    def    5102
        use    5117   5123   5168
  i8    def    5103
        use    5150   5161   5166   5171   5212   5224   5230
               5233   5239
  i9    def    5124
        use    5118
  i10   def    5166
        use    5190
  i11   def    5177
        use    5170   5174   5179   5186   5248   5251
  i12   def    5179
        use    5143
  i13   def    5181
        use    5158
  i14   def    5230
        use    5254
  i15   def    5245
        use    5215
  i16   def    5255
        use    5209
  i17   def    5239
        use    5236
  i18   def    5267
        use    5211
  i19   def    5284
        use    5270
  i20   def    5122
        use    5257   5297
  i21   def    5306
        use    5203
  i22   def    5138
        use    5130
  i23   def    5104
        use    5115   5121   5139   5256   5296
  i24   def    5314
        use    5309   5313
   5325 b. c10, d40, i50, r20
   5442 e.
  c0    def    5409
        use    5400
  d0    def    5394
        use    5357
  d1    def    5395
        use    5370
  d10   def    5397
        use    5356   5366
  d11   def    5399
        use    5329
  d12   def    5405
        use    5401
  d13   def    5407
        use    5354   5359   5402
  d20   def    5410
        use    5410
  d21   def    5411
        use    5338   5340   5346
  d22   def    5416
        use    5347   5412
  d23   def    5418
        use    5355   5413   5426
  d30   def    5420
        use    5332   5439
  d31   def    5421
        use    5349   5379   5381
  d32   def    5422
        use    5326   5441
  i0    def    5329
  i10   def    5337
        use    5431
  i11   def    5340
        use    5429
  i15   def    5353
        use    5383   5435
  i16   def    5358
        use    5363
  i17   def    5366
  i18   def    5371
        use    5374
  i20   def    5379
        use    5436
  i30   def    5426
        use    5360
  i40   def    5439
        use    5334   5433
  r0    def    5389
        use    5428
  r1    def    5390
        use    5430
  r2    def    5391
        use    5432
  r3    def    5392
        use    5434
  r10   def    5388
        use    5410
  r20   def    5386
        use    5397   5399
   5450 b. i2
   5479 e.
  i1    def    5476
        use    5464
   5486 b. i0, j0
   5497 e.
  i0    def    5496
        use    5491
  j0    def    5494
        use    5489
   5505 b. h90, i10, j21
   5832 e.
  h0    def    5567
        use    5516
  h2    def    5568
        use    5517
  h4    def    5576
        use    5518
  h6    def    5603
        use    5519
  h8    def    5635
        use    5520
  h18   def    5672
        use    5525
  h20   def    5662
        use    5526
  h26   def    5663
        use    5529
  h28   def    5673
        use    5523   5530
  h62   def    5685
        use    5547
  h64   def    5569
        use    5548
  h76   def    5674
        use    5554
  h78   def    5675
        use    5555
  h80   def    5723
        use    5556
  h84   def    5750
        use    5558
  h86   def    5772
        use    5559
  h88   def    5773
        use    5560
  i1    def    5787
        use    5811   5825   5829
  i2    def    5788
        use    5577   5580   5636   5647   5751   5763   5805
               5808
  i3    def    5789
        use    5607   5629   5689   5705   5717   5727   5744
               5777   5782
  i4    def    5790
        use    5700   5711   5734   5739
  j1    def    5591
        use    5586
  j2    def    5598
        use    5587
  j3    def    5611
        use    5616   5617
  j4    def    5620
        use    5610
  j5    def    5629
        use    5613
  j7    def    5698
        use    5692
  j8    def    5700
        use    5714
  j9    def    5711
        use    5706
  j10   def    5716
        use    5696
  j11   def    5730
        use    5732
  j20   def    5804
        use    5605   5665   5687   5725   5775
  j21   def    5824
        use    5584   5606   5653   5666   5680   5688   5726
               5776
   5839 b. i5
   5861 e.
   5870 b. i0
   5896 e.
  i0    def    5895
        use    5873   5892
   5909 b. i15
   6036 e.
  i0    def    5950
        use    5996
  i1    def    5989
        use    5936   5941   5947
  i2    def    5997
        use    5943   5992
  i3    def    6012
        use    5930   6003
  i4    def    5984
  i5    def    6014
        use    6018
  i6    def    5931
  i7    def    6035
        use    5926   5950   5964   6004
  i8    def    5969
        use    5966
  i9    def    5971
        use    5968   6034
  i10   def    5956
        use    5952
   6043 b. i5
   6067 e.
  i0    def    6053
        use    6048
  i1    def    6055
        use    6052
   6074 b. i8
   6142 e.
  i2    def    6078
        use    6083   6086
  i3    def    6084
        use    6082
   6155 b. i20
   6249 e.
  i0    def    6248
        use    6161   6220   6241
  i3    def    6166
        use    6170
  i4    def    6169
        use    6164
  i5    def    6175
        use    6180   6183
  i6    def    6178
        use    6168
  i7    def    6194
        use    6186
  i8    def    6197
        use    6193
  i9    def    6201
        use    6177   6233
  i10   def    6227
        use    6222
  i12   def    6236
        use    6214
  i13   def    6241
        use    6209
   6256 b. i0
   6270 e.
  i0    def    6264
        use    6261
   6279 b. i1, j1
   6311 e.
  j1    def    6307
        use    6299
   6348 b. i3, j3
   6398 e.
  i1    def    6395
        use    6390
  i2    def    6396
        use    6367   6373
  i3    def    6397
        use    6370
  j0    def    6369
        use    6374
  j1    def    6365
        use    6356
   6352 b. h1
   6360 e.
  h0    def    6354
        use    6357
   6438 b. i20
   6799 e.
  i0    def    6484
        use    6522
  i2    def    6518
        use    6492   6499   6576   6603
  i3    def    6522
        use    6448   6456   6471   6522   6638   6735
  i4    def    6554
        use    6537
  i5    def    6580
        use    6595
  i6    def    6522
        use    6454
  i7    def    6466
        use    6457   6465   6540   6544
  i8    def    6749
        use    6742
  i9    def    6762
        use    6780
  i10   def    6757
        use    6751   6786
  i11   def    6779
        use    6760   6780
  i12   def    6780
        use    6759   6781   6782   6784
  i13   def    6790
        use    6718   6721
  i14   def    6455
        use    6443
   6604 b. j10
   6798 e.
  j0    def    6792
        use    6667   6711
  j1    def    6793
        use    6672   6715
  j2    def    6794
        use    6727
  j3    def    6795
        use    6683   6723   6724
  j4    def    6796
        use    6663   6729
  j5    def    6797
        use    6758   6783
  j10   def    6653
        use    6734
   6807 b. i2, j5
   6863 e.
  i1    def    6862
        use    6832   6855
  j1    def    6832
        use    6824
  j2    def    6820
        use    6814
  j3    def    6845
        use    6839
   6869 b. i10, j10
   6916 e.
  i0    def    6913
        use    6875   6891
  i1    def    6914
        use    6885   6902
  i2    def    6915
  j0    def    6890
        use    6898
  j1    def    6891
        use    6895
  j2    def    6896
        use    6912
  j3    def    6900
        use    6892
   6923 b. i10, j10
   6987 e.
  i0    def    6984
        use    6929   6957
  i1    def    6985
        use    6954   6969   6976   6977   6980   6981
  i2    def    6986
        use    6931
  j0    def    6956
        use    6965
  j1    def    6957
        use    6961
  j2    def    6962
        use    6974   6983
  j3    def    6968
        use    6958
   6994 b. i10, j10
   7049 e.
  i0    def    7048
        use    7007   7025   7026   7035   7038   7041   7044
  j1    def    7018
        use    7023
  j2    def    7036
        use    7034
  j3    def    7039
        use    7037
   7060 b. i10, j10
   7105 e.
  i0    def    7103
        use    7078   7087
  i1    def    7104
        use    7064   7092   7096
  j1    def    7081
        use    7086
   7201 b. f20, h40, i60, j50
   7713 e.
  f0    def    7313
        use    7203
  f1    def    7328
        use    7204
  f2    def    7320
        use    7205
  f3    def    7316
        use    7206
  f10   def    7461
        use    7209
  f11   def    7471
        use    7210
  f12   def    7481
        use    7211
  f13   def    7490
        use    7212
  f14   def    7501
        use    7213
  h0    def    7203
        use    7207   7291
  h1    def    7209
        use    7214   7455
  h5    def    7215
        use    7269   7286   7391   7481   7610
  h10   def    7216
        use    7465   7571
  h11   def    7217
        use    7329   7475
  h15   def    7218
        use    7461
  h16   def    7219
        use    7331   7381   7462
  h17   def    7220
        use    7382   7464   7574
  h20   def    7221
        use    7321   7624
  h21   def    7222
        use    7395   7414
  h22   def    7223
        use    7416   7507
  h23   def    7224
        use    7330   7517   7518
  h25   def    7225
        use    7262   7622
  h26   def    7226
        use    7373   7374
  h27   def    7227
        use    7442
  h30   def    7228
        use    7427
  h36   def    7229
        use    7547
  h40   def    7230
        use    7316
  i0    def    7299
        use    7313   7687   7699   7711
  i1    def    7298
        use    7347
  i2    def    7297
        use    7578
  i3    def    7296
        use    7463
  i6    def    7290
        use    7285
  i10   def    7390
        use    7334   7350   7355   7362   7376   7379
  i15   def    7413
        use    7558
  i16   def    7417
        use    7516
  i20   def    7506
        use    7467   7477   7486   7496
  i30   def    7513
        use    7428
  i31   def    7522
        use    7520
  i32   def    7525
        use    7521
  i33   def    7539
        use    7535
  i40   def    7582
        use    7573
  i50   def    7610
        use    7325
  i51   def    7685
        use    7689
  i52   def    7692
        use    7678
  i53   def    7676
        use    7629
  i54   def    7633
        use    7627
  i55   def    7708
        use    7665
  i56   def    7663
        use    7659
  j0    def    7207
        use    7277
  j1    def    7214
        use    7454
  j11   def    7233
        use    7234   7235   7236
  j12   def    7234
        use    7425   7453
  j13   def    7235
        use    7446
  j14   def    7236
        use    7423
  j20   def    7240
        use    7241   7413
  j21   def    7241
        use    7242   7243   7244
  j22   def    7242
        use    7426   7514
  j23   def    7243
        use    7508   7537
  j24   def    7244
        use    7424   7564
  j30   def    7245
        use    7436
  j31   def    7246
        use    7437   7438
  j32   def    7248
        use    7230   7548
  j33   def    7249
        use    7557
  j34   def    7247
        use    7534
  j35   def    7251
        use    7519
  j36   def    7252
        use    7229   7523
  j37   def    7250
        use    7515
  j40   def    7253
        use    7635
   7736 b. i1, j1
   7775 e.
  j0    def    7758
        use    7751
   7790 b. j10
   7828 e.
  j1    def    7809
        use    7815
  j2    def    7817
        use    7808
   7851 b. i17, j22
   8162 e.
  i0    def    8150
        use    7852   7870   8094
  i1    def    8152
        use    7853   7996   8095
  i2    def    8153
        use    7924
  i3    def    8154
        use    7860   8092
  i4    def    8155
        use    7858   8051   8083   8118   8143
  i5    def    8156
        use    8055   8063   8065
  i6    def    8157
        use    8071
  i7    def    8158
  i8    def    8159
        use    8070
  i9    def    8160
        use    8062   8076   8077   8082
  i10   def    8161
        use    8048   8049   8056   8066   8072
  i13   def    8038
        use    8021   8032
  i15   def    8040
        use    8022   8027   8029   8033
  i16   def    8124
        use    8105   8116
  i17   def    8125
        use    8134   8146
  j0    def    7900
        use    7874
  j1    def    7916
        use    7876
  j2    def    7936
        use    7931
  j3    def    7940
        use    7879
  j5    def    7968
        use    7882
  j6    def    7989
        use    7885   7888   7891
  j9    def    8021
        use    7907   7963   8005   8064
  j10   def    8023
        use    8031
  j11   def    8082
        use    8075
  j12   def    8069
        use    8053
  j13   def    8045
        use    7913   7937   7965   7986   8007
  j14   def    8076
        use    8067
  j15   def    8092
        use    7892   8081   8109
  j17   def    8087
  j18   def    8105
        use    7863   8089
  j19   def    8106
        use    8121
  j20   def    8117
        use    8113
  j22   def    8134
        use    8086   8120
   8295 b. i5, j5
   8344 e.
  i0    def    8297
        use    8320   8336   8337
  j1    def    8326
        use    8323
  j2    def    8334
        use    8325
   8302 b. f2
   8314 e.
  f0    def    8307
        use    8304
  f1    def    8308
        use    8303
  f2    def    8313
        use    8309
   8397 b. i10, j10
   8493 e.
  i0    def    8491
        use    8413
  j0    def    8426
  j1    def    8450
        use    8442
  j3    def    8467
        use    8424
  j4    def    8478
        use    8465
  j5    def    8481
        use    8429
  j6    def    8485
        use    8420
   8399 b. f2
   8411 e.
  f0    def    8404
        use    8401
  f1    def    8405
        use    8400
  f2    def    8410
        use    8406
   8546 b. i10, j10
   8702 e.
  i0    def    8548
        use    8580   8590   8601   8606   8643   8694   8698
  i1    def    8551
        use    8571   8607   8636   8647   8664   8673   8693
  i2    def    8552
        use    8581   8638
  i3    def    8553
        use    8576
  i4    def    8554
        use    8574   8634
  j0    def    8620
        use    8615
  j1    def    8595
        use    8588
  j2    def    8603
        use    8597
  j3    def    8606
        use    8594   8602
  j4    def    8632
        use    8623
  j5    def    8659
        use    8641
  j6    def    8670
        use    8657
  j7    def    8692
        use    8585
   8557 b. f2
   8569 e.
  f0    def    8562
        use    8559
  f1    def    8563
        use    8558
  f2    def    8568
        use    8564
   8671 b. f2
   8684 e.
  f0    def    8677
        use    8674
  f1    def    8678
        use    8672
  f2    def    8683
        use    8679
   8767 b. i10, j20
   9012 e.
  i0    def    8809
        use    8807
  i1    def    9009
        use    8972   8975   8997   9003
  i2    def    9010
        use    8976   8987   8990
  i3    def    9011
        use    8996   9007
  j0    def    8803
        use    8799
  j1    def    8840
        use    8812   8814   8817   8827   8828   8830
  j2    def    8880
        use    8818
  j3    def    8901
        use    8809
  j4    def    8909
        use    8815   8819   8821
  j5    def    8917
        use    8878   8899   8907   8915
  j6    def    8871
        use    8862
  j7    def    8920
        use    8949   8985
  j8    def    8921
        use    8786   8793   8810   8811   8813   8816   8820
               8822   8824   8826   8829   8831   8832   8833
               8834   8835   8836   8837   8838   8886   8914
               8952   8955   8961   8964   8967   8970   8988
  j9    def    8926
        use    8938
  j10   def    8930
        use    8802
  j11   def    8934
        use    8850
  j14   def    8945
        use    8823
  j16   def    8982
        use    8825
  j17   def    8999
        use    9006
  j20   def    8769
        use    8944
   8770 b. f2
   8782 e.
  f0    def    8775
        use    8772
  f1    def    8776
        use    8771
  f2    def    8781
        use    8777
   9068 b. i10, j25
   9302 e.
  i0    def    9069
        use    9095   9104   9115   9121   9182   9215   9259
               9294   9298
  i1    def    9072
        use    9089   9219   9239   9263
  j1    def    9109
        use    9102
  j2    def    9117
        use    9111
  j5    def    9120
        use    9108   9116
  j6    def    9129
        use    9128
  j10   def    9161
        use    9133   9135   9148   9149   9151
  j11   def    9175
        use    9167
  j12   def    9194
        use    9188
  j13   def    9230
        use    9212
  j14   def    9241
        use    9229
  j15   def    9245
        use    9130
  j16   def    9252
        use    9136   9138   9139   9140   9142   9157   9159
  j20   def    9272
        use    9242   9269
  j23   def    9293
        use    9099
   9075 b. f2
   9087 e.
  f0    def    9080
        use    9077
  f1    def    9081
        use    9076
  f2    def    9086
        use    9082
   9274 b. f2
   9286 e.
  f0    def    9279
        use    9276
  f1    def    9280
        use    9275
  f2    def    9285
        use    9281
   9350 b. i10, j10
   9413 e.
  i0    def    9410
        use    9372
  i1    def    9411
        use    9367   9393
  j4    def    9401
        use    9370
  j8    def    9404
        use    9386
   9352 b. f2
   9364 e.
  f0    def    9357
        use    9354
  f1    def    9358
        use    9353
  f2    def    9363
        use    9359
   9459 b. i10, j10
   9518 e.
  i0    def    9460
        use    9482   9494   9498   9514
  i1    def    9463
        use    9483   9501
  j1    def    9503
  j2    def    9509
        use    9486
   9465 b. f2
   9477 e.
  f0    def    9470
        use    9467
  f1    def    9471
        use    9466
  f2    def    9476
        use    9472
   9555 b. i10, j10
   9602 e.
  j1    def    9590
        use    9574
  j2    def    9594
  j8    def    9598
        use    9583
   9558 b. f2
   9570 e.
  f0    def    9563
        use    9560
  f1    def    9564
        use    9559
  f2    def    9569
        use    9565
   9646 b. i10, j10
   9715 e.
  i0    def    9709
        use    9681
  i2    def    9714
        use    9663
  j1    def    9685
        use    9678
  j2    def    9695
        use    9668
  j3    def    9700
  j4    def    9703
        use    9689
   9648 b. f2
   9660 e.
  f0    def    9653
        use    9650
  f1    def    9654
        use    9649
  f2    def    9659
        use    9655
   9747 b. i10, j10
   9825 e.
  i0    def    9749
        use    9774   9786   9790   9821
  i1    def    9753
        use    9775   9793
  j1    def    9810
  j2    def    9816
        use    9778
   9757 b. f2
   9769 e.
  f0    def    9762
        use    9759
  f1    def    9763
        use    9758
  f2    def    9768
        use    9764
   9795 b. f2
   9807 e.
  f0    def    9800
        use    9797
  f1    def    9801
        use    9796
  f2    def    9806
        use    9802
   9930 b. i10, j15, o40
  10344 e.
  i0    def    9933
        use    9993   9994   9998  10012  10016
  i1    def    9936
        use   10086  10119  10135  10313
  i2    def    9937
        use    9985  10114  10131  10185
  i4    def    9945
        use    9997
  j1    def   10005
        use    9991
  j2    def   10015
        use   10004
  j3    def   10029
        use   10023
  o0    def   10243
        use   10029
  o2    def   10055
        use   10031
  o3    def   10293
        use   10032
  o4    def   10152
        use   10033
  o5    def   10294
        use   10034
  o6    def   10191
        use   10035
  o8    def   10295
        use   10037
  o10   def   10200
        use   10039
  o14   def   10210
        use   10043
  o20   def   10244
        use   10049
  o22   def   10250
        use   10051
  o25   def   10299
        use   10196  10207  10239  10247  10253
  o26   def   10311
        use   10149  10288
  o27   def   10334
        use    9988
  o31   def   10258
        use   10028
  o32   def   10270
        use   10027
  o33   def   10269
        use   10026  10262
  o34   def   10296
        use   10025
   9972 b. f2
   9984 e.
  f0    def    9977
        use    9974
  f1    def    9978
        use    9973
  f2    def    9983
        use    9979
  10057 b. j5
  10151 e.
  j1    def   10069
        use   10060
  j2    def   10089
        use   10080
  j3    def   10110
        use   10088
  j4    def   10129
        use   10113
  j5    def   10140
        use   10128
  10154 b. j5
  10189 e.
  j1    def   10184
        use   10176
  10193 b. j5
  10197 e.
  10212 b. i5, j5
  10240 e.
  j1    def   10238
        use   10216
  10314 b. f2
  10326 e.
  f0    def   10319
        use   10316
  f1    def   10320
        use   10315
  f2    def   10325
        use   10321
  10575 b. i0
  10581 e.
  i0    def   10576
        use   10576  10578  10580
  10584 b. h132
  25707 e.
  h3    def   10704  25702
        use   10658  10690
  h4    def   10774  25702
        use   10659
  h5    def   11795  25702
        use   10660
  h6    def   11858  25702
        use   10689
  h7    def   11048  25702
        use   10685
  h8    def   25702
        use   10662
  h9    def   25702
  h10   def   25703
  h11   def   25703
  h12   def   25703
  h13   def   25703
  h14   def   25703
  h15   def   25703
  h16   def   25703
  h17   def   25703
  h18   def   25703
  h19   def   25703
  h20   def   14160  25704
        use   10668
  h21   def   25704
  h22   def   11004  25704
        use   10686
  h24   def   15514
  h25   def   25704
  h26   def   14161  25704
        use   10671
  h29   def   25704
  h30   def   25705
  h31   def   25705
  h32   def   25705
  h33   def   25705
  h34   def   25705
  h35   def   25705
  h38   def   25705
  h72   def   11166  11354
        use   10694
  h74   def   11190  11354
        use   10695
  h76   def   11165  11354
        use   10696
  h78   def   11170  11354
        use   10697
  h80   def   17368  25706
        use   10698
  h82   def   18546  19838
        use   19837  20043
  h84   def   18547  25706
        use   10700  11813
  h86   def   18671
        use   17499
  h87   def   17608
        use   17503
  h88   def   19288
        use   17608
  h90   def   19945  25706
        use   10703
  h96   def   18525
        use   18541  18541
  h99   def   20088
        use   18449
  h100  def   23680
        use   18450  24413  24758  25266  25491
  h102  def   18541
        use   18451
  h104  def   18541
        use   18452
  h106  def   24873  25266
        use   18453
  h108  def   23818  24413
        use   18454
  h110  def   23681
        use   18455
  h112  def   23682
        use   18456
  h114  def   23683
        use   18457
  h116  def   23684
        use   18458
  h118  def   24423  24758
        use   18459
  h120  def   23685
        use   18460
  h122  def   25289  25491
        use   18461
  h124  def   25507
        use   18462
  10598 b. e10
  10707 e.
  e2    def   10611
        use   10605
  e3    def   10646
        use   10628
  10599 b. i3
  10706 e.
  i0    def   10608
        use   10615
  i1    def   10640
        use   10636
  i2    def   10623
        use   10614
  i3    def   10616
        use   10621
  10766 b. i10, j60
  10999 e.
  i0    def   10935
        use   10774
  i1    def   10936
        use   10787
  i2    def   10938
        use   10799  10885
  i3    def   10939
        use   10865  10867  10941
  i4    def   10940
        use   10862  10866
  i5    def   10941
        use   10869
  i6    def   10942
        use   10889  10892
  i7    def   10937
        use   10884
  i8    def   10943
        use   10776  10779
  i9    def   10944
        use   10857  10898
  j10   def   10788
        use   10783
  j12   def   10796
        use   10790
  j14   def   10799
        use   10786
  j16   def   10801
        use   10793
  j18   def   10824
        use   10833
  j19   def   10830
        use   10826
  j20   def   10836
        use   10842
  j22   def   10837
        use   10843
  j24   def   10853
        use   10778  10822  10839
  j26   def   10869
        use   10875  10893
  j28   def   10874
        use   10883
  j30   def   10876
        use   10873
  j32   def   10884
        use   10879
  j34   def   10888
        use   10882
  j36   def   10895
        use   10860  10870
  j38   def   10901
        use   10819  10837  10909
  j40   def   10913
        use   10903  10907
  j42   def   10920
        use   10927
  j44   def   10921
        use   10932
  j50   def   10959
        use   10808  10891
  j51   def   10984
        use   10844  10874
  10958 b. i3
  10998 e.
  i0    def   10996
        use   10961  10964  10987  10993
  i1    def   10997
        use   10962  10970  10984  10994
  i2    def   10963
        use   10969
  i3    def   10970
        use   10965
  11003 b. i4, j4
  11040 e.
  j0    def   11010
        use   11021  11024  11027  11035
  j1    def   11025
        use   11016
  j2    def   11036
        use   11031
  11044 b. i10, j10
  11070 e.
  i0    def   11045
        use   11046  11047
  j0    def   11047
        use   11050
  j1    def   11066
        use   11060
  11075 b. i15, m6, p6, s6
  11352 e.
  i0    def   11141
        use   11281  11283  11297
  i1    def   11147
        use   11210  11212
  i2    def   11150
        use   11239
  i3    def   11152
        use   11241
  i4    def   11154
        use   11243
  i5    def   11156
        use   11234  11276
  i6    def   11157
        use   11207  11220  11237
  i7    def   11157
        use   11227
  i8    def   11161
        use   11200
  i9    def   11162
  i10   def   11192
        use   11191
  i11   def   11146
        use   11291
  i12   def   11158
        use   11286
  i13   def   11159
        use   11290
  m0    def   11251
        use   11337
  m3    def   11328
        use   11273  11304  11323  11350
  m4    def   11329
        use   11301
  m5    def   11330
        use   11345
  p0    def   11136
        use   11204  11287
  p1    def   11137
        use   11288
  p2    def   11138
        use   11209
  p3    def   11139
        use   11147
  s0    def   11118
        use   11119  11255  11263  11264  11267  11325  11340
  s1    def   11119
        use   11120  11274  11310  11335
  s2    def   11120
        use   11260  11265  11324  11326  11339  11341
  11164 b. j6
  11248 e.
  j0    def   11183
        use   11169
  j1    def   11200
        use   11193  11197
  j2    def   11202
        use   11194  11196
  j3    def   11223
        use   11199
  j4    def   11228
        use   11195  11198
  j5    def   11234
        use   11201  11213  11222
  j6    def   11214
        use   11205
  11250 b. j4
  11305 e.
  j0    def   11267
        use   11262
  j1    def   11274
        use   11259  11266  11268
  j2    def   11291
        use   11289
  11307 b. j6
  11351 e.
  j0    def   11339
        use   11321
  j1    def   11346
  j2    def   11347
        use   11343
  j3    def   11336
        use   11312
  11407 b. i30
  11434 e.
  i0    def   11408
        use   11412  11416
  i1    def   11409
        use   11416
  i2    def   11422
        use   11429
  i3    def   11429
        use   11433
  i10   def   11416  11417  11418  11419  11420  11421
        use   11417  11417  11418  11418  11419  11419  11420
              11420  11421  11421  11425
  i11   def   11421
        use   11421  11425
  i12   def   11420
        use   11420  11424
  i13   def   11419
        use   11419  11424
  i14   def   11418
        use   11418  11423
  i15   def   11417
        use   11417  11423
  i20   def   11416  11417  11418  11419  11420  11421
        use   11417  11417  11418  11418  11419  11419  11420
              11420  11421  11421  11428
  i21   def   11421
        use   11421  11428
  i22   def   11420
        use   11420  11427
  i23   def   11419
        use   11419  11427
  i24   def   11418
        use   11418  11426
  i25   def   11417
        use   11417  11426
  11587 b. j170, m10, p50, q70
  14041 e.
  j0    def   12335
        use   12662  12679  13199
  j1    def   12004
        use   11802
  j2    def   12056
        use   11822  11904
  j3    def   12108
        use   11830
  j4    def   12153
        use   11833  12788
  j5    def   12206
        use   12615
  j6    def   12274
        use   12623
  j8    def   13379
        use   12711  13021
  j9    def   13427
        use   12937
  j10   def   13541
        use   12847
  j11   def   13592
        use   12778  13058  13705
  j12   def   13673
        use   13011  13027
  j13   def   13740
        use   13107  13151  13224  13237  13254
  j14   def   13800
        use   12906  13214  13260  13296
  j15   def   13875
        use   13053
  j16   def   14008
        use   12775  13066
  j17   def   14011
        use   12760
  j20   def   11871
        use   11868
  j25   def   11882
        use   11877
  j28   def   11898
        use   11891
  j30   def   11954
        use   11828  11835  11906
  j32   def   11963
        use   11958
  j35   def   11973
        use   11804
  j37   def   11975
        use   11803  11823  11905  12476
  j41   def   11977
        use   11974
  j50   def   12609
        use   11964  12912
  j52   def   12621
        use   12614
  j53   def   12627
        use   12622
  j55   def   12652
        use   12628  12789  12804  13075  13127  13155  13175
              13228  13239  13240  13241  13249  13258  13274
  j57   def   12668
        use   12655
  j59   def   12678
        use   12669
  j75   def   12754
        use   12731  12732  12733
  j77   def   12764
        use   12734  12735  12736  12737  12738  12739
  j80   def   12780
        use   13074
  j85   def   12791
        use   12729
  j87   def   12814
        use   12730
  j90   def   12828
        use   12616
  j92   def   12832
        use   13115
  j94   def   12836
        use   12618
  j95   def   12841
        use   13225  13226  13227
  j96   def   12846
        use   13048  13108  13159  13173  13272  13282
  j97   def   12848
        use   12834  12844
  j98   def   13156
        use   13152  13153  13154
  j99   def   12855
        use   12665
  j100  def   12856
        use   13219
  j101  def   12857
        use   11896  12624  12664  12762
  j102  def   12858
        use   12617
  j103  def   12862
        use   12782
  j104  def   12864
        use   12839
  j106  def   12866
        use   12830  12853  12860
  j107  def   12902
        use   12887  12890  12894
  j110  def   12908
        use   12756  12812  12818  13034  13121
  j112  def   12914
        use   12911  13297
  j125  def   12935
        use   12721  12728  12767  12793
  j130  def   12943
        use   13005  13010  13019  13023  13026  13033  13049
              13054  13083  13089  13101  13135
  j132  def   12944
        use   12952
  j141  def   13088
        use   13094
  j143  def   13095
        use   13092
  j145  def   13112
        use   13110
  j147  def   13122
        use   13109  13111
  j150  def   13170
        use   13166
  j151  def   13174
        use   13169
  j154  def   13197
        use   13189
  j160  def   13242
        use   13238
  j162  def   13259
        use   13255  13256  13257
  m0    def   11637
        use   11637  11795  11826  11831  11866  11879  11889
              12077  12346  12611  12850  13097  13612
  m1    def   11637
        use   11638  11898  12407  12460  12487  13046  13113
              13280
  m2    def   11638
        use   11639  12065  12208  12275  12422  13626  13627
  m3    def   11639
        use   11640  12063  12207  12278
  m4    def   11640
        use   11641  12059  12069  12110  12113  12122  12123
              12156  12280  12375  12786  13084  13593  13595
  m5    def   11641
        use   11641  12072  12176  12419  12777  13072  13619
              13621  13703
  m6    def   11641
        use   11642  12058  12444  12480  12758  12773  12784
              13042  13062  13071  13081  13106  13133  13138
              13150  13164  13174  13223
  m7    def   11642
        use   11643  11807  11829  12173  12785
  m8    def   11643
        use   11643  12073  12848  12863  12879
  m9    def   11643
        use   11644  12074  12154  12780  12849  13622  13624
  m10   def   11644
        use   11955  12376  12787  13085  13598
  p0    def   11685
        use   12116  12118  12159  12170
  p1    def   11686
        use   11687  12112  12121  12158  12160  12167  12171
  p2    def   11678
        use   11875  11956  13824
  p3    def   11687
        use   11688  12377  13086  13599
  p4    def   11688
        use   11690  11903
  p5    def   11696
        use   11698  12281  12676  12797  13759
  p6    def   11690
        use   11691  12276  12382  12386  12387  12401  12805
  p7    def   11691
        use   11692  12392
  p8    def   11692
        use   11693  11694  12277  12380  12806
  p9    def   11694
        use   11695  11696  12279  12385  12809
  p10   def   11693
        use   12399  12670  13243  13245
  p11   def   11695
        use   12400  12671  12800  12801  13247
  p12   def   11698
        use   11700  12283  12653  12674  12811  12814  12817
              13158  13185  13262  13819
  p13   def   11700
        use   11713  12352  12413  12415  12463  12465  12714
              12915  12938  13803
  p14   def   11713
        use   11714  12285  12489  12496  12514  12677  12771
              12799  13004  13070  13126
  p15   def   11714
        use   11717  12440  12610  12672  13193  13197  13236
              13248  13253  13269  13273
  p16   def   11717
        use   11725  12508  12509  12510  12577  12701  12703
              12704  12705  12765  12791  13009  13017  13018
              13020  13457  13876  13932
  p18   def   11725
        use   11727  11728  11729  11730  11731  12511  12512
              12513  12591  12706  12707  12708  12766  13025
  p20   def   11731
        use   11734  12390  12393  12429  12568  12585
  p21   def   11734
        use   11738  12379  12457  12571  12769  13069  14008
              14022
  p22   def   11727
        use   12396  12803  12807
  p31   def   11738
        use   11740  12709  12874  12876
  p33   def   11740
        use   11741  12710  12877  13430
  p34   def   11741
        use   11742  12712  12794  13144  13429  13450  13542
  p35   def   11742
        use   11746  12406  12417  12420  12838  12869  12871
              12880  12904  13625  13689  13693
  p36   def   11728
        use   12939  12947  13124  13139  13142
  p37   def   11729
        use   12941  12944  12946
  p38   def   11730
        use   13016  13024  13163
  p40   def   11746
        use   11747  11780  12216  12226  12657  12659
  p41   def   11747
        use   11750  13040  13044
  p42   def   11750
        use   11751  13060  13064
  p43   def   11751
        use   11753  14011  14013
  p44   def   11753
        use   11759  14018  14021
  p45   def   11759
        use   11766  14028  14032
  p46   def   11776
        use   11780  12234  12237  13087  13088  13602  13606
  p47   def   11766
        use   11771  13431  13440  13441
  p48   def   11771
        use   11776  13440  13441
  p50   def   11780
        use   12210  12227
  q0    def   11630
        use   11815  11818  11860  12029
  q1    def   11631
        use   11928  11931  12204  12612  12656  12757  12772
              12979  13039  13059  13080  13428  13596  14006
  q2    def   11632
        use   11780  12237  13088  13606
  q10   def   11618
        use   11620  11621  11622  13332
  q11   def   11619
        use   11621
  q12   def   11620
        use   11622
  q13   def   11621
        use   13179  13183
  q14   def   11622
        use   13179
  q15   def   11623
        use   13271
  q20   def   13307
        use   12455  13751
  q21   def   13320
        use   12456  13757
  q23   def   13304
        use   13771
  q24   def   13305
        use   13334
  q30   def   11595
        use   11827  11849  11936  11937  12079
  q31   def   11596
        use   11869  11937  12081  12621
  q32   def   11597
        use   11849  11936  11937
  q33   def   11598
        use   11796  11849  11867  11880  11936  11937  12896
  q34   def   11599
        use   11870  11937
  q35   def   11600
        use   11832  11849  11936  11937
  q36   def   11601
        use   11929  12082  12613
  q38   def   11603
        use   11890  11937
  q39   def   11602
        use   11937  12078  12627  12678  13198
  q40   def   11605
        use   11900  11912  11914  11916  11918  11920  11922
              11924  11926  12408  12469
  q41   def   11606
        use   11841  11843  11845  11913  11914  11917  11918
              11921  11922  11925  11926  13047  13281
  q42   def   11607
        use   11842  11843  11846  11847  11915  11916  11917
              11918  11923  11924  11925  11926  13114
  q43   def   11608
        use   11844  11845  11846  11847  11919  11920  11921
              11922  11923  11924  11925  11926  12461
  q50   def   11610
        use   11901  12531
  q51   def   11611
        use   12397  12532
  q52   def   11612
        use   11821  11899  12533  13911  13920
  q53   def   11613
        use   12534  13694  13974
  q60   def   11615
        use   11810
  q61   def   11616
        use   13826
  11793 b. i10
  11853 e.
  i0    def   11851
        use   11799
  i1    def   11841
        use   11851
  i2    def   11842
        use   11851
  i3    def   11843
        use   11851
  i4    def   11844
        use   11851
  i5    def   11845
        use   11851
  i6    def   11846
        use   11851
  i7    def   11847
        use   11851
  i10   def   11814
        use   11811
  11857 b. i50
  14040 e.
  i0    def   11939
        use   11873
  i1    def   11936
        use   11878
  i2    def   11941
        use   11881
  i3    def   11912
        use   11939
  i4    def   11913
        use   11939  11941
  i5    def   11914
        use   11939
  i6    def   11915
        use   11939  11941
  i7    def   11916
        use   11939
  i8    def   11917
        use   11939  11941
  i9    def   11918
        use   11939
  i10   def   11919
        use   11939  11941
  i11   def   11920
        use   11939
  i12   def   11921
        use   11939  11941
  i13   def   11922
        use   11939
  i14   def   11923
        use   11939  11941
  i15   def   11924
        use   11939
  i16   def   11925
        use   11939  11941
  i17   def   11926
        use   11939
  i18   def   11929
        use   11936  11937
  i20   def   12728
        use   12720
  i21   def   12728
        use   12722
  i23   def   12741
        use   12729  12731  12732  12734  12735
  i24   def   12743
        use   12733  12736  12737  12738  12739  13330
  i25   def   12745
        use   12730
  i27   def   13325
        use   12828
  i28   def   13327
        use   12832
  i29   def   13329
        use   12864
  i35   def   12973
        use   12948
  i36   def   12973
        use   12954
  i40   def   13330
        use   13022
  i41   def   13331
        use   13170
  i42   def   13332
        use   13206
  i43   def   13333
        use   13143
  i44   def   13334
        use   13137
  i45   def   13335
        use   13136
  12003 b. i2
  12028 e.
  i0    def   12027
        use   12004  12008  12022  12024
  i1    def   12020
        use   12011
  i2    def   12024
        use   12017
  12055 b. i2
  12087 e.
  i0    def   12086
        use   12056  12075  12084
  i1    def   12075
        use   12080  12083
  i2    def   12077
        use   12062
  12107 b. i0
  12127 e.
  i0    def   12126
        use   12108  12124
  12152 b. i3
  12181 e.
  i0    def   12179
        use   12153  12177
  i1    def   12180
        use   12155  12164  12174  12175
  i2    def   12162
        use   12168
  i3    def   12169
        use   12165
  12205 b. i8
  12250 e.
  i0    def   12244
        use   12214  12224  12241
  i1    def   12245
        use   12215  12239
  i2    def   12213
        use   12211
  i3    def   12229
        use   12232
  i4    def   12235
        use   12238
  i5    def   12246
        use   12221
  i6    def   12247
        use   12217
  i7    def   12248
        use   12220
  12273 b. i0
  12289 e.
  i0    def   12288
        use   12274  12286
  12333 b. c74, i110, l1, n10
  12597 e.
  c0    def   12563
        use   12497
  c1    def   12570
        use   12339  12449
  c2    def   12567
        use   12342
  c3    def   12573
        use   12350  12410  12412  12426  12428  12492
  c4    def   12576
        use   12490
  c5    def   12580
        use   12341  12467
  c6    def   12584
  c7    def   12587
        use   12471  12477  12479
  c8    def   12590
  c9    def   12594
  c22   def   12568
  c24   def   12569
        use   12434
  c32   def   12574
        use   12423  12430
  c34   def   12575
        use   12398  12421  12435  12473  12483
  c72   def   12588
  c74   def   12589
        use   12474
  i0    def   12522
        use   12336  12519
  i1    def   12523
        use   12343  12493  12499  12517
  i2    def   12524
        use   12354  12358  12360
  i3    def   12525
        use   12451
  i4    def   12526
        use   12338  12466
  i5    def   12527
        use   12340
  i6    def   12528
        use   12448
  i7    def   12529
        use   12468  12470
  i8    def   12530
        use   12411
  i9    def   12532
        use   12416
  i10   def   12534
        use   12405
  i11   def   12535
        use   12427  12478
  i20   def   12356
        use   12394  12425  12431  12438  12447  12458  12462
              12484  12494  12500
  i25   def   12388
        use   12403
  i30   def   12419
        use   12409
  i35   def   12446
        use   12442
  i37   def   12480
  i40   def   12507
        use   12503
  i100  def   12542
  i101  def   12365
        use   12542
  i102  def   12366
        use   12543
  i103  def   12367
        use   12544
  i104  def   12368
        use   12545
  i105  def   12369
        use   12546
  i106  def   12370
        use   12547
  i107  def   12371
        use   12548
  l0    def   12542
        use   12349
  l1    def   12542
        use   12353
  n0    def   12375
        use   12366  12367  12368  12369
  n1    def   12396
        use   12370
  n2    def   12405
        use   12366  12367
  n3    def   12434
        use   12368
  n4    def   12440
        use   12370
  n5    def   12444
        use   12366
  n6    def   12460
        use   12367
  n7    def   12487
        use   12365  12371
  n8    def   12496
        use   12366  12367  12368  12369  12370
  n9    def   12502
        use   12365  12368  12369  12370  12371
  n10   def   12505
        use   12366  12367
  12955 b. n25, o16
  13298 e.
  n2    def   13003
        use   12973
  n3    def   13009
        use   12974
  n4    def   13015
        use   12975
  n5    def   13031
        use   12976
  n6    def   13038
        use   12977
  n7    def   13053
        use   12978
  n8    def   13106
        use   12982  13145
  n9    def   13150
        use   12984
  n10   def   13163
        use   12985
  n11   def   13179
        use   12986  13232
  n12   def   13183
        use   12987
  n13   def   13193
        use   12988
  n14   def   13204
        use   12989
  n15   def   13213
        use   13186  13196
  n16   def   13219
        use   12991
  n17   def   13232
        use   12990  12993
  n18   def   13236
        use   12994
  n19   def   13253
        use   12995
  n20   def   13267
        use   12996
  n21   def   13280
        use   12997
  n22   def   13295
        use   12998
  o7    def   13080
        use   12980
  o8    def   13133
        use   12983
  o16   def   13223
        use   12992
  13378 b. i1
  13396 e.
  i0    def   13394
        use   13383
  i1    def   13395
        use   13384
  13426 b. i30
  13511 e.
  i0    def   13502
        use   13458
  i1    def   13503
        use   13460
  i2    def   13504
        use   13464
  i3    def   13505
        use   13471
  i4    def   13506
        use   13476
  i5    def   13507
        use   13480
  i6    def   13508
        use   13451
  i7    def   13509
        use   13482
  i10   def   13510
        use   13427  13500
  i13   def   13485
        use   13481
  i14   def   13490
        use   13455
  i15   def   13491
        use   13454
  i16   def   13492
        use   13489
  i17   def   13493
        use   13475
  i18   def   13494
        use   13477  13488
  i19   def   13495
        use   13479
  i20   def   13496
        use   13483
  i21   def   13497
        use   13462
  i22   def   13498
        use   13473
  i23   def   13499
        use   13484
  i24   def   13463
        use   13459  13461
  i25   def   13474
        use   13465  13472
  i26   def   13432
        use   13447
  i27   def   13437
        use   13433
  i28   def   13442
        use   13438
  i29   def   13456
        use   13452
  13540 b. i4
  13566 e.
  i0    def   13561
        use   13543
  i1    def   13562
        use   13547
  i2    def   13563
        use   13549
  i3    def   13564
        use   13551
  i4    def   13565
        use   13553
  13591 b. i4
  13633 e.
  i0    def   13630
        use   13592  13628
  i1    def   13631
        use   13600  13609
  i2    def   13632
        use   13597  13617
  i3    def   13603
        use   13610
  i4    def   13616
        use   13607
  13672 b. i5
  13711 e.
  i0    def   13707
        use   13673  13685  13698  13704
  i1    def   13687
        use   13677
  i2    def   13686
        use   13684
  i3    def   13708
        use   13687  13692
  i4    def   13709
        use   13696
  i5    def   13701
        use   13691
  13739 b. i4
  13773 e.
  i0    def   13768
        use   13746
  i1    def   13769
        use   13747
  i2    def   13770
        use   13754
  i3    def   13771
        use   13764
  i4    def   13772
        use   13740  13743  13748  13765
  13799 b. i7
  13849 e.
  i0    def   13847
        use   13817  13845
  i1    def   13848
        use   13800  13814  13821  13840
  i2    def   13809
        use   13815
  i3    def   13816
        use   13811
  i4    def   13821
        use   13843
  i5    def   13830
        use   13828
  i6    def   13834
        use   13839
  i7    def   13840
        use   13829
  13874 b. i25
  13985 e.
  i0    def   13968
        use   13875  13898  13930  13943  13944  13960
  i1    def   13969
  i2    def   13970
        use   13878  13895  13964  13965
  i3    def   13971
        use   13892  13894
  i5    def   13974
        use   13897
  i6    def   13972
        use   13904
  i8    def   13973
        use   13906
  i9    def   13975
        use   13910  13934
  i10   def   13976
        use   13914  13935
  i11   def   13977
        use   13915  13936  13937
  i15   def   13944
        use   13900
  i16   def   13955
        use   13879  13882  13885  13889
  i17   def   13920
        use   13917
  i20   def   13979
        use   13925  13927  13939  13940
  i21   def   13980
        use   13923
  i22   def   13981
  i23   def   13982
        use   13926
  i24   def   13983
        use   13938
  i25   def   13984
        use   13924
  14007 b. i3
  14037 e.
  i0    def   14035
        use   14015  14025  14033
  i1    def   14015
        use   14010
  i2    def   14026
        use   14024
  i3    def   14036
        use   14026
  14042 b. m50, n114, p22
  16855 e.
  m0    def   14290
        use   14229
  m1    def   14316
        use   14231
  m2    def   14330
  m3    def   15417
        use   14232
  m4    def   14554
        use   14233
  m5    def   15456
        use   14234
  m6    def   14672
        use   14235
  m8    def   15485
        use   14237
  m9    def   14806
        use   14238  15574
  m10   def   14875
        use   14239
  m12   def   14972
        use   14241  15576
  m14   def   15001
        use   14243
  m16   def   15041
        use   14245
  m18   def   15220
        use   14247
  m20   def   15275
        use   14249
  m22   def   15295
        use   14251  15578
  m31   def   15351
        use   14228
  m32   def   15381
        use   14227
  m33   def   15382
        use   14226
  m34   def   15386
        use   14225
  m41   def   15602
        use   15570
  m42   def   15658
        use   15572
  m43   def   15611
        use   15580
  m44   def   15612
        use   15582
  m45   def   15620
        use   15583
  n0    def   16444
        use   15605  15615  15623  15729  15734  15744
  n1    def   16471
        use   16051  16691  16701  16703
  n2    def   16528
        use   14946  15266  16016  16693
  n3    def   16560
        use   15732  15745
  n4    def   16593
        use   15746
  n5    def   16595
        use   15747
  n7    def   16617
        use   16045  16689
  n8    def   16644
        use   15268  16017  16047  16694
  n9    def   16673
        use   15748  16311
  n12   def   16731
        use   15749
  n13   def   16794
        use   15892  16232  16260  16273  16360
  n14   def   16828
        use   15373  15750
  n100  def   15744
        use   14295  14586  14757  14762  14949  15011  15277
              15331  15384  15387  15425  15459  15488
  n103  def   15745
        use   14760  15177
  n104  def   15746
        use   14817
  n105  def   15747
        use   14831  14835
  n109  def   15748
        use   14602
  n112  def   15749
        use   14940  15876
  n114  def   15750
        use   14943
  p2    def   14121
  p3    def   14131
  p5    def   14132
  p6    def   14122
  p8    def   14133
  p9    def   14123
        use   14205
  p10   def   14124
  p12   def   14125
  p14   def   14126
  p16   def   14127
  p18   def   14128
  p20   def   14129
  p22   def   14130
  14159 b. i10, j10
  14273 e.
  i1    def   14252
        use   14162  14186
  i2    def   14264
        use   14182
  i3    def   14272
        use   14188
  i5    def   14229
        use   14223
  j2    def   14204
        use   14199
  j3    def   14221
        use   14171  14196  14206
  14315 b. i1
  14328 e.
  i1    def   14327
        use   14321
  14553 b. i10, j10
  14617 e.
  j0    def   14556
        use   14569
  j1    def   14567
        use   14559  14562
  j2    def   14588
        use   14584
  14671 b. i10, j20
  14782 e.
  i0    def   14771
        use   14716
  j1    def   14679
        use   14686
  j2    def   14684
  j3    def   14689
        use   14675
  j4    def   14699
        use   14682
  j5    def   14710
        use   14702
  j7    def   14719
        use   14709
  j10   def   14758
        use   14750
  j20   def   14765
        use   14687  14697
  14805 b. i10, j10
  14844 e.
  i1    def   14839
        use   14811
  i3    def   14841
        use   14810
  j1    def   14822
        use   14815
  14874 b. i10, j10
  14952 e.
  j0    def   14887
        use   14878
  j1    def   14917
        use   14909
  j2    def   14924
        use   14886
  j3    def   14945
        use   14937
  15000 b. i10, j10
  15013 e.
  15040 b. i10, j15
  15199 e.
  i1    def   15197
        use   15071  15172
  j0    def   15070
        use   15066
  j1    def   15074
        use   15092
  j2    def   15085
        use   15079
  j3    def   15091
        use   15082
  j4    def   15094
        use   15075
  j5    def   15108
        use   15119
  j6    def   15117
        use   15111
  j7    def   15123
        use   15106  15115
  j8    def   15160
        use   15163
  j9    def   15165
        use   15161
  j10   def   15192
        use   15120  15131
  j11   def   15175
        use   15171
  j12   def   15178
        use   15174
  15219 b. i10, j10
  15274 e.
  j1    def   15256
        use   15259
  j2    def   15261
        use   15257
  15294 b. i10, j10
  15333 e.
  15348 b. i5, j5
  15378 e.
  i1    def   15349
        use   15353  15364  15365
  i2    def   15350
        use   15355  15372
  15416 b. i5, j5
  15427 e.
  15455 b. i10, j10
  15461 e.
  15513 b. i10, j10
  15592 e.
  i1    def   15586
        use   15515  15531  15539
  i2    def   15591
        use   15529
  j1    def   15534
        use   15528
  j2    def   15541
        use   15533
  j3    def   15553
        use   15524  15548
  j4    def   15567
        use   15545
  15657 b. i10, j20
  15742 e.
  j1    def   15664
        use   15671
  j2    def   15669
  j3    def   15674
        use   15661
  j4    def   15684
        use   15667
  j10   def   15730
        use   15722
  j20   def   15737
        use   15672  15682
  15759 b. i10, j10, o121
  16419 e.
  j0    def   15780
        use   15775
  o0    def   16417
        use   16361  16386  16405
  o1    def   16392
        use   15791  15793  15795  15894  16010  16019  16056
              16233  16276  16297  16328
  o2    def   16362
        use   15768
  o3    def   16335
        use   15766
  o20   def   15813
        use   15784
  o21   def   15910
        use   15785
  o31   def   16034
        use   15787
  o40   def   16069
        use   15788
  o80   def   16244
        use   15796
  o91   def   16282
        use   15799
  o111  def   16301
        use   15803
  o121  def   16302
        use   15805
  15806 b. i10, j10
  15896 e.
  i0    def   15807
        use   15891
  i1    def   15808
        use   15834  15840  15888
  i2    def   15809
        use   15817
  i3    def   15810
        use   15841  15885
  i4    def   15811
        use   15882  15884
  i8    def   15812
        use   15864
  j0    def   15833
        use   15821
  j1    def   15823
        use   15829
  j2    def   15838
        use   15827
  j4    def   15889
        use   15879
  j9    def   15890
        use   15835
  15897 b. i10, j20
  16032 e.
  i0    def   15898
        use   15984
  i2    def   15899
        use   15929
  i4    def   15900
        use   16027
  j1    def   15951
        use   15928
  j2    def   15958
        use   15921
  j3    def   15974
        use   15960
  j4    def   15983
        use   15976  15978  15980
  j6    def   15990
        use   15950  15957  15973
  j8    def   16014
        use   15916
  16033 b. i10, j10
  16058 e.
  16059 b. i10, j25
  16235 e.
  i0    def   16061
        use   16231
  i1    def   16062
        use   16076  16182
  i2    def   16063
        use   16139
  i3    def   16064
        use   16074  16172  16188  16201  16213
  i5    def   16065
        use   16187  16197  16211
  i6    def   16066
        use   16119  16121
  i7    def   16067
        use   16120  16124  16140
  j2    def   16089
        use   16093
  j3    def   16094
        use   16091
  j4    def   16095
        use   16086
  j5    def   16099
        use   16081
  j6    def   16121
        use   16141
  j7    def   16134
        use   16130
  j8    def   16139
        use   16127  16133
  j9    def   16142
        use   16116  16122
  j10   def   16145
        use   16106
  j11   def   16154
        use   16143
  j15   def   16156
        use   16101
  j16   def   16170
        use   16164
  j18   def   16186
        use   16169  16180
  j19   def   16216
        use   16167  16183  16196
  j20   def   16229
        use   16094  16098  16155  16218  16226
  j21   def   16220
        use   16160
  16236 b. i10, j10
  16278 e.
  i4    def   16239
        use   16257  16259  16271  16272
  i5    def   16240
        use   16255  16262
  i6    def   16241
        use   16269
  i7    def   16242
        use   16248
  j1    def   16275
        use   16264
  16281 b. i10, j10
  16298 e.
  16299 b. i10, j10
  16330 e.
  i2    def   16300
        use   16309  16325
  16332 b. i4
  16418 e.
  i0    def   16387
        use   16384
  i1    def   16333
        use   16356  16357
  i2    def   16334
        use   16356
  i3    def   16391
        use   16383
  i4    def   16413
        use   16409
  16336 b. f4
  16351 e.
  f0    def   16341
        use   16338
  f1    def   16342
        use   16337
  f2    def   16350
        use   16343  16347
  f3    def   16348
        use   16339
  f4    def   16349
        use   16346
  16363 b. f4
  16378 e.
  f0    def   16368
        use   16365
  f1    def   16369
        use   16364
  f2    def   16377
        use   16370  16374
  f3    def   16375
        use   16366
  f4    def   16376
        use   16373
  16470 b. i10, j10
  16512 e.
  i0    def   16505
        use   16492
  i1    def   16506
        use   16475  16502
  i2    def   16507
        use   16496
  i3    def   16508
        use   16474  16503
  i5    def   16510
        use   16477  16500
  j1    def   16479
        use   16498
  j2    def   16492
        use   16487
  16527 b. i10, j10
  16545 e.
  i1    def   16543
        use   16529  16539
  j0    def   16534
        use   16538
  16559 b. i10, j10
  16577 e.
  i3    def   16576
        use   16561  16574
  j1    def   16565
        use   16571
  16592 b. i5, j5
  16604 e.
  i0    def   16603
        use   16596  16598
  16616 b. i5, j5
  16628 e.
  i2    def   16626
  i3    def   16627
        use   16617  16623
  16643 b. i5, j5
  16658 e.
  i0    def   16655
        use   16645  16652
  i1    def   16656
        use   16650
  16672 b. i10, j10
  16715 e.
  i3    def   16713
        use   16675  16712
  j2    def   16677
        use   16711
  j3    def   16697
        use   16681  16684
  j4    def   16709
        use   16695  16698
  16730 b. i10, j10
  16779 e.
  i0    def   16772
        use   16755  16768
  i1    def   16773
        use   16732  16749
  i2    def   16774
        use   16767
  i3    def   16775
        use   16731  16770
  i4    def   16776
        use   16734  16758  16769
  i5    def   16777
        use   16741  16763
  i6    def   16778
        use   16738  16739
  j3    def   16739
        use   16765
  j4    def   16751
        use   16747
  j5    def   16763
        use   16744  16750
  j6    def   16766
        use   16740  16757
  16791 b. i5, j5
  16804 e.
  i3    def   16792
        use   16795  16803
  i4    def   16793
        use   16797  16799  16800
  16827 b. i10, j10
  16854 e.
  i0    def   16850
        use   16839  16846
  i1    def   16851
        use   16829  16841
  i2    def   16852
        use   16838  16844  16847
  i3    def   16853
        use   16828  16848
  16857 b. i30
  16882 e.
  i0    def   16858
        use   16860  16864
  i1    def   16858
        use   16864
  i2    def   16870
        use   16877
  i3    def   16877
        use   16881
  i10   def   16864  16865  16866  16867  16868  16869
        use   16865  16865  16866  16866  16867  16867  16868
              16868  16869  16869  16873
  i11   def   16869
        use   16869  16873
  i12   def   16868
        use   16868  16872
  i13   def   16867
        use   16867  16872
  i14   def   16866
        use   16866  16871
  i15   def   16865
        use   16865  16871
  i20   def   16864  16865  16866  16867  16868  16869
        use   16865  16865  16866  16866  16867  16867  16868
              16868  16869  16869  16876
  i21   def   16869
        use   16869  16876
  i22   def   16868
        use   16868  16875
  i23   def   16867
        use   16867  16875
  i24   def   16866
        use   16866  16874
  i25   def   16865
        use   16865  16874
  16897 b. f12, p340, v120
  25660 e.
  f0    def   17172
  f1    def   17173
        use   17193  17219  17224  17288
  f2    def   17174
        use   17194  17220
  f3    def   17175
        use   17197  17225  17289
  f4    def   17193  18567  19841  21072  21901  22925
        use   17407  17473  17523  17545  17565  17594  17615
              17662  17699  17729  17765  17807  17878  18431
              18470  18566  18681  18743  18794  18841  18864
              18875  18899  18917  18939  18950  18963  19027
              19298  19366  19412  19455  19467  19502  19517
              19535  19557  19593  19604  19617  19669  19840
              20134  20200  20230  20325  20444  20466  20547
              20709  20731  20752  20806  20869  21015  21071
              21614  21900  22065  22116  22549  22695  22825
              22841  22857  22878  22924  22991  23158  23180
              23199  23262  23278  23549  23578
  f5    def   17238  18569  19843  21074  21903  22927
        use   17328  17413  17479  17528  17550  17570  17599
              17621  17669  17735  17771  17813  17886  17887
              18442  18492  18568  18689  18749  18801  18846
              18870  18881  18912  18923  18945  18956  18977
              19032  19306  19372  19419  19461  19507  19530
              19541  19599  19610  19631  19674  19842  20140
              20206  20238  20331  20450  20472  20554  20715
              20738  20759  20812  20876  21022  21073  21621
              21902  22071  22128  22555  22701  22831  22847
              22863  22884  22926  22997  23165  23189  23206
              23268  23284  23560  23584
  f6    def   17319  18571  19845  21076  21905  22929
        use   17706  17886  18570  19844  21075  21904  22928
  f7    def   17177
        use   17208  17242  17276  17321
  f8    def   17178
  f9    def   17179
        use   17218  17247  17263
  f10   def   17181
        use   17182  17221
  f11   def   17182
  p0    def   16957
        use   16958  16992  17089  17090  17433  18589  19199
              23827  24432  24882  24883  25297
  p1    def   16958
        use   16960
  p2    def   18589  19199
        use   18559  18590  18695  18719  18810  18830  18859
              18921  18926  19023  19200  19312  19332  19428
              19446  19491  19539  19544  19666
  p3    def   18590  19200
        use   18512  18517  18522  18591  19201
  p5    def   16968
        use   16969  18201  19977  19986  20191  20314  20339
              20365  20616  20704  20837  20847  20908  20965
              21004  21257  21589  22739  22772
  p6    def   16967
        use   19979  20193  20316  20341  20367  20700  20702
              22737
  p7    def   16967
        use   16967  16968  19981  19988  20195  20318  20343
              20369  20698  20836  20846  21255  21593  22735
              22775
  p8    def   16961
        use   20696
  p9    def   16960
        use   19983  19990  20684  20799  20853  20993  22733
  p10   def   16961
        use   16961  16962  16972  16972  18427  20166  20680
              20995  21625  22034  22585
  p11   def   16960
        use   16960  16961  19975  20371  20622  20682  20705
              20797  20851  20967  20991  21003  22699  22731
              22768
  p12   def   16962
        use   16963  16974  16974  18300  21563  22592  22622
              22634  22686  22838  22870  22986  22987  23154
              23155  23210  23212  23354  23442  23443  23652
              23653  23931  23932  24030  24031  24087  24088
              24137  24138  24197  24198  24253  24254
  p13   def   16969
        use   16970  18292  18299  20406  20420  22299  22344
              22345  22370  22465  22593  22688  22689  22982
              23083  23146  23149  23185  23454  23455  23490
              23507  23540  23573  24498  25095  25114  25119
  p14   def   16963
        use   16964  17838  17839  17841  18110  18557  18560
              21560  21561  21569  21571  21714  21715  22834
              22835  22895  22897
  p15   def   16964
        use   16965  17004  21716
  p16   def   16965
        use   16965  16966  18303  18304  20175  20677  20997
              21390  21391  21553  21566  22277  22278  22372
              22373  22568  22569  22691  22692  22854  23172
              23173  24007  24008
  p17   def   16965
        use   21393  21402  22203  22224  22245  22249  22594
              22741  23130  23147
  p18   def   16966
        use   16967  20182  20184  20675  21002  22458  22459
              24471  25204  25205
  p19   def   16970
        use   16971  18134  18138  18280  18296  18308  20084
              20171  20173  20448  20449  20714  20811  21374
              21400  21405  22206  22227  22275  22506  22554
              22564  22664  22700  22830  23259  23282  23283
              23433  25462  25466
  p60   def   17013
        use   17819  17842  17849  17858  18487  18488  18534
              20418  22918  23136  23196  24072
  p61   def   17028
        use   18015  20266  20428  21341  22472  22474  22633
              23024  23056  23091  23125  23993  24035  24044
              25100
  p62   def   17029
        use   17854  18017  20275  22976
  p63   def   17030
        use   17855  18019  18485  20277  21291  21344  22980
              25062
  p64   def   17027
        use   17853  18010  20272  21289  21321  22476  23088
              23991  24037  25105  25573  25575
  p65   def   17014
        use   19800  21296  21315  22469  23086  23988  24042
  p66   def   17012
        use   17862  17979  18484  19802  21305  21325  22477
              23026  23089  23990  24040  25579
  p67   def   17032
        use   17454  17457  17459  17520  17534  17536  17558
              17560  18035
  p68   def   17028
        use   18012  20289  21355  21368  22267  22636  22742
  p69   def   17026
        use   18007  20268  21336  22732
  p70   def   17033
        use   17830  17844  17856
  p71   def   17016
        use   19792  21332  23060  24024
  p72   def   17015
        use   17850  19796  21307  21330  22629  23059  23094
              23985  24022
  p73   def   17034
        use   17469  17477  17540  17827  17847  17863  17867
              17872  19437  19637  19757  19789
  p74   def   17035
        use   17482  17542  17804  19484  19586
  p75   def   17036
        use   17811  17812  17982  17987  17997  17998  18003
              18008  18013  18020  19239  19597  19598
  p76   def   17034
        use   17818  19590
  p77   def   17035
        use   17478  17820  19440
  p78   def   17026
        use   18000  20270  20434  21338  22734
  p79   def   17018
        use   17851  17981  18094
  p80   def   17041
        use   17629  17676  17682  17714  17733  17769  18538
              20509  20535  20552  20728  20736  20767  20818
              21453  22797  23254  23302  23352  24134
  p81   def   17056
        use   17647  17657  17957  20479  20500  20544  21046
              21448  21485  22100  23255  23420  23460  24669
              25162
  p82   def   17057
        use   17960  20585  20690  22113  23494  23544  24128
              24213  24741  25161  25168
  p83   def   17058
        use   17954  18491  20587  20679  20692  22162  22167
              23496  23546  23610  24129  24214  24311  24664
              24685
  p84   def   17055
        use   17947  20671  20831  20862  20900  20945  21432
              22163  22175  23340  23493  23543  24126  24217
              24686
  p85   def   17042
        use   19146  20486  20516  23339  23382  24125  24679
  p86   def   17040
        use   17666  17908  18490  19148  20525  21060  23341
              23384  24127
  p87   def   17060
  p88   def   17056
        use   17950  20676  20777  21050  21368  21369  22267
              22268  23256  23295  23430  23649
  p89   def   17054
        use   17938  20781  20787  20798  21584
  p90   def   17061
        use   17630  17650  17651  17715  17734  17770  17794
              17942  20553  20737
  p91   def   17044
        use   19138  20495  20528  23345  23389  24122
  p92   def   17043
        use   19142  20493  20531  23344  23386  24119
  p93   def   17062
        use   17557  17581  17605  17689  18817  18983  19135
  p94   def   17063
        use   17562  17612  18889  18936
  p95   def   17064
        use   17619  17620  17667  17691  17692  17693  17694
              17905  17920  17924  17944  18631  18943  18944
  p96   def   17062
        use   17688  19109
  p97   def   17063
        use   17626  17632  17654  18820  19018
  p98   def   17054
        use   17927  17935  17936  20590  20621  20681  20779
              20796  22767
  p99   def   17046
        use   17636  17911  17932  20476  20946  21439  21486
              23291  23450
  p100  def   17065
        use   17071  17091  18138
  p101  def   17068
        use   17170  17405  17471  17521  17543  17563  17592
              17613  17660  17697  17727  17763  17805  17876
              18428  18468  18679  18741  18792  18839  18862
              18873  18897  18915  18937  18948  18961  19025
              19296  19364  19410  19453  19465  19500  19515
              19533  19555  19591  19602  19615  19667  19839
              20132  20198  20228  20323  20442  20464  20545
              20707  20729  20750  20804  20867  21013  21069
              21612  21899  22063  22114  22547  22693  22823
              22839  22855  22876  22923  22989  23156  23178
              23197  23260  23276  23547  23576
  p102  def   17069
        use   18987  19464  19554  19640  19679
  p103  def   17070
        use   19890  20039  20042  20274  20279  20487  20491
              20494  20517  20523  20526  20580  20584  20685
              20689  21052  21058  21090  21110  21297  21303
              21322  21327  21328  21507  21512  22627  23057
              23092  23342  23387  23983  24019  24120
  p109  def   17072
        use   18702  18752  18884  19317  19375  19479  19510
  p110  def   17073
        use   17203  17206
  p111  def   17074
        use   18273  20036  22572
  p112  def   17075
        use   18193  18213  19970  20213  20611  20793  20959
              20976
  p113  def   17076
        use   18194  18215  20358  20612  20633  20647  20961
              21670  22023
  p114  def   17077
  p115  def   17078
  p120  def   17079
  p121  def   17080
  p122  def   17081
  p140  def   17082
        use   18036  19650
  p141  def   17083
        use   17460  17537
  p160  def   17084
        use   17678  17685  17686  17824  17859  20533  20727
              20766  21450  21451  23253
  p161  def   17085
        use   17843  20419  20421  23144
  p162  def   17086
        use   17684  17685  20507  21450  23300  23350  24133
  p163  def   17087
        use   17684  18532  18536  20817  22795
  p164  def   17088
        use   22916
  p200  def   17091
        use   17092  17432  17497  18510  18631
  p201  def   17092
        use   17093  17501  18515  18558  19239
  p202  def   17093
        use   17648  17744  17747  17775  18132  19986  19988
              19990  24292
  p210  def   17089
        use   17092  18646
  p211  def   17090
        use   17093  19262
  p301  def   17020
        use   17984  20283  21346  22736
  p302  def   17020
        use   17986  18092  21348  22738
  p303  def   17021
        use   17852  17989  18089  20285  21350  22740
  p304  def   17022
        use   17990
  p305  def   17023
        use   17991
  p306  def   17024
  p308  def   17029
        use   18004
  p321  def   17048
        use   17742  17749  17780  17787  17915  20593  20697
              20783  21592  22774
  p322  def   17048
        use   17740  17918  20699
  p323  def   17049
        use   17743  17748  17779  17922  20595  20615  20703
              20785  21588  22771
  p324  def   17050
  p325  def   17051
  p326  def   17052
  p327  def   17052
  p328  def   17057
        use   17930
  v0    def   16904
        use   16971  20169  20170  22247  22573  22574  25466
  v1    def   16905
        use   16958  23838  24441  24889
  v2    def   16906
        use   22483
  v3    def   16907
        use   18138  18313  20084  20169  21396  22573
  v22   def   16918
        use   16919
  v23   def   16919
        use   20480
  v24   def   16920
        use   16921
  v25   def   16921
  v31   def   16910
        use   16911
  v32   def   16911
        use   20430  20578
  v33   def   16916
        use   16917
  v34   def   16917
  v35   def   16914
        use   16915
  v36   def   16915
  v37   def   16912
        use   16913
  v38   def   16913
        use   20775
  v40   def   16923
        use   17649
  v50   def   16926
        use   16927  23023  24032  24164  25101
  v51   def   16927
        use   23306  23463  24672
  v52   def   16928
        use   16929  23055  23992  24026  25102
  v53   def   16929
        use   23465  24673
  v54   def   16930
        use   16931  23090
  v55   def   16931
        use   22101  24675
  v56   def   16932
        use   16933
  v57   def   16933
  v58   def   16934
        use   16935  23421
  v59   def   16935
        use   22632
  v70   def   16937
        use   22871  22985  23153  23441  24029  24136
  v71   def   16938
        use   22623  22850  23209  23648
  v72   def   16939
        use   22873  23930  24086  24196  24252
  v100  def   22542
        use   18251
  v101  def   18237
        use   18226  21686
  v102  def   21608
        use   17799  18227
  v103  def   18108
  v104  def   22502
        use   18348
  16899 b. e12
  19847 e.
  e0    def   18418
        use   18554
  e1    def   18419
        use   17857
  e2    def   18420
        use   17835
  e3    def   18421
        use   17675
  e4    def   18422
        use   17631  17672  17681  17716
  e5    def   18423
        use   18464
  e6    def   18556
        use   18894
  e7    def   17837
        use   18563
  e8    def   18816
        use   18513
  e9    def   19434
        use   18518
  e10   def   18509
        use   17561  17611
  e11   def   18514
        use   17470  17541  17803
  e12   def   18519
        use   19035  19677
  16901 b. m20, n20, s20
  18564 e.
  m0    def   17611
        use   17582  17606  17695
  m1    def   17803
        use   17828  17868  17873
  m2    def   17804
        use   17490  17495
  m3    def   17612
  m8    def   17590
        use   17710
  m10   def   17397
        use   17377
  m11   def   17445
        use   17419
  m12   def   17497
        use   17422
  m13   def   17429
        use   17423
  m14   def   17501
        use   17424  17425
  m15   def   17511
        use   17427
  m16   def   17519
        use   17712  17891
  n0    def   17903
        use   17635
  n1    def   17977
        use   17861  18095
  n2    def   18035
        use   17483  17553  17573
  n4    def   18062
        use   17579  17603
  n5    def   18086
        use   17452  17531
  n12   def   18109
        use   17831  17869  18246
  n14   def   18131
        use   17430  17456  17533  17591
  n15   def   18182
        use   17781  18141  18165
  n16   def   18238
        use   17776  17795  18133
  n17   def   18161
        use   17750  17788
  n18   def   18266
        use   17745
  n19   def   18364
        use   18285  18325
  s0    def   16992
        use   16993  17248  17253  17255  17257  17262
  s1    def   16993
        use   16994  17249  17252  17259
  s2    def   16997
        use   16999  17211  17212  17286  17380
  s3    def   16999
        use   17211  17287  17382
  s4    def   16994
        use   16995
  s5    def   16995
        use   16997  17258
  s6    def   17005
        use   17006  17278  17282  17322  17324  17326
  s7    def   17006
        use   17010  18087  18090
  s16   def   17004
        use   17004  17005  17401  17486  18551
  s17   def   17004
        use   17403  17463
  17009 b. i0
  17066 e.
  i0    def   17010  17012  17013  17014  17015  17016  17018
              17020  17021  17022  17023  17024  17026  17027
              17028  17029  17030  17032  17033  17034  17035
              17036  17040  17041  17042  17043  17044  17046
              17048  17049  17050  17051  17052  17054  17055
              17056  17057  17058  17060  17061  17062  17063
              17064
        use   17012  17012  17013  17013  17014  17014  17015
              17015  17016  17016  17018  17018  17020  17020
              17020  17021  17021  17022  17022  17023  17023
              17024  17024  17026  17026  17026  17027  17027
              17028  17028  17028  17029  17029  17029  17030
              17030  17032  17032  17033  17033  17034  17034
              17034  17035  17035  17035  17036  17036  17040
              17040  17041  17041  17042  17042  17043  17043
              17044  17044  17046  17046  17048  17048  17048
              17049  17049  17050  17050  17051  17051  17052
              17052  17052  17054  17054  17054  17055  17055
              17056  17056  17056  17057  17057  17057  17058
              17058  17060  17060  17061  17061  17062  17062
              17062  17063  17063  17063  17064  17064  17065
  17192 b. i0, j1
  17229 e.
  i0    def   17228
        use   17195  17222  17226
  j0    def   17224
        use   17200  17207  17217
  17237 b. i6, j6
  17295 e.
  i0    def   17291
        use   17245  17268
  i1    def   17292
        use   17239  17244  17269
  i2    def   17293
  i3    def   17294
        use   17240  17290
  j0    def   17244
        use   17260
  j1    def   17252
  j2    def   17262
        use   17250
  j3    def   17269
        use   17275
  j4    def   17276
        use   17270
  j5    def   17256
  j6    def   17288
        use   17280  17284
  17318 b. i0
  17331 e.
  i0    def   17330
        use   17320  17327
  17364 b. i10, j10
  17387 e.
  i0    def   17367
        use   17374
  j10   def   17378
        use   17370
  17389 b. i10, j10
  17607 e.
  i2    def   17390
        use   17578
  i4    def   17393
        use   17446
  i5    def   17394
        use   17404  17437  17447
  i6    def   17391
  i7    def   17392
        use   17602
  j0    def   17532
        use   17555  17577
  j1    def   17556
        use   17575
  j2    def   17455
        use   17485
  17405 b. f1
  17415 e.
  f0    def   17409
        use   17406
  f1    def   17414
        use   17410
  17471 b. f1
  17481 e.
  f0    def   17475
        use   17472
  f1    def   17480
        use   17476
  17521 b. f1
  17530 e.
  f0    def   17525
        use   17522
  f1    def   17529
        use   17526
  17543 b. f1
  17552 e.
  f0    def   17547
        use   17544
  f1    def   17551
        use   17548
  17563 b. f1
  17572 e.
  f0    def   17567
        use   17564
  f1    def   17571
        use   17568
  17592 b. f1
  17601 e.
  f0    def   17596
        use   17593
  f1    def   17600
        use   17597
  17610 b. i10, j20
  17800 e.
  i0    def   17799
        use   17796
  j0    def   17633
        use   17628
  j1    def   17681
        use   17656
  j2    def   17684
        use   17646  17653
  j3    def   17685
        use   17673  17717
  j4    def   17686
        use   17634  17751  17789  17797
  j5    def   17687
        use   17683
  j6    def   17688
        use   17680
  j7    def   17674
        use   17659
  j8    def   17696
        use   17625
  j9    def   17726
        use   17638
  j10   def   17762
        use   17640
  j11   def   17794
        use   17642
  17613 b. f1
  17623 e.
  f0    def   17617
        use   17614
  f1    def   17622
        use   17618
  17660 b. f1
  17671 e.
  f0    def   17664
        use   17661
  f1    def   17670
        use   17665
  17697 b. f1
  17708 e.
  f0    def   17701
        use   17698  17703
  f1    def   17707
        use   17702  17704
  17727 b. f1
  17737 e.
  f0    def   17731
        use   17728
  f1    def   17736
        use   17732
  17763 b. f1
  17773 e.
  f0    def   17767
        use   17764
  f1    def   17772
        use   17768
  17802 b. i10, j10
  17894 e.
  j0    def   17830
        use   17825
  j1    def   17838
        use   17822  17834  17870
  j2    def   17819
        use   17893
  j3    def   17869
        use   17860
  j4    def   17871
        use   17840
  j5    def   17874
  j6    def   17875
        use   17817
  17805 b. f1
  17815 e.
  f0    def   17809
        use   17806
  f1    def   17814
        use   17810
  17876 b. f1
  17889 e.
  f0    def   17880
        use   17877  17882  17883  17885
  f1    def   17888
        use   17881
  17902 b. i10
  17969 e.
  i0    def   17964
  i1    def   17965
        use   17904  17962
  i2    def   17966
        use   17914  17917
  i3    def   17967
        use   17926
  i4    def   17968
        use   17953
  i10   def   17938
        use   17934
  17976 b. i10
  18024 e.
  i0    def   18023
        use   17978  18022
  18034 b. i2
  18054 e.
  i0    def   18051
  i1    def   18052
        use   18044  18049
  i2    def   18053
        use   18045  18050
  18061 b. i4
  18078 e.
  i0    def   18072
        use   18062  18071
  i1    def   18073
        use   18068
  i2    def   18074
        use   18064
  i3    def   18076
        use   18066
  18085 b. i1
  18099 e.
  i0    def   18097
        use   18086  18096
  i1    def   18098
        use   18088
  18107 b. i6
  18116 e.
  i0    def   18114
        use   18112
  i1    def   18115
        use   18109  18113
  18130 b. i10, j10
  18228 e.
  i0    def   18221
        use   18198
  i1    def   18222
        use   18182
  i2    def   18223
  i3    def   18224
        use   18183  18188
  i4    def   18225
        use   18206  18219
  i5    def   18226
        use   18218
  i6    def   18227
  i7    def   18145
        use   18144
  i8    def   18146
        use   18131  18143  18164  18168  18207
  i9    def   18171
        use   18162  18169
  j0    def   18186
        use   18191  18196  18202  18220
  j1    def   18206
        use   18200
  j2    def   18218
        use   18211  18214
  j3    def   18219
        use   18216
  j4    def   18136
        use   18139
  j5    def   18212
        use   18209
  j6    def   18217
        use   18210
  j7    def   18197
        use   18195
  18236 b. i3
  18252 e.
  i0    def   18248
        use   18238  18247
  i1    def   18249
        use   18239
  i2    def   18250
        use   18242  18244
  i3    def   18251
        use   18243
  18265 b. i10, j10
  18372 e.
  i1    def   18277
        use   18314
  i2    def   18301
        use   18297
  i3    def   18309
        use   18282  18286
  i4    def   18319
        use   18333
  i5    def   18332
        use   18326
  i6    def   18336
        use   18274  18321
  j0    def   18341
  j1    def   18342
        use   18267  18284  18324
  j2    def   18343
        use   18288  18310  18338
  j3    def   18344
        use   18268  18339
  j4    def   18345
  j5    def   18346
        use   18270  18336
  j6    def   18347
        use   18277  18289  18293  18311  18323  18332
  j7    def   18348
        use   18290
  j8    def   18349
        use   18317  18320
  18417 b. i10, j10
  18499 e.
  i0    def   18496
        use   18425  18495
  i10   def   18497
        use   18429  18474
  j0    def   18450
        use   18447  18498
  18428 b. f1
  18444 e.
  f0    def   18433
        use   18430  18438
  f1    def   18443
        use   18434
  18468 b. f1, j6
  18494 e.
  f0    def   18472
        use   18469
  f1    def   18493
        use   18473
  j0    def   18482
        use   18476
  j1    def   18484
        use   18477
  j2    def   18487
        use   18478
  j3    def   18490
        use   18479  18480  18481
  j6    def   18492
        use   18483  18486  18489
  18524 b. i0, q5
  18542 e.
  q0    def   18531
        use   18525
  q1    def   18532
        use   18526
  q2    def   18535
        use   18527
  q3    def   18536
        use   18528
  q4    def   18539
        use   18529
  q5    def   18540
        use   18530
  18573 b. c6, n5, s16
  19181 e.
  c0    def   18617
        use   18645  18827  18879
  c1    def   18621
  c2    def   18626
        use   18853
  c3    def   18630
        use   19141  19154
  c4    def   18634
        use   19143  19145  19147  19149  19156
  c5    def   18638
  c6    def   18642
        use   18645  18880
  n0    def   19058
        use   18935
  n1    def   19108
        use   18825  18850
  n2    def   19127
        use   18856
  n3    def   19169
        use   18822
  s0    def   18591
        use   18595  18622  18655  18715  18716  18780  19129
              19130
  s1    def   18595
        use   18599  18639  19062  19078  19131  19132
  s2    def   18599
        use   18600  18627  18659  18718  18775  19015  19066
              19111  19134
  s3    def   18600
        use   18601  18618  18651  18730  18922  19116
  s4    def   18601
        use   18602  19020  19021  19075  19170
  s5    def   18602
        use   18603  18857  19139  19152
  s6    def   18603
        use   18604  19009  19024  19114
  s7    def   18604
        use   18606  18697  18833  18833  18834  19174
  s10   def   18606
        use   18611  18989  18990  18993  18995
  s12   def   18611
        use   18612
  s13   def   18612
        use   18645  18954
  s14   def   18645
        use   18646  18955
  18669 b. i10, m20
  19039 e.
  i0    def   19036
        use   19017
  i1    def   19037
        use   18868
  i2    def   19038
        use   18855  18861  18869
  m0    def   18825
        use   19006  19010
  m1    def   18852
        use   18851  19002  19003
  m2    def   18855
        use   18828
  m3    def   18829
        use   18824
  m5    def   18884
        use   18849
  m6    def   18850
        use   18933
  m8    def   18891
        use   18931
  m9    def   18892
        use   18887  18932
  m10   def   18935
        use   18934
  m11   def   19007
        use   18999
  m12   def   19008
        use   19000
  m13   def   19011
        use   18985
  m15   def   19015
        use   18960
  m16   def   19019
        use   19004  19005  19013
  m17   def   19022
        use   18890  19014
  m18   def   18703
        use   18929
  m19   def   18762
        use   18930
  18670 b. j10
  18813 e.
  j0    def   18678
        use   18812
  j1    def   18707
        use   18693
  j5    def   18789
  j6    def   18790
        use   18727  18761
  j7    def   18791
        use   18705  18760  18788
  18679 b. f1
  18691 e.
  f0    def   18683
        use   18680
  f1    def   18690
        use   18684
  18741 b. f1
  18751 e.
  f0    def   18745
        use   18742
  f1    def   18750
        use   18746
  18792 b. f1
  18803 e.
  f0    def   18796
        use   18793
  f1    def   18802
        use   18797
  18839 b. f1
  18848 e.
  f0    def   18843
        use   18840
  f1    def   18847
        use   18844
  18862 b. f1
  18872 e.
  f0    def   18866
        use   18863
  f1    def   18871
        use   18867
  18873 b. f1
  18883 e.
  f0    def   18877
        use   18874
  f1    def   18882
        use   18878
  18897 b. f1
  18914 e.
  f0    def   18901
        use   18898
  f1    def   18913
        use   18902
  18915 b. f1
  18925 e.
  f0    def   18919
        use   18916
  f1    def   18924
        use   18920
  18937 b. f2
  18947 e.
  f0    def   18941
        use   18938
  f1    def   18946
        use   18942
  18948 b. f1
  18958 e.
  f0    def   18952
        use   18949
  f1    def   18957
        use   18953
  18961 b. f1
  18979 e.
  f0    def   18965
        use   18962  18973
  f1    def   18978
        use   18966
  19025 b. f1
  19034 e.
  f0    def   19029
        use   19026
  f1    def   19033
        use   19030
  19057 b. i1, j20
  19100 e.
  i0    def   19098
        use   19058  19097
  i1    def   19099
        use   19064
  j0    def   19082
        use   19065
  j1    def   19086
        use   19061
  j3    def   19074
        use   19068
  j10   def   19096
        use   19081
  j11   def   19095
        use   19080
  j12   def   19094
        use   19073  19084
  j14   def   19093
        use   19087
  j15   def   19092
        use   19085  19088
  j16   def   19091
        use   19070
  j17   def   19090
        use   19072
  j18   def   19089
        use   19077
  19107 b. i0
  19119 e.
  i0    def   19118
        use   19108  19117
  19126 b. i0, j1
  19159 e.
  i0    def   19158
        use   19127  19150  19157
  j0    def   19151
        use   19137
  j1    def   19157
  19168 b. i1, j0
  19180 e.
  i0    def   19178
        use   19177
  i1    def   19179
        use   19169  19176
  j0    def   19172
        use   19175
  19183 b. c16, n5, s16
  19835 e.
  c0    def   19234
        use   19261  19452  19459
  c1    def   19238
        use   19795  19808
  c2    def   19242
        use   19797  19799  19801  19803  19810
  c3    def   19246
  c4    def   19250
  c5    def   19254
  c6    def   19258
        use   19261  19460
  c10   def   19267
        use   19354
  c11   def   19271
        use   19345  19350  19357  19358
  c12   def   19279
        use   19326  19358  19359  19371
  n0    def   19706
        use   19585
  n1    def   19756
        use   19447
  n2    def   19781
        use   19448
  n3    def   19821
        use   19442
  s0    def   19201
        use   19205  19247  19276  19328  19329  19385  19710
              19783  19784  19822
  s1    def   19205
        use   19209  19255  19713  19716  19785  19786
  s2    def   19209
        use   19210  19235  19268  19353  19770
  s3    def   19210
        use   19211  19251  19280  19331  19401  19540  19587
              19731  19788
  s4    def   19211
        use   19212  19663  19664  19762  19829
  s5    def   19212
        use   19213  19450  19793  19806
  s6    def   19213
        use   19214  19494  19495  19826
  s7    def   19214
        use   19216  19314  19494
  s10   def   19216
        use   19221  19436  19643  19645  19648  19649
  s11   def   19221
        use   19223  19474  19565
  s12   def   19223
        use   19229  19566
  s13   def   19229
        use   19261  19608
  s14   def   19261
        use   19262  19609
  19286 b. i10, m20
  19685 e.
  i0    def   19678
        use   19589
  i1    def   19681
        use   19471  19475  19561  19580
  i2    def   19683
        use   19562  19581
  m0    def   19445
        use   19550  19551  19654  19655  19659  19660
  m1    def   19488
        use   19444
  m4    def   19486
        use   19656  19657  19658  19661
  m5    def   19487
  m9    def   19511
        use   19549
  m10   def   19553
        use   19552
  m11   def   19662
        use   19614
  m12   def   19665
        use   19485  19639  19651
  m15   def   19318
        use   19547
  m16   def   19383
        use   19548
  19287 b. j10
  19431 e.
  j0    def   19295
        use   19430
  j1    def   19323
        use   19310
  j2    def   19336
  j3    def   19356
        use   19335
  j4    def   19359
        use   19349
  j5    def   19361
        use   19355
  j6    def   19408
        use   19343  19381
  j7    def   19409
        use   19320  19382  19406
  19296 b. f1
  19308 e.
  f0    def   19300
        use   19297
  f1    def   19307
        use   19301
  19364 b. f1
  19374 e.
  f0    def   19368
        use   19365
  f1    def   19373
        use   19369
  19410 b. f1
  19421 e.
  f0    def   19414
        use   19411
  f1    def   19420
        use   19415
  19453 b. f1
  19463 e.
  f0    def   19457
        use   19454
  f1    def   19462
        use   19458
  19465 b. f1
  19477 e.
  f0    def   19469
        use   19466  19476
  f1    def   19476
        use   19470
  19500 b. f1
  19509 e.
  f0    def   19504
        use   19501
  f1    def   19508
        use   19505
  19515 b. f1
  19532 e.
  f0    def   19519
        use   19516
  f1    def   19531
        use   19520
  19533 b. f1
  19543 e.
  f0    def   19537
        use   19534
  f1    def   19542
        use   19538
  19555 b. f1
  19583 e.
  f0    def   19559
        use   19556  19582
  f1    def   19582
        use   19560
  19591 b. f2
  19601 e.
  f0    def   19595
        use   19592
  f1    def   19600
        use   19596
  19602 b. f1
  19612 e.
  f0    def   19606
        use   19603
  f1    def   19611
        use   19607
  19615 b. f1
  19633 e.
  f0    def   19619
        use   19616  19627
  f1    def   19632
        use   19620
  19667 b. f1
  19676 e.
  f0    def   19671
        use   19668
  f1    def   19675
        use   19672
  19705 b. i0, j20
  19748 e.
  i0    def   19747
        use   19706  19746
  j0    def   19720
        use   19715
  j1    def   19726
        use   19709
  j2    def   19731
        use   19718
  j10   def   19745
        use   19736
  j11   def   19744
        use   19719  19724
  j12   def   19743
        use   19722
  j13   def   19742
        use   19712
  j14   def   19741
        use   19727
  j15   def   19740
        use   19725  19730
  j16   def   19739
        use   19733
  j17   def   19738
        use   19735
  j18   def   19737
        use   19729
  19755 b. i0, j1
  19773 e.
  i0    def   19772
        use   19756  19771
  j0    def   19766
        use   19759
  j1    def   19769
        use   19765
  19780 b. i0, j0
  19813 e.
  i0    def   19812
        use   19781  19804  19811
  j0    def   19805
        use   19791
  19820 b. i1, j0
  19834 e.
  i0    def   19832
        use   19831
  i1    def   19833
        use   19821  19830
  j0    def   19824
        use   19827
  19861 b. i30
  19886 e.
  i0    def   19862
        use   19864  19868
  i1    def   19862
        use   19868
  i2    def   19874
        use   19881
  i3    def   19881
        use   19885
  i10   def   19868  19869  19870  19871  19872  19873
        use   19869  19869  19870  19870  19871  19871  19872
              19872  19873  19873  19877
  i11   def   19873
        use   19873  19877
  i12   def   19872
        use   19872  19876
  i13   def   19871
        use   19871  19876
  i14   def   19870
        use   19870  19875
  i15   def   19869
        use   19869  19875
  i20   def   19868  19869  19870  19871  19872  19873
        use   19869  19869  19870  19870  19871  19871  19872
              19872  19873  19873  19880
  i21   def   19873
        use   19873  19880
  i22   def   19872
        use   19872  19879
  i23   def   19871
        use   19871  19879
  i24   def   19870
        use   19870  19878
  i25   def   19869
        use   19869  19878
  19889 b. u100
  25657 e.
  u0    def   21952
        use   21953
  u1    def   21953
        use   22035
  u2    def   22821  24760
        use   22798  22919  23303  23458  23710  23751  23752
              23771  23787  23789  23866  24068  24075  24085
              24089  24110  24158  24166  24184  24199  24219
              24262  24349  24467  24473  24540  24541  24561
              24583  24610  24760  24923  24934  25022  25030
              25091  25097  25104  25118  25122  25140  25181
              25182  25318  25326  25331  25385  25386  25400
              25411  25413  25544  25547  25597  25598  25617
              25633  25635
  u3    def   22916  23658  25270
        use   20258  23052  23658  23731  23904  24496  24512
              24521  25052  25068  25270  25349  25364  25366
              25568
  u4    def   22014  22932  23659  25272
        use   22931  23659  23709  23865  24460  24917  25272
              25315  25531
  u5    def   22098
        use   23512  23588  23622
  u6    def   22160
        use   22704
  u7    def   22165
        use   23510  23587
  u8    def   22203  22934
        use   22853  22933  23128  25088
  u9    def   22224
        use   22367  23169  24004
  u10   def   22244
        use   23192
  u11   def   22268
        use   21445  23297  23440  24135
  u12   def   22298  22936  23660  25271
        use   20259  20459  20538  20880  21026  22875  22935
              23660  23729  23902  24494  25050  25271  25347
              25477  25566
  u13   def   22366
        use   22961
  u14   def   22403  23665  25273
        use   21319  22475  23665  25273  25536
  u15   def   22425  22938
        use   21061  22937  23500  23566  25106
  u16   def   22452
        use   23021  23062
  u18   def   22503
        use   21051  22559  23132  23148  23296  23438
  u19   def   22541
        use   22542
  u20   def   22621  23661  24761
        use   23661  23728  23896  24493  24761  25049  25346
              25565
  u21   def   22662  23662  24762
        use   20537  23051  23334  23662  24511  24762  25067
              25360
  u22   def   22324
        use   24323  24754
  u23   def   22765
        use   23250  23427  23646
  u24   def   22794
        use   23251  23275  23428  23436  23647
  u25   def   22728
        use   22631  22981  24009
  u30   def   22959  23663  25274
        use   23663  23733  23940  24504  25054  25274  25356
              25570
  u31   def   23019
        use   22966
  u32   def   23049
        use   22968
  u33   def   23081
        use   22969
  u40   def   23122  25275
        use   20457  23750  24067  24539  25090  25275  25384
              25596
  u41   def   22267
        use   20458
  u50   def   23248  23664
        use   23664  23770  24106  24560  25139  25399  25616
  u51   def   23331
        use   23307
  u53   def   23379
        use   23308
  u60   def   23418
        use   23786  24156  24582  25180  25410  25632
  u61   def   23488
        use   23464
  u62   def   23538
        use   23466
  u63   def   23609
        use   23467
  u64   def   23643
        use   23422
  19899 b. s120
  21898 e.
  s0    def   19917
        use   19917  19918  19945  19996  20045  21442
  s1    def   19917
        use   19955  19959  19999  20024  20027  20143  20217
              20243  20264  20377  20413  21339  21343  21469
  s2    def   19918
        use   19919  20005  20485  21313  21318
  s3    def   19919
        use   19920  20004  20220  21317  21430  21471
  s4    def   19920
        use   19920  19921  19960  19976  20381  20850  21012
              21335  21444
  s5    def   19920
        use   19991  20029
  s6    def   19921
        use   19922  19978  20364  20844  20964  21349
  s7    def   19922
        use   19922  19923  19980  20366  21347
  s8    def   19922
        use   19982  20368  20845  21345
  s9    def   19923
        use   19924  19987  20834  20907  21288
  s10   def   19924
        use   19924  19984  20012  20161  20349  20382  20840
              20852  20914  21034  21337
  s11   def   19924
        use   19989  20835  21290
  s16   def   20098
        use   20098  20099
  s17   def   20098
  s18   def   20099
        use   20099  20100
  s19   def   20099
  s20   def   20100
        use   20100  20101
  s21   def   20100
  s22   def   20101
        use   20101  20102
  s23   def   20101
  s24   def   20102
        use   20102  20103
  s25   def   20102
  s26   def   20103
        use   20104
  s28   def   20104
        use   20104  20105
  s29   def   20104
  s30   def   20105
  s31   def   19925
        use   20006  20218  20219  21009  21010  21101  21105
              21493  21494
  s100  def   20084
        use   20086  20329  20330  21172  21178  21187  21196
              21198  21200  21295
  s101  def   20085
        use   20086  20087  20330  20524  21304
  s102  def   20086
        use   20515  21220  21224  21230  21234  21240  21247
              21249
  s103  def   20087
  19901 b. i10, j10
  20053 e.
  i0    def   19941
        use   19952
  i1    def   19942
        use   19946
  i2    def   19943
        use   19948
  i3    def   19944
        use   19951
  i10   def   20052
        use   20046
  j0    def   19963
        use   19967
  j1    def   19996
        use   19957
  j2    def   20009
        use   19998
  j3    def   20027
        use   20008  20018
  j4    def   20045
        use   19974
  j5    def   20019
        use   20011
  20056 b. n130, q10, r40, t10
  21897 e.
  n0    def   21092
        use   20300  20308  20337
  n1    def   21093
        use   20210  21008  21492
  n2    def   21156
        use   20320  20345
  n3    def   21219
        use   20950  21490
  n4    def   21286
        use   20294
  n5    def   21293
        use   20322
  n6    def   21310
        use   20386
  n8    def   21368
        use   20410
  n9    def   21369
        use   20463  20504  20829  20889  20895  20943  21044
              21066
  n10   def   21388
        use   20286  21352
  n11   def   21426
        use   20506  20879  21025
  n12   def   21465
        use   20395
  n13   def   21466
  n14   def   21467
        use   20391
  n18   def   21483
        use   20890  20896  21040
  n19   def   21506
        use   20221  21446  21472
  n20   def   21533
        use   20146
  n21   def   21553
        use   20147  20455  20512  20882  21028
  n22   def   21582
        use   20503
  n23   def   21559
        use   20741  20768  21555
  n24   def   21609
        use   20438  20803  20858  20918  20970  21038  21595
  n25   def   21699
        use   20361  20668
  n26   def   21736
        use   20574  20772
  n27   def   21763
        use   20422
  n30   def   21790
        use   20706  21005
  n31   def   21851
        use   21797  21813
  q0    def   20127
        use   20088
  q1    def   20227
        use   20089  20392  20396  20400
  q2    def   20404
        use   20090
  q3    def   20463
        use   20091
  q4    def   20542
        use   20092
  r0    def   20106
        use   21100  21101
  r1    def   20107
        use   21157
  r2    def   20107
        use   21161
  r3    def   20108
        use   21167
  r4    def   20108
  r5    def   20109
        use   21174
  r6    def   20110
        use   21197  21199
  r7    def   20111
        use   20311  20347  21179
  r8    def   20112
        use   20303  20312  20315  20340  21192
  r9    def   20113
        use   20317  20342  21188
  r10   def   20113
        use   20304  20319  20344  21183
  r11   def   20114
        use   20355  20363
  r20   def   20115
        use   20204  21104  21105
  r22   def   20116
        use   20167  20994  21223
  r24   def   20117
        use   20181  20996  21227
  r25   def   20118
        use   20185  20998  21229
  r26   def   20119
        use   20187  20189  21248  21250
  r27   def   20120
        use   20162  20992  21237  21251
  r28   def   20121
        use   20192  21244  21259
  r29   def   20122
        use   20194  21242  21246
  r30   def   20122
        use   20196  21239  21256
  r31   def   20123
        use   20197  20212  20925  20975  21029  21261
  r32   def   20124
        use   20205  20968  20990  21011  21233  21443
  20126 b. i10, j10
  20224 e.
  i0    def   20223
        use   20172  20179
  j0    def   20161
        use   20145
  j1    def   20176
        use   20180
  j4    def   20220
  20132 b. f1
  20142 e.
  f0    def   20136
        use   20133
  f1    def   20141
        use   20137
  20198 b. f1
  20208 e.
  f0    def   20202
        use   20199
  f1    def   20207
        use   20203
  20226 b. i10, j10, m20
  20401 e.
  i0    def   20246
        use   20245
  i1    def   20258
        use   20242
  i2    def   20259
        use   20227
  j0    def   20320
        use   20305  20313
  j1    def   20322
        use   20372
  j2    def   20383
        use   20379
  m0    def   20263
        use   20246  20247
  m2    def   20294
        use   20248  20254
  m3    def   20300
        use   20249  20250  20251
  m6    def   20308
        use   20252
  m7    def   20337
        use   20253
  m10   def   20376
        use   20256  20257
  m15   def   20389
        use   20360
  m16   def   20394
        use   20301  20309  20338  20384
  m17   def   20398
        use   20321  20346  20353
  20228 b. f1
  20240 e.
  f0    def   20232
        use   20229
  f1    def   20239
        use   20233
  20323 b. f1
  20333 e.
  f0    def   20327
        use   20324
  f1    def   20332
        use   20328
  20403 b. i5, j5
  20460 e.
  i0    def   20457
        use   20407
  i1    def   20458
        use   20423
  i2    def   20459
        use   20453
  j0    def   20441
        use   20412  20415  20424  20432
  j1    def   20425
        use   20408
  20442 b. f1
  20452 e.
  f0    def   20446
        use   20443
  f1    def   20451
        use   20447
  20462 b. i10, j10
  20539 e.
  i0    def   20537
        use   20482
  i1    def   20538
        use   20510
  j0    def   20507
        use   20483
  j1    def   20514
        use   20481
  j2    def   20533
        use   20498
  j3    def   20499
        use   20478
  20464 b. f1
  20474 e.
  f0    def   20468
        use   20465
  f1    def   20473
        use   20469
  20541 b. i10, j20, m20
  21068 e.
  i0    def   20559
        use   20558
  i1    def   20940
        use   20897  20935
  j0    def   20865
        use   20833  20839  21048  21067
  j1    def   20866
        use   20891  20938  21041  21063
  j2    def   21033
        use   20949
  j3    def   20921
        use   20905
  j4    def   20935
        use   20909  20919  20927
  j6    def   20907
        use   20902
  j7    def   20982
        use   20985
  j10   def   20863
        use   20849  20856
  j15   def   20953
        use   20962  20966  20969  20971
  j16   def   20974
        use   20956
  j17   def   20963
        use   20960
  m0    def   20574
        use   20559
  m1    def   20772
        use   20560
  m2    def   20829
        use   20561
  m3    def   20889
        use   20562  20563  20564  20567
  m6    def   20894
        use   20565
  m7    def   20943
        use   20566
  m10   def   21044
        use   20569
  m11   def   21066
        use   20570
  20545 b. f1
  20556 e.
  f0    def   20549
        use   20546
  f1    def   20555
        use   20550
  20573 b. i10, j20
  20826 e.
  i0    def   20821
        use   20742
  i1    def   20822
        use   20632  20666  20683  20725
  i2    def   20823
  i3    def   20824
        use   20592
  i4    def   20825
        use   20597
  j2    def   20654
        use   20660
  j3    def   20641
        use   20649  20652  20657
  j4    def   20640
        use   20607
  j5    def   20662
        use   20627
  j6    def   20604
        use   20614  20617  20624
  j8    def   20718
        use   20635
  j9    def   20749
  j10   def   20746
  j12   def   20747
        use   20795  20802
  j13   def   20748
        use   20644
  j14   def   20764
        use   20816
  j20   def   20817
  20707 b. f1
  20717 e.
  f0    def   20711
        use   20708
  f1    def   20716
        use   20712
  20729 b. f1
  20740 e.
  f0    def   20733
        use   20730  20735
  f1    def   20739
        use   20734
  20750 b. f1
  20761 e.
  f0    def   20754
        use   20751
  f1    def   20760
        use   20755
  20804 b. f1
  20814 e.
  f0    def   20808
        use   20805
  f1    def   20813
        use   20809
  20867 b. f1
  20878 e.
  f0    def   20871
        use   20868
  f1    def   20877
        use   20872
  21013 b. f1
  21024 e.
  f0    def   21017
        use   21014
  f1    def   21023
        use   21018
  21091 b. i2
  21108 e.
  i0    def   21099
        use   21107
  i1    def   21103
        use   21093  21107
  i2    def   21107
        use   21092
  21155 b. i10
  21208 e.
  i0    def   21203
        use   21156  21160  21164  21169  21176  21181  21185
              21190  21194  21201
  i4    def   21204
        use   21168
  i5    def   21205
        use   21184  21189
  i6    def   21206
        use   21180
  i7    def   21207
        use   21175  21193
  21218 b. i5
  21266 e.
  i0    def   21263
        use   21219  21262
  i4    def   21264
        use   21222
  i5    def   21265
        use   21232  21236
  21285 b. i5, j5
  21359 e.
  i0    def   21357
        use   21312  21351
  i1    def   21358
        use   21286  21293  21310  21356
  j0    def   21335
        use   21292  21309
  j1    def   21339
  21367 b.
  21378 e.
  21387 b. i0, j1
  21417 e.
  i0    def   21416
        use   21388  21408  21415
  j0    def   21395
        use   21401
  j1    def   21402
  21425 b. i0
  21456 e.
  i0    def   21455
        use   21426  21454
  21464 b. i0
  21475 e.
  i0    def   21474
        use   21468  21473
  21482 b. i4, j4
  21497 e.
  i0    def   21496
        use   21483  21495
  j0    def   21493
        use   21489
  21505 b. i0
  21524 e.
  i0    def   21522
        use   21513  21521
  21532 b. i0
  21539 e.
  i0    def   21538
        use   21533  21537
  21552 b. i1
  21574 e.
  21581 b. i4
  21598 e.
  i0    def   21597
        use   21582  21591  21596
  21607 b. i6, j5
  21691 e.
  i0    def   21684
        use   21610  21683
  i1    def   21685
        use   21611  21682
  i2    def   21686
        use   21624
  i3    def   21687
        use   21634  21666
  i4    def   21688
        use   21633  21635
  i5    def   21689
        use   21629  21651  21664
  i6    def   21690
        use   21650  21661
  j0    def   21677
        use   21681
  j1    def   21682
  j2    def   21669
        use   21627  21636  21665
  j3    def   21634
        use   21668
  j4    def   21646
        use   21642
  j5    def   21666
        use   21639  21645
  21612 b. f1
  21623 e.
  f0    def   21616
        use   21613
  f1    def   21622
        use   21617
  21698 b. i10, j10
  21726 e.
  i0    def   21723
        use   21699  21722
  i1    def   21724
        use   21721
  i2    def   21725
        use   21700
  j0    def   21703
        use   21706
  21735 b. i0
  21753 e.
  i0    def   21752
        use   21736  21751
  21762 b. i5
  21896 e.
  i0    def   21778
        use   21763  21777
  i1    def   21779
        use   21764  21776
  i3    def   21773
        use   21767
  21789 b. i10, j10
  21826 e.
  i0    def   21818
        use   21812
  i1    def   21819
        use   21791
  i2    def   21820
        use   21798
  i3    def   21821
        use   21792  21815
  i5    def   21822
        use   21806
  i6    def   21824
        use   21809
  j1    def   21809
        use   21801
  21836 b. i10, j10
  21895 e.
  i0    def   21837
        use   21859  21869
  i1    def   21844
        use   21856  21871  21880  21887
  i2    def   21845
        use   21865  21892
  i3    def   21846
        use   21874  21884  21885
  i4    def   21847
        use   21853  21866  21872
  i5    def   21848
        use   21875
  i6    def   21849
        use   21854  21893
  j1    def   21859
        use   21863
  j2    def   21866
        use   21890
  j3    def   21887
        use   21882
  21908 b. i30
  21933 e.
  i0    def   21909
        use   21911  21915
  i1    def   21909
        use   21915
  i2    def   21921
        use   21928
  i3    def   21928
        use   21932
  i10   def   21915  21916  21917  21918  21919  21920
        use   21916  21916  21917  21917  21918  21918  21919
              21919  21920  21920  21924
  i11   def   21920
        use   21920  21924
  i12   def   21919
        use   21919  21923
  i13   def   21918
        use   21918  21923
  i14   def   21917
        use   21917  21922
  i15   def   21916
        use   21916  21922
  i20   def   21915  21916  21917  21918  21919  21920
        use   21916  21916  21917  21917  21918  21918  21919
              21919  21920  21920  21927
  i21   def   21920
        use   21920  21927
  i22   def   21919
        use   21919  21926
  i23   def   21918
        use   21918  21926
  i24   def   21917
        use   21917  21925
  i25   def   21916
        use   21916  21925
  22012 b. i10, j10
  22080 e.
  i0    def   22048
        use   22046
  i1    def   22060
        use   22047
  i2    def   22030
        use   22024
  j0    def   22077
        use   22014  22076
  j1    def   22078
        use   22015  22021  22033
  j2    def   22079
        use   22026  22029
  22063 b. f1
  22073 e.
  f0    def   22067
        use   22064
  f1    def   22072
        use   22068
  22096 b. i10, j10
  22133 e.
  i0    def   22111
        use   22102
  22114 b. f1
  22130 e.
  f0    def   22118
        use   22115
  f1    def   22129
        use   22119
  22158 b. i10, j10
  22188 e.
  j0    def   22186
        use   22165  22185
  j1    def   22187
        use   22178
  22201 b. i10, j10
  22209 e.
  22222 b. i10, j10
  22229 e.
  22242 b. i10, j10
  22251 e.
  22265 b. i10, j10
  22282 e.
  j0    def   22281
        use   22269  22280
  22296 b. i10, j10
  22349 e.
  i0    def   22326
        use   22346
  i1    def   22328
        use   22333
  i2    def   22332
        use   22327
  i3    def   22338
        use   22301
  i4    def   22339
        use   22330
  j0    def   22348
        use   22324  22336  22338  22342
  22364 b. i10, j10
  22387 e.
  j0    def   22385
        use   22368  22369
  j1    def   22386
        use   22366  22376  22384
  22401 b. i10, j10
  22409 e.
  j0    def   22408
        use   22403  22407
  22423 b. i10, j10
  22434 e.
  j0    def   22432
        use   22425  22431
  j1    def   22433
        use   22427
  22450 b. i10, j10
  22484 e.
  i0    def   22467
        use   22463
  i1    def   22475
        use   22471
  j0    def   22482
        use   22452  22481
  j1    def   22483
        use   22460  22461
  22500 b. i10, j10
  22523 e.
  j0    def   22521
        use   22511  22520
  j1    def   22522
        use   22515  22518
  22539 b. i10, j10
  22601 e.
  i0    def   22578
        use   22584
  i1    def   22582
        use   22576
  i2    def   22558
        use   22575
  i3    def   22570
        use   22566
  i4    def   22591
        use   22587
  j0    def   22598
        use   22543  22597
  j1    def   22599
        use   22558  22560
  j2    def   22600
        use   22545  22595
  22547 b. f1
  22557 e.
  f0    def   22551
        use   22548
  f1    def   22556
        use   22552
  22619 b. i10, j10
  22639 e.
  22660 b. i10, j10
  22709 e.
  i0    def   22666
        use   22670
  i1    def   22667
        use   22665
  i2    def   22682
        use   22675
  i3    def   22685
        use   22679
  j0    def   22707
        use   22663  22682  22706
  j1    def   22708
        use   22677  22687
  22693 b. f1
  22703 e.
  f0    def   22697
        use   22694
  f1    def   22702
        use   22698
  22726 b. i10, j10
  22746 e.
  j0    def   22745
        use   22729  22744
  22763 b. i10, j10
  22779 e.
  22792 b. i10, j10
  22799 e.
  22819 b. i10, j10
  22901 e.
  i0    def   22894
        use   22851  22874
  22823 b. f1
  22833 e.
  f0    def   22827
        use   22824
  f1    def   22832
        use   22828
  22839 b. f1
  22849 e.
  f0    def   22843
        use   22840
  f1    def   22848
        use   22844
  22855 b. f1
  22865 e.
  f0    def   22859
        use   22856
  f1    def   22864
        use   22860
  22876 b. f1
  22886 e.
  f0    def   22880
        use   22877
  f1    def   22885
        use   22881
  22914 b. i10, j10
  22920 e.
  22957 b. i10, j10
  23003 e.
  i0    def   22972
        use   22962
  i1    def   22988
        use   22984
  j0    def   23002
        use   22960  23001
  22989 b. f1
  22999 e.
  f0    def   22993
        use   22990
  f1    def   22998
        use   22994
  23017 b. i10, j10
  23029 e.
  j0    def   23028
        use   23020  23027
  23047 b. i10, j10
  23065 e.
  j0    def   23064
        use   23049  23063
  23079 b. i10, j10
  23099 e.
  j0    def   23098
        use   23081  23097
  23120 b. i10, j10
  23216 e.
  i0    def   23177
        use   23138
  i1    def   23196
        use   23127
  i2    def   23153
        use   23142
  i3    def   23213
        use   23194
  j0    def   23215
        use   23123  23174  23213
  23156 b. f1
  23167 e.
  f0    def   23160
        use   23157
  f1    def   23166
        use   23161
  23178 b. f1
  23191 e.
  f0    def   23182
        use   23179
  f1    def   23190
        use   23183
  23197 b. f1
  23208 e.
  f0    def   23201
        use   23198
  f1    def   23207
        use   23202
  23246 b. i10, j10
  23310 e.
  i0    def   23289
        use   23273
  i1    def   23304
        use   23293
  j0    def   23309
        use   23249  23252  23304
  23260 b. f1
  23270 e.
  f0    def   23264
        use   23261
  f1    def   23269
        use   23265
  23276 b. f1
  23286 e.
  f0    def   23280
        use   23277
  f1    def   23285
        use   23281
  23329 b. i10, j10
  23358 e.
  i0    def   23350
        use   23335
  j0    def   23357
        use   23332  23356
  23377 b. i10, j10
  23392 e.
  23416 b. i10, j10
  23469 e.
  i0    def   23449
        use   23445
  i1    def   23459
        use   23452
  i2    def   23430
        use   23426
  j0    def   23468
        use   23424  23446  23462
  23486 b. i10, j10
  23514 e.
  i0    def   23506
        use   23499
  i1    def   23510
        use   23491
  j0    def   23513
        use   23489  23503  23511
  23536 b. i10, j10
  23591 e.
  i0    def   23572
        use   23565
  i1    def   23575
        use   23541
  j0    def   23590
        use   23539  23569  23589
  23547 b. f1
  23562 e.
  f0    def   23551
        use   23548  23556
  f1    def   23561
        use   23552
  23576 b. f1
  23586 e.
  f0    def   23580
        use   23577
  f1    def   23585
        use   23581
  23607 b. i10, j10
  23624 e.
  j0    def   23623
        use   23612
  23641 b. i10, j10
  23656 e.
  j0    def   23655
        use   23645  23654
  23668 b. q20, s10
  23808 e.
  q0    def   23708
        use   23686
  q1    def   23727
        use   23687
  q2    def   23750
        use   23688
  q3    def   23770
        use   23689
  q4    def   23786
        use   23690
  q5    def   23805
        use   23691
  23706 b. i10, j10
  23711 e.
  23725 b. i10, j10
  23735 e.
  23748 b. i10, j10
  23753 e.
  23768 b. i10, j10
  23772 e.
  23784 b. i10, j10
  23790 e.
  23803 b. i10, j10
  23807 e.
  23812 b. q20, s20
  24411 e.
  q0    def   23864
        use   23818
  q1    def   23895
        use   23819
  q2    def   24066
        use   23820
  q3    def   24105
        use   23821
  q4    def   24155
        use   23822
  q5    def   24371
        use   23823
  q10   def   23959
        use   23901
  q11   def   24004
        use   24046
  q12   def   24178
        use   24160
  q13   def   24211
        use   24165
  q14   def   24279
        use   24191  24248
  q15   def   24237
        use   24139
  s0    def   23827  23830  23831  23836
        use   23828  23829  23830  23830  23831  23833  23834
              23835  23836  23836  23838
  s1    def   23833
        use   23915  24041  24124  24228  24238  24373
  s2    def   23834
        use   23916  23923
  s3    def   23835
        use   23919
  s4    def   23836
        use   23920  23925  24017  24018  24082  24083  24233
  s5    def   23829
        use   23899  23929  24076  24078  24195  24251  24303
              24306  24309
  s6    def   23830
        use   23967  24070  24080  24376
  s7    def   23831
  s10   def   23843
        use   23900  23955  24194
  s11   def   23844
        use   23900  23956  24194
  s12   def   23845
        use   23900  23954  24250
  s13   def   23846
        use   23900  23928  23957
  s14   def   23847
        use   24307  24354  24374
  23825 b. j0
  23841 e.
  j0    def   23828
        use   23838
  23862 b. i10, j10
  23867 e.
  23893 b. i30, j20
  24047 e.
  i1    def   23912
        use   23909
  i2    def   23923
        use   23917
  i3    def   23925
        use   23921
  i4    def   23939
        use   23910  23922
  i5    def   24033
        use   24027
  i10   def   23953
        use   23960
  i11   def   23962
        use   23965
  i12   def   23963
        use   23961
  i13   def   23976
        use   23955
  i14   def   23977
        use   23936  23980
  i15   def   23978
        use   23980
  i16   def   23979
        use   23954
  i17   def   23980
        use   23935
  i18   def   24016
        use   23957
  i19   def   24029
        use   23956
  i20   def   23972
        use   23972
  i21   def   23973
        use   23973
  i22   def   23974
        use   23974
  i23   def   23975
        use   23975
  j0    def   23942
        use   23912  23933
  j16   def   23972
        use   23972  23976
  j17   def   23973
        use   23973  23976  23977
  j18   def   23974
        use   23974  23977  23978
  j19   def   23975
        use   23975  23978  23979
  24064 b. i10, j10
  24090 e.
  24103 b. i10, j10
  24140 e.
  24153 b. i10, j10
  24167 e.
  24176 b. i10, j10
  24200 e.
  i0    def   24187
        use   24190
  i1    def   24188
        use   24186
  i2    def   24194
        use   24181
  24209 b. i10, j10
  24265 e.
  i0    def   24250
        use   24216  24243
  i1    def   24230
        use   24234
  j0    def   24263
        use   24225
  j1    def   24264
        use   24221
  24277 b. i10, j10
  24357 e.
  i1    def   24299
  i2    def   24302
        use   24294
  i3    def   24322
        use   24328  24332
  i4    def   24323
        use   24321
  i5    def   24334
        use   24325
  j0    def   24350
        use   24316
  j1    def   24351
        use   24280  24286  24344
  j2    def   24352
        use   24285  24290  24295  24302  24346
  j3    def   24353
        use   24315  24329  24331  24337
  j4    def   24354
        use   24304  24308
  j5    def   24355
        use   24312
  j6    def   24356
        use   24330
  24369 b. i10, j10
  24410 e.
  i2    def   24407
        use   24385  24403
  i3    def   24408
        use   24384  24386
  j1    def   24403
        use   24390  24396
  j2    def   24406
        use   24379  24387  24402
  j3    def   24385
        use   24405
  j4    def   24397
        use   24393
  24417 b. q20, s10
  24756 e.
  q0    def   24460
        use   24423
  q1    def   24492
        use   24424
  q2    def   24538
        use   24425
  q3    def   24559
        use   24426
  q4    def   24581
        use   24427
  q5    def   24628
        use   24428
  q10   def   24662
        use   24581
  q11   def   24731
        use   24586
  q12   def   24732
        use   24705
  s0    def   24432  24434  24435  24436  24437  24438  24439
        use   24433  24434  24434  24435  24435  24436  24436
              24437  24437  24438  24439  24439  24441
  s1    def   24434
        use   24462  24733
  s2    def   24435
        use   24696
  s3    def   24436
        use   24518  24681  24690  24692  24698  24701  24744
  s4    def   24439
        use   24630
  s5    def   24437
        use   24514  24668  24738
  24430 b. j0
  24444 e.
  j0    def   24433
        use   24441
  24458 b. i10, j10
  24474 e.
  i0    def   24468
        use   24466
  24490 b. i10, j10
  24522 e.
  j0    def   24504
        use   24501
  j1    def   24514
        use   24503
  24536 b. i10, j10
  24542 e.
  24557 b. i10, j10
  24562 e.
  24579 b. i10, j10
  24613 e.
  i1    def   24591
        use   24609
  i2    def   24604
        use   24600
  i3    def   24608
        use   24597  24603
  i4    def   24610
        use   24592
  j1    def   24611
        use   24594  24608
  j2    def   24612
        use   24590  24591
  24626 b. i10, j10
  24632 e.
  24660 b. i10, j10
  24711 e.
  i0    def   24685
        use   24674
  i1    def   24693
        use   24689
  i2    def   24701
        use   24676  24682  24694
  i3    def   24707
        use   24703
  i4    def   24705
        use   24667
  j0    def   24710
        use   24662  24707
  24728 b. i10, j10
  24755 e.
  i0    def   24746
        use   24750
  i1    def   24748
        use   24745
  j0    def   24753
        use   24734  24752
  j1    def   24754
        use   24748
  24766 b. q20, s10
  25264 e.
  q0    def   24913
        use   24873
  q1    def   25048
        use   24874
  q2    def   25087
        use   24875
  q3    def   25139
        use   24876
  q4    def   25159
        use   24877
  q5    def   25201
        use   24878
  q10   def   25223
        use   25017  25120
  q11   def   24952
        use   24916
  q12   def   24893
        use   24928  24974  25203
  s0    def   24882  24884  24885  24886  24887
        use   24884  24885  24885  24886  24886  24887  24887
              24889
  s2    def   24885
        use   25009  25011  25228  25250
  s3    def   24886
        use   24987  25014  25227  25230  25251
  s4    def   24887
  24880 b. j0
  24892 e.
  j0    def   24883
        use   24889
  24911 b. i10, j10
  24935 e.
  i0    def   24924
        use   24922
  24950 b. i10, j10
  25031 e.
  i0    def   24963
        use   24960
  i1    def   25018
        use   24961
  i2    def   25025
        use   24966
  25046 b. i10, j10
  25070 e.
  i1    def   25060
        use   25058
  25085 b. i10, j10
  25124 e.
  i0    def   25105
        use   25103
  i1    def   25098
        use   25094
  j0    def   25123
        use   25089  25092  25108
  25137 b. i10, j10
  25141 e.
  25157 b. i10, j10
  25183 e.
  i0    def   25173
        use   25178
  i1    def   25180
        use   25166
  25199 b. i10, j10
  25207 e.
  25221 b. i10, j10
  25263 e.
  i0    def   25237
        use   25243
  i1    def   25245
        use   25240
  i2    def   25254
        use   25247
  j0    def   25259
        use   25233  25245
  j1    def   25260
        use   25223  25253  25257
  j2    def   25261
        use   25235  25242
  j3    def   25262
        use   25232  25239  25246
  25277 b. n10, q20, s10
  25489 e.
  n0    def   25437
        use   25332  25483
  n1    def   25461
        use   25363
  n2    def   25476
        use   25365
  q0    def   25314
        use   25290
  q1    def   25345
        use   25291
  q2    def   25384
        use   25292
  q3    def   25399
        use   25293
  q4    def   25410
        use   25294
  q5    def   25424
        use   25295
  s0    def   25297
        use   25316  25330  25368  25470
  25313 b. i10, j10
  25334 e.
  i0    def   25318
        use   25317
  j0    def   25321
  j1    def   25332
        use   25324  25328
  j2    def   25333
        use   25319
  25344 b. i10, j10
  25370 e.
  j0    def   25356
        use   25353  25369
  j1    def   25363
        use   25355
  25383 b. i10, j10
  25387 e.
  25398 b. i10, j10
  25401 e.
  25409 b. i10, j10
  25414 e.
  25423 b. i10, j10
  25426 e.
  25436 b.
  25443 e.
  25460 b. j4
  25473 e.
  j0    def   25463
        use   25467
  j1    def   25469
        use   25464
  25475 b. i6, j6
  25488 e.
  i0    def   25487
        use   25476  25479  25485
  j0    def   25477
        use   25484
  j1    def   25485
        use   25482
  25494 b. q20, s10
  25654 e.
  q0    def   25530
        use   25508
  q1    def   25564
        use   25509
  q2    def   25596
        use   25510
  q3    def   25616
        use   25511
  q4    def   25632
        use   25512
  q5    def   25651
        use   25513
  25528 b. i10, j10
  25548 e.
  j0    def   25545
        use   25540
  25562 b. i10, j10
  25581 e.
  25594 b. i10, j10
  25599 e.
  25614 b. i10, j10
  25618 e.
  25630 b. i10, j10
  25636 e.
  25649 b. i10, j10
  25653 e.
  25668 b. i30
  25693 e.
  i0    def   25669
        use   25671  25675
  i1    def   25669
        use   25675
  i2    def   25681
        use   25688
  i3    def   25688
        use   25692
  i10   def   25675  25676  25677  25678  25679  25680
        use   25676  25676  25677  25677  25678  25678  25679
              25679  25680  25680  25684
  i11   def   25680
        use   25680  25684
  i12   def   25679
        use   25679  25683
  i13   def   25678
        use   25678  25683
  i14   def   25677
        use   25677  25682
  i15   def   25676
        use   25676  25682
  i20   def   25675  25676  25677  25678  25679  25680
        use   25676  25676  25677  25677  25678  25678  25679
              25679  25680  25680  25687
  i21   def   25680
        use   25680  25687
  i22   def   25679
        use   25679  25686
  i23   def   25678
        use   25678  25686
  i24   def   25677
        use   25677  25685
  i25   def   25676
        use   25676  25685
  25695 b. i0
  25701 e.
  i0    def   25696
        use   25696  25698  25700
  25709 b. e50, g400, h25, j20
  26603 e.
  g0    def   25911
        use   25724
  g1    def   25914
        use   25724
  g2    def   25917
        use   25724
  g3    def   25920
        use   25724
  g4    def   25922
        use   25724
  g5    def   25924
        use   25724
  g6    def   25927
        use   25724
  g7    def   25930
        use   25724
  g8    def   25934
        use   25724
  g9    def   25938
        use   25724
  g10   def   25942
        use   25725
  g11   def   25944
        use   25725
  g12   def   25952
        use   25725  25931  25935  25939  25954  25959  25961
  g13   def   25963
        use   25725
  g14   def   25969
        use   25725  25970  25984  25995  26003
  g15   def   25983
        use   25725  25987  25988  26487  26525
  g16   def   25994
        use   25725  25998  25999  26488  26526
  g17   def   26002
        use   25725
  g18   def   26012
        use   25725  26013  26027  26038  26046
  g19   def   26026
        use   25725  26030  26031  26493  26531
  g20   def   26037
        use   25726  26041  26042  26494  26532
  g21   def   26045
        use   25726
  g22   def   26058
        use   25726  26059  26502  26503  26537  26537
  g23   def   26074
        use   25726  26075  26495  26496  26524  26524
  g24   def   26083
        use   25726
  g25   def   26087
        use   25726
  g26   def   26090
        use   25726
  g27   def   26092
        use   25726
  g28   def   26102
        use   25726  26084  26088  26093  26104  26109  26111
              26491  26535
  g29   def   26121
        use   25726  26122  26500  26501  26563  26563
  g30   def   26137
        use   25727  26138  26489  26490  26527  26527
  g31   def   26146
        use   25727
  g32   def   26149
        use   25727
  g33   def   26152
        use   25727
  g34   def   26155
        use   25727
  g35   def   26158
        use   25727
  g36   def   26161
        use   25727
  g37   def   26164
        use   25727
  g38   def   26167
        use   25727
  g39   def   26170
        use   25727
  g40   def   26173
        use   25728
  g41   def   26176
        use   25728
  g42   def   26179
        use   25728
  g43   def   26182
        use   25728
  g44   def   26185
        use   25728
  g45   def   26188
        use   25728
  g46   def   26191
        use   25728
  g47   def   26194
        use   25728
  g48   def   26197
        use   25728
  g49   def   26200
        use   25728
  g50   def   26207
        use   25729  26208  26222  26233  26241
  g51   def   26221
        use   25729  26225  26226  26498  26533
  g52   def   26232
        use   25729  26236  26237  26499  26534
  g53   def   26240
        use   25729
  g54   def   26246
        use   25729
  g55   def   26249
        use   25729
  g56   def   26252
        use   25729
  g57   def   26255
        use   25729
  g58   def   26258
        use   25729
  g59   def   26261
        use   25729
  g60   def   26264
        use   25730
  g61   def   26267
        use   25730
  g62   def   26270
        use   25730
  g63   def   26273
        use   25730
  g64   def   26276
        use   25730
  g65   def   26279
        use   25730
  g66   def   26282
        use   25730
  g67   def   26285
        use   25730
  g68   def   26288
        use   25730
  g69   def   26291
        use   25730
  g70   def   26294
        use   25731
  g71   def   26297
        use   25731
  g72   def   26300
        use   25731
  g73   def   26303
        use   25731
  g74   def   26306
        use   25731
  g75   def   26309
        use   25731
  g76   def   26312
        use   25731
  g77   def   26315
        use   25731
  g78   def   26318
        use   25731
  g79   def   26321
        use   25731
  g80   def   26324
        use   25732
  g81   def   26327
        use   25732
  g82   def   26330
        use   25732
  g83   def   26333
        use   25732
  g84   def   26336
        use   25732
  g85   def   26339
        use   25732
  g86   def   26342
        use   25732
  g87   def   26345
        use   25732
  g88   def   26348
        use   25732
  g89   def   26351
        use   25732
  g90   def   26354
        use   25733
  g91   def   26357
        use   25733
  g92   def   26360
        use   25733
  g93   def   26363
        use   25733
  g94   def   26366
        use   25733
  g95   def   26369
        use   25733
  g96   def   26372
        use   25733
  g97   def   26375
        use   25733
  g98   def   26378
        use   25733
  g99   def   26381
        use   25733
  h0    def   25790
        use   25778
  h1    def   25799
        use   25757  25764  25766  25801  25805  25815
  h2    def   25877
        use   25757
  h4    def   25884
        use   25922  25944  25963  26090
  h7    def   26570
        use   25738
  h8    def   26572
        use   25740  26580
  h9    def   26574
  h10   def   26576
        use   25745
  h22   def   25888
        use   25717
  h23   def   25892
        use   25718
  h24   def   25899
        use   25719  26480
  h25   def   26602
        use   25710
  25789 b. i10, j10
  25876 e.
  i0    def   25802
        use   25808
  i1    def   25809
        use   25817  25823  25837  25866
  i2    def   25816
        use   25814
  i3    def   25824
        use   25820
  j0    def   25867
        use   25800
  j1    def   25868
        use   25833  25839  25840
  j2    def   25869
        use   25838  25846
  j3    def   25870
        use   25843  25844
  j4    def   25872
        use   25849
  j5    def   25874
        use   25853  25855  25856
  j6    def   25875
        use   25859  25863
  25945 b. j3
  25962 e.
  j0    def   25954
        use   25946
  j1    def   25959
        use   25946  25948
  j2    def   25961
        use   25948
  25964 b. j1
  25978 e.
  j0    def   25965
        use   25971  25971
  j1    def   25966
        use   25971  25971
  25979 b. j1
  25989 e.
  j0    def   25987
        use   25980
  j1    def   25988
        use   25980
  25990 b. j1
  26000 e.
  j0    def   25998
        use   25991
  j1    def   25999
        use   25991
  26007 b. j1
  26021 e.
  j0    def   26008
        use   26014  26014
  j1    def   26009
        use   26014  26014
  26022 b. j1
  26032 e.
  j0    def   26030
        use   26023
  j1    def   26031
        use   26023
  26033 b. j1
  26043 e.
  j0    def   26041
        use   26034
  j1    def   26042
        use   26034
  26050 b. j1
  26065 e.
  j0    def   26051
        use   26060  26060
  j1    def   26052
        use   26060  26060
  26066 b. j1
  26081 e.
  j0    def   26067
        use   26076  26076
  j1    def   26068
        use   26076  26076
  26095 b. j3
  26112 e.
  j0    def   26104
        use   26096
  j1    def   26109
        use   26096  26098
  j2    def   26111
        use   26098
  26113 b. j1
  26128 e.
  j0    def   26114
        use   26123  26123
  j1    def   26115
        use   26123  26123
  26129 b. j1
  26144 e.
  j0    def   26130
        use   26139  26139
  j1    def   26131
        use   26139  26139
  26202 b. j1
  26216 e.
  j0    def   26203
        use   26209  26209
  j1    def   26204
        use   26209  26209
  26217 b. j1
  26227 e.
  j0    def   26225
        use   26218
  j1    def   26226
        use   26218
  26228 b. j1
  26238 e.
  j0    def   26236
        use   26229
  j1    def   26237
        use   26229
  26595 b. i1
  26600 e.
  i0    def   26596
        use   26599
  i1    def   26598
        use   26596
  26624 b. g30
  26830 e.
  g0    def   26645
        use   26693
  g1    def   26626
        use   26773  26825  26827
  g2    def   26658
        use   26650
  g3    def   26697
        use   26700
  g4    def   26704
        use   26709
  g5    def   26715
        use   26730
  g6    def   26762
        use   26765
  g7    def   26651
        use   26648
  g8    def   26775
        use   26626  26774
  g9    def   26776
        use   26671  26710  26714  26722
  g10   def   26783
        use   26638
  g12   def   26749
        use   26757
  g13   def   26779
        use   26651
  g14   def   26724
        use   26720
  g15   def   26668
        use   26659  26661  26663  26665
  g16   def   26639
        use   26643
  g17   def   26673
        use   26657  26667
  g18   def   26777
        use   26655  26668
  g19   def   26690
        use   26679
  g20   def   26680
        use   26675  26677
  g30   def   26826
        use   26625
  26839 b. i30
  26864 e.
  i0    def   26840
        use   26842  26846
  i1    def   26840
        use   26846
  i2    def   26852
        use   26859
  i3    def   26859
        use   26863
  i10   def   26846  26847  26848  26849  26850  26851
        use   26847  26847  26848  26848  26849  26849  26850
              26850  26851  26851  26855
  i11   def   26851
        use   26851  26855
  i12   def   26850
        use   26850  26854
  i13   def   26849
        use   26849  26854
  i14   def   26848
        use   26848  26853
  i15   def   26847
        use   26847  26853
  i20   def   26846  26847  26848  26849  26850  26851
        use   26847  26847  26848  26848  26849  26849  26850
              26850  26851  26851  26858
  i21   def   26851
        use   26851  26858
  i22   def   26850
        use   26850  26857
  i23   def   26849
        use   26849  26857
  i24   def   26848
        use   26848  26856
  i25   def   26847
        use   26847  26856
  26876 b. c10, d50, e99, f100, i70, j21, l150, m280, n50, p65, r7
           t40, v40
  33133 e.
  c0    def   27027
        use   27067  27144  27214  29878
  c1    def   27028
        use   27069  27148  27202  27204  27403
  c2    def   27080
        use   27057  27075
  c5    def   31539
        use   31015
  c7    def   31540
        use   31203
  c8    def   31541
        use   31519
  d0    def   33099
        use   27034  33101
  d1    def   29051
        use   27356  28067  28308  29054  29055  29056  29057
              29058  29059  29060  29062  29063  29065  29066
              29067  29068  29069  29070  29071  29072  29073
              29260  29274  29293  29360  29366  29405  29418
              29426  29437  29439  29475  29476  29512  29518
              29533  29553  29560  29571  29620  29629  29646
              29688  29800  29900  29955  29956  29998  30252
              30265  30273  30282  30296  30339  30341  30353
              30373  30404  30408  30427  30431  30445  30460
              30470  30472  30499  30515  30552  30567  30570
              30583  30601  30602  30627  30860  30862
  d2    def   29076
        use   28227  28231  28449  28457  28471  28621  28653
              28671  29299  29306  29407  29498  29713  30046
              30066  30112  30250  30303  30407  30462  30527
              30628  30909
  d3    def   29047
        use   27331  27355  27371  28039  28060  28063  28068
              28137  28149
  d4    def   29042
        use   27083  27714  28472  28536  28554  28863  28911
              28927  28938  28963  28995  29107  29141  29166
              29212  29304  29387  29440  29532  29564  29585
              29645  29669  29715  29797  29828  29896  29903
              30012  30122  30130  30266  30595  30668  30684
              30695  30714  30728  30754  30797  30816
  d5    def   29043
        use   29671  29692  30274  30732  30856
  d6    def   29044
        use   28843
  d7    def   27029
        use   27073  27077  27223
  d8    def   27032
        use   27033  27034  27035  27036  27071  27197  27207
              27213  27219  27224  27227  27231  27235  27245
              27246  27250  27292  28059  29877
  d9    def   27024
        use   27056  27080  28556  29043
  d10   def   30474
        use   29272  30461  30481
  d11   def   29077
        use   27825  27960  28103  28119  28122  28659  28669
              29451  29798  29892  29911  29976  29999  30054
              30067  30081  30493  30629
  d12   def   27039
        use   27093  27108  27113  27218  27243  27478  27500
              27518  27539  27552  27568  27573  27619  27656
  d13   def   29078
        use   27494  27529  27531  27555  27563  27565
  d14   def   29081
        use   27491  27519  27525  27567  28473  29408  30630
  d15   def   29082
        use   28474  30631
  d16   def   29038
        use   27103  27229  28312  29039  29386  29391  29403
              29411  29433  29436  30632  30633  31566
  d17   def   28819
        use   28749  28786  28798
  d18   def   33100
        use   27035
  d19   def   33101
  d20   def   30046
        use   29947  30043  31678
  d21   def   29083
        use   27488  27521  27522  27532  27534  27538
  d28   def   29048
        use   27145  27194  27872
  d29   def   29046
        use   27343
  d30   def   29052
        use   28139  28148  30217  30226  30227
  e0    def   27052
        use   27715  28576
  e1    def   27055  28701
        use   27733  28451  28582  28701
  e2    def   27092  28591  30167
        use   28590  30167  30710
  e3    def   27138
        use   27871  28700
  e4    def   27193
        use   27308  27375
  e5    def   27195  29075
        use   27344  27400  27441  29075  30799
  e6    def   27209
        use   27327  27434
  e7    def   27211  29085
        use   27063  28452  29085  29854  29869
  e8    def   27281  29086
        use   27312  27379  29086  30802
  e9    def   27290  29087
        use   27354  27372  29087  29868  30234  30784
  e10   def   27306  29088
        use   29088  30146
  e11   def   27342
        use   27353  27369  28066
  e12   def   27351  29089  29752
        use   27732  29089  29752  30157
  e13   def   27367
        use   30165
  e14   def   27398  29230
        use   27873  29230  30756  30769  30770
  e15   def   27458  29231
        use   29231  29556
  e17   def   27478  29232  29753
        use   29232  29384  29752  29753  30299  30376  31137
              31172  31299  31435
  e18   def   27510  29754
        use   29753  29754  31141  31442
  e19   def   27518  29755
        use   29754  29755  31212
  e20   def   27552  29756
        use   29755  29756  31142  31216  31443
  e23   def   27586
        use   28753  28756
  e24   def   27618  28693  29757
        use   27501  28074  28692  28753  28784  29574  29756
              29757  30518  30624  30625
  e25   def   27673  29233  29762
        use   29233  29762  31358  31460
  e26   def   27501  29758
        use   27482  29757  29758  31353
  e30   def   33111
        use   33122
  e31   def   27752  29234  29759  30168
        use   28322  28330  28334  28340  28346  29234  29758
              29759  30168  31325  31670  31745
  e32   def   27751  29235  30169
        use   27079  27595  28140  28151  29235  29535  29573
              30117  30169  30267  30276  30517  30972  31576
  e33   def   27750  29236  30170
        use   27357  28069  29236  29689  30170  30861
  e40   def   27813  29091  30171
        use   29091  29968  30171  31767
  e41   def   27839
        use   28557
  e42   def   27869
        use   28040  28788
  e43   def   27910
        use   28104  28660  28765
  e44   def   27950  29760
        use   29760  30999
  e45   def   27979  29761
        use   27711  28758  29559  29761  29899
  e46   def   28034
        use   27716  28633  28650
  e47   def   28096  29763
        use   27479  29763  29920  29949  30118  30519  31350
  e48   def   28058
        use   28817
  e49   def   28137
        use   30235
  e50   def   28148  29090  29764
        use   29090  29764  30235  30242
  e53   def   28175  29765
        use   27681  29765  30097
  e54   def   28174
  e55   def   28173
  e56   def   28172  29766
        use   27678  29766  30094  31370  31465
  e57   def   28171  29767
        use   29767  29809  30068
  e58   def   28170  29768
        use   29768  29986
  e59   def   28194  29769
        use   28623  29769
  e60   def   28215  29770
        use   28321  28328  29770  30127
  e61   def   28219
        use   28333
  e62   def   28223
        use   28339  28344  28909
  e63   def   28243
  e64   def   28169  29771
        use   27674  28672  29771  29977  30090  30657  30918
              31371  31462
  e65   def   28252  29772  30172
        use   28179  28196  28596  29772  29830  30172  30379
              30935  31178  31383  31401  31473  31593
  e66   def   28267  29773  30173
        use   28183  28202  28448  28683  29773  29843  30173
              30973  31218  31405  31474  31610
  e67   def   28286  29092
        use   27692  27707  29092  30086
  e70   def   28320  29774
        use   29774  30617  30618
  e71   def   28319
  e72   def   28318  29775
        use   29775  30619  30620
  e73   def   28317  29776
        use   29776  30621  30622
  e74   def   28316  29777
        use   29777  31304
  e75   def   28315
        use   29385
  e76   def   28314  29778
        use   29778  30998
  e80   def   28326  29779
        use   29779  30620  30621
  e81   def   28325  29780
        use   29780  30622  30623
  e82   def   28324
  e83   def   28327  29781
        use   29781  30126
  e85   def   28332  29782
        use   29782  30618  30619
  e90   def   28338  29783
        use   29783  30253  30615
  e91   def   28337
  e92   def   28336  29784
        use   29784  30539  30623  30624
  e95   def   28343  29785
        use   29785  30615  30616
  e96   def   28342  29786
        use   29786  30616  30617
  f0    def   26899  26997
        use   26901  26999  27002  27003  27004  27005  27006
              27007  27008  27025  27095  27320  27409  27415
              27750  28308  28564  28565  28841  28933  28937
              29051  29069  29070  29620  29629  29646  29687
              29800  30265  30859  33101
  f1    def   26989
        use   28564  29054  29955
  f2    def   26990
        use   27885  28565  29055  29956  30010  30252  30282
              30339  30341  30353  30408  30431  30969
  f3    def   26988
        use   27004  27421  29056  29260  29274  29293  29363
              29366  30404  30427  30445  30460  30470  30472
  f4    def   26987
        use   27003  29057  30006  30583  30601  30602  30781
              30830
  f5    def   26991
        use   27005  27877  27878  27881  27882  29058  29066
              29067  29068  29571  29572  29900  30025  30027
              30273  30296  30373  30515  30516  30939  30969
  f6    def   26998
        use   26999  27006  29059  31007
  f7    def   26992
        use   27007  29060  29475  29512  29553  30008  30499
              30552  30567  30570  30817
  f8    def   26999
        use   28306
  f9    def   26900
        use   26901  27282  27283  27315  27406  27408  27436
              29857  33099
  f10   def   26901
        use   29697  33101
  f11   def   26993  26994
        use   26994  26995  27008  28138  28150  29062  29071
              29072  29476  29518  29533  29560  29572  30002
              30004  30516  30820  30824
  f12   def   26995
        use   26996  29063  29073
  f13   def   26996
        use   29065
  f14   def   26910
        use   27033  27234
  f15   def   26911
        use   27114  27220  27225  27232  27291
  f16   def   26912
        use   27638
  f17   def   26913
        use   27637
  f18   def   26914
        use   27622  27638  27639
  f19   def   26915
        use   27640
  f20   def   26903
        use   27676  29978  30092  30919  31385  31464
  f21   def   26904
  f22   def   26905
        use   27686  30102  30666  31372  31467  32003  32068
              32450
  f23   def   26906
        use   30922  31387  31953  32105  32167
  f24   def   26907
        use   27680  30096
  f25   def   26908
  f30   def   27033
        use   27219  27224  27231  27235  27292
  f32   def   27034
        use   27207
  f34   def   27035
  f36   def   27036
        use   27071  27197  27213  27245  27246  27250  28059
              29877
  f37   def   26916
        use   31359
  f38   def   26917
        use   29926  30000  31357  31458
  f40   def   26919
        use   31196
  f41   def   26920
        use   31139  31205  31540
  f42   def   26921
  f43   def   26922
        use   31191
  f44   def   26923
        use   31199
  f45   def   26924
  f46   def   26926
  f47   def   26927
        use   31110  31301  31437
  f48   def   26928
        use   27499
  f49   def   26929
  f50   def   26930
        use   27566
  f51   def   27000
        use   27150  29259  29273  29292  29362  30403  30426
              30444  30459  30469
  f53   def   27004
        use   29620  30704  30706
  f54   def   27003
        use   27024  28560
  f55   def   27005
        use   27074  27841  27842  27845  27846  30259  30264
              30275
  f56   def   27006
        use   27009  27010  27011  27012  27013  27014  27015
  f57   def   27007
        use   27066  29698  30699  30733
  f60   def   27002
        use   29298  29305  29409  29410  29497  29656  29657
              29716  30123  30596
  f61   def   27008
        use   27101  27995  27996  27999  28000  29491  29534
              29642  29693  29800  29801  29832  30259  30669
              30673  30821  30822  30825  30826  30871
  f62   def   27009
        use   28622  29587  29799  29833  30013
  f64   def   27010
        use   28864  28867  28871  28913  28997  29396  29511
              29805  30131
  f66   def   27011
        use   27096  28918  29069  29108  29629  29646  29699
  f67   def   27012
        use   27068  29070  30703
  f68   def   27013
        use   27106  29488  29566  29586  30696  30708
  f69   def   27014
  f70   def   27015
        use   27072  27076  29694  30715  30730  30731  30755
              30798
  f71   def   26941
        use   32595  32678  32737  32759  32786  32903
  f72   def   26942
        use   32845  32903
  f74   def   26943
        use   32252
  f75   def   26944
        use   31381
  f76   def   26945
        use   32956  33012
  f77   def   26946
  f80   def   26948
  f81   def   26949
  f82   def   26950
        use   30948
  f83   def   26951
  f84   def   26952
  f87   def   26953
        use   30955
  f88   def   26954
  f89   def   26955
        use   30953
  f90   def   26957
        use   29588
  f91   def   26958
        use   29590
  i6    def   31287
        use   31260  31262
  j0    def   28447  31148  31805  33093
        use   29438  30136  31147  31228  31235  31326  31354
              31374  31379  31393  31426  31536  31681  31747
              31805  31809  31896  31915  31930  31976  32022
              32079  32123  32129  32199  32207  32232  32281
              32308  32387  32425  32489  32551  32648  32710
              32743  32768  32816  32912  32994  33026  33053
              33084  33093
  j1    def   28446  29984  31092  31805  33093
        use   27819  28609  29417  29425  29964  29983  30997
              31025  31029  31032  31036  31053  31056  31067
              31077  31080  31086  31092  31103  31382  31764
              31805  31810  32047  33093
  j2    def   28445  29576  30921  31302  31439  31805  33093
        use   27112  27252  29568  29575  30920  30949  31302
              31313  31386  31430  31438  31636  31708  31805
              31811  33093
  j3    def   28444  29906  31399  31805  33093
        use   27486  27502  28651  29901  29905  30121  31398
              31630  31640  31644  31660  31701  31805  31812
              32041  32145  32503  32716  33093
  j4    def   28443  29094  30329  31805  33093
        use   28624  28657  29094  29529  30308  30315  30328
              30466  30915  31805  31813  33093
  j5    def   28442  29624  30438  31389  31806  33094
        use   28679  28833  28847  29623  29631  29680  30430
              30434  30437  30606  30677  30686  30923  31388
              31806  31814  33094
  j6    def   28441  28540  29093  30575  31806  33094
        use   27624  27641  27657  28005  28539  29093  30574
              31806  31815  33094
  j7    def   28440  31806  33094
        use   29217  29640  31806  31816  32032  32142  32499
              32722  32847  33094
  j10   def   28453
        use   33123
  j21   def   33131
        use   26884
  l2    def   28471
        use   27484
  l4    def   28472
        use   27094  27105
  l14   def   28473
  l15   def   28474
        use   27489  27510  27512
  l101  def   30627
        use   30938  31006
  l102  def   30628
        use   30994  31022  31063  31314  31356  31421  31626
              31697  31761
  l111  def   30629
        use   30916  30936
  l114  def   30630
        use   31261  31305  31446  31449  31489  31501  31514
  l115  def   30631
        use   31145  31445
  l116  def   30632
        use   31189  31220
  l131  def   30633
        use   31173  31187  31219
  m0    def   28526  31777
        use   31777  31877  31910  31925  31951  31999  32066
              32102  32159  32190  32223  32448  32626  32692
              32791  32846  32904  33042  33069
  m1    def   28535  31777
        use   31777  32765
  m2    def   28544  31777
        use   31777  32911
  m3    def   28552  31777
        use   31777  32689
  m4    def   28575  31777
        use   31777  31821  31847  32463  32859  32910  32968
              33017  33047  33074
  m5    def   28581  31778
        use   31778  31837  31841  31856  32488  32495  32875
              32986  33052  33083
  m6    def   28589  31778
        use   31778  31967  32120  32979
  m7    def   28596  31778
        use   31778  31959  31969
  m8    def   28605  31778
        use   31778  32252  32595  32678  32737  32759  32786
              32845  32903  32956  33012
  m9    def   28620  31778
        use   31778  32682  32741  32763  32790  32852  32960
              33016
  m10   def   28632  31779
        use   31779  31912  31927  32192  32225  32860  33020
              33049  33076
  m11   def   28649  31779
        use   31779  31953  32003  32068  32105  32167  32450
  m12   def   28682  31779
        use   31779  31961  31971
  m13   def   28691  31779
        use   31779  32001
  m14   def   28699  31779
        use   31779  32037  32043  32630  32890
  m15   def   28742  31780
        use   31780  31883  32275  32302  32545  32988
  m16   def   28745  31780
        use   31780  32383
  m17   def   28747  31780
        use   31780  32007  32457  32600  32696  32856
  m18   def   28783  31780
        use   31780  31822  31848  32029  32139  32464  32469
              32496  32969
  m19   def   28829  31780
        use   31780  32616  32622  32695  32721  32870
  m20   def   28839  31781
        use   31781  32612
  m21   def   28852  31781
        use   31781  32617  32691  32866
  m22   def   28988  31781
        use   31781  31888  31956  32070  32112  32973
  m23   def   29106  31781
        use   31781  31891  31960  32073  32976
  m24   def   29223  31781
        use   31781  31966
  m25   def   29252  31782
        use   31782  32614  32620
  m26   def   29257  31782
        use   31782  32719  32868  32974
  m27   def   29268  31782
        use   31782  32113
  m28   def   29284  31782
        use   31782  32071  32798
  m29   def   29288  31782
        use   31782  31957
  m30   def   29290  31783
        use   31783  31889  32628  32693  32887
  m31   def   29361  31783
        use   31783  32797  32886
  m32   def   29383  31783
        use   31783  32530
  m33   def   29359  31783
        use   31783  32627
  m34   def   29450  31783
        use   31783  32255
  m35   def   29474  31784
        use   31784  31887
  m36   def   29552  31784
        use   29479  31784  31954  32004  32069  32107  32166
              32197  32228  32451  32528  32681  32740  32762
              32789  32851  32926  32959  33015  33046  33073
  m37   def   29583  31784
        use   31784  32638  32683  32742  32767  32815  32865
              32972  33023
  m38   def   29619  31784
        use   31784  32611
  m39   def   29668  31784
        use   31784  32872
  m40   def   29796  31785
        use   31785  32271  32635
  m41   def   29827  31785
        use   31785  32814
  m42   def   29853  31785
        use   31785  32876
  m43   def   29891  31785
        use   31785  32266
  m44   def   29910  31785
        use   31785  32640  32874
  m45   def   29919  31786
        use   31786  32204  32811  32879  32907
  m46   def   29943  31786
        use   31786  32198  32229  32639  32873  32991
  m47   def   30039  31786
        use   31786  32206  32641
  m48   def   30053  31786
        use   31786  31970  32021  32461
  m49   def   30065  31786
        use   31786  32642  32881  32992
  m50   def   30080  31787
        use   31787  32074  32813  32909
  m51   def   30112  31787
        use   31787  32928
  m55   def   30145  31788
        use   31788  31826  31892  32010  32038  32044  32474
              32631  32707  32891  32977
  m56   def   30156  31788
        use   31788  31833  31894  31972  32012  32040  32046
              32117  32144  32460  32484  32502  32633  32709
              32893  32981
  m57   def   30164  31788
        use   31788  31854  32005  32034  32075  32505  33024
  m58   def   30197  31788
        use   31788  31973  32019  32025  32121
  m59   def   30207  31788
        use   31788  32016  32077  32127
  m60   def   30215  31789
        use   31789  31828  32476  32980  33080
  m62   def   30223  31789
        use   31789  31835  32486  32983
  m63   def   30233  31789
        use   31789  33081
  m64   def   30241  31789
        use   31789  31831  32479  33079
  m65   def   30249  31790
        use   31790  31878  31911  31926  31952  32002  32067
              32104  32160  32191  32224  32254  32301  32322
              32337  32354  32372  32422  32449  32529  32544
              32927  33043  33070
  m66   def   30258  31790
        use   31790  31964  32270  32701  32871  32964
  m67   def   30263  31790
        use   31790  32810  32877
  m68   def   30272  31790
        use   31790  32905
  m69   def   30296  31790
        use   31790  32423
  m70   def   30280  31791
        use   31791  32265  32599  32608  32809  32855  32878
              32889  32906
  m71   def   30302  31791
        use   30298  31791  32452  32481  32491
  m72   def   30338  31791
        use   31791  32453  32482  32492
  m73   def   30351  31791
        use   31791  32468  32501
  m74   def   30372  31791
        use   31791  32424
  m75   def   30402  31792
        use   31792  31881  32110  32455
  m76   def   30425  31792
        use   31792  32609  32685  32864  32966
  m77   def   30443  31792
        use   31792  31820  31965  32013  32076  32118  32126
              32131  32162  32462
  m78   def   30458  31792
        use   31792  32109  32161
  m79   def   30480  31792
        use   31792  32125  32138
  m80   def   30485  31793
        use   31793  31880
  m83   def   30492  31793
        use   31793  32230
  m84   def   30497  31793
        use   31793  32165  32527  32680  32739  32761  32788
              32850  32925  32958  33014  33045  33072
  m85   def   30514  31794
        use   31794  32606
  m86   def   30538  31794
        use   31794  32596
  m87   def   30544  31794
        use   31794  32862
  m88   def   30550  31794
        use   31794  31834  31962  32115  32168  32194  32485
              32700  32963  32982  33078
  m89   def   30566  31794
        use   31794  31955
  m90   def   30581  31795
        use   31795  31879  32135  32704  32962
  m91   def   30594  31795
        use   28907  31795  32132  32171  32705
  m100  def   30615  31796
        use   31796  32015  32024  32036  32042  32987  33048
              33075
  m101  def   30616  31796
        use   31796  31895  32278  32305  32386  32548  32993
  m102  def   30617  31796
        use   31796  32231
  m103  def   30618  31796
        use   31796  32000  32006  32017  32028  32854
  m104  def   30619  31796
        use   31796  32164  32526  32738  32760  32787  32924
              32957  33013  33044  33071
  m105  def   30620  31797
        use   30569  31797  31886
  m106  def   30621  31797
        use   31797  31914  33051
  m107  def   30622  31797
        use   31797  32684  32961  33018
  m108  def   30623  31797
        use   31797  31929
  m109  def   30624  31797
        use   31797  32679  32849
  m115  def   30646  31798
        use   31798  32764
  m116  def   30693  31798
        use   31798  32766
  m117  def   30727  31798
        use   31798  32805
  m118  def   30751  31798
        use   31798  32794
  m119  def   30768  31798
        use   31798  32802  32894
  m120  def   30778  31799
        use   31799  32800
  m121  def   30793  31799
        use   31799  32804
  m122  def   30815  31799
        use   31799  32796
  m123  def   30853  31799
        use   31799  32884
  m125  def   30880  31800
        use   31800  31829  31852  32133  32136  32169  32172
              32273  32477  32506  32702
  m126  def   30885  31800
        use   31800  31857
  m127  def   30890  31800
        use   31800  31839
  m128  def   30895  31800
        use   31800  31842
  m149  def   30908  31801
        use   31801  32253
  m150  def   30934  31802
        use   31802  32280  32307  32550
  m151  def   30993  31802
        use   31802  32306
  m152  def   31136  31802
        use   31802  32323
  m153  def   31171  31802
        use   31802  32338
  m154  def   31298  31802
        use   31802  32355
  m155  def   31350  31803
        use   31803  32373
  m156  def   31625  31803
        use   31803  32405
  m157  def   31696  31803
        use   31803  32565
  m158  def   31760  31803
        use   31803  32549
  m260  def   29256  31804
        use   31804  32715
  m280  def   29283  31804
        use   31804  32714
  n0    def   28366  30070
        use   28385  28411  28412  28538  28547  28597  28610
              28625  28677  28684  28832  28845  28846  28856
              28857  28873  29027  29114  29135  29227  29368
              29536  29569  29594  29736  29810  29876  29914
              29979  29987  30057  30059  30069  30084  30103
              30218  30243  30254  30283  30318  30324  30354
              30392  30436  30473  30500  30573  30584  30605
              30653  30717  30796  30803  30924  30954  30974
              31116  31775
  n1    def   28365  29459  30185  30554
        use   28410  28411  28529  28555  28558  28562  28566
              28635  28663  29226  29345  29458  29904  29927
              30148  30185  30344  30406  30413  30447  30553
              30735  30828  30836
  n2    def   28364
        use   28774  28789
  n5    def   28387  29461  30186  30556
        use   28410  28530  28567  28634  28805  28812  29331
              29460  29895  29923  29928  30147  30186  30345
              30412  30448  30522  30526  30530  30555  30734
              30757  30823  30827  30832  30835  30869  30881
  n6    def   28386
        use   28818
  n10   def   28395
        use   28606  28674  28989  29480  29565  29584  29944
              30040
  n20   def   28404  30184
        use   30184  30199  30209
  n25   def   28422  30762
        use   30761  30863
  n30   def   28412
        use   30886
  n31   def   28411
        use   30886  30891
  n33   def   28410
        use   30891  30897
  n35   def   28429
        use   30761  30769
  n49   def   33086
        use   28469
  n50   def   28435
        use   28384  31777  31777  31777  31777  31777  31778
              31778  31778  31778  31778  31779  31779  31779
              31779  31779  31780  31780  31780  31780  31780
              31781  31781  31781  31781  31781  31782  31782
              31782  31782  31782  31783  31783  31783  31783
              31783  31784  31784  31784  31784  31784  31785
              31785  31785  31785  31785  31786  31786  31786
              31786  31786  31787  31787  31788  31788  31788
              31788  31788  31789  31789  31789  31789  31790
              31790  31790  31790  31790  31791  31791  31791
              31791  31791  31792  31792  31792  31792  31792
              31793  31793  31793  31794  31794  31794  31794
              31794  31795  31795  31796  31796  31796  31796
              31796  31797  31797  31797  31797  31797  31798
              31798  31798  31798  31798  31799  31799  31799
              31799  31800  31800  31800  31800  31801  31802
              31802  31802  31802  31802  31803  31803  31803
              31803  31804  31804  31805  31805  31805  31805
              31805  31806  31806  31806  33093  33093  33093
              33093  33093  33094  33094  33094
  p0    def   31819
        use   30198
  p1    def   31846
        use   30208
  p20   def   31876
        use   33087
  p21   def   31909
        use   33087
  p22   def   31950
        use   33087
  p23   def   31998
        use   33087
  p24   def   32065
        use   33087
  p25   def   32101
        use   33087
  p26   def   32189
        use   33087
  p27   def   32251
        use   33087
  p28   def   32300
        use   33087
  p29   def   32321
        use   33087
  p30   def   32336
        use   33088
  p31   def   32353
        use   33088
  p32   def   32371
        use   33088
  p34   def   32382
        use   33088
  p35   def   32404
        use   33088
  p36   def   32421
        use   33088
  p37   def   32447
        use   33088
  p38   def   31924
        use   33088
  p39   def   32525
        use   33088
  p40   def   32543
        use   33089
  p42   def   32564
        use   33089
  p43   def   33041
        use   33089
  p44   def   33068
        use   33089
  p45   def   32158
        use   33089
  p46   def   32222
        use   33089
  p51   def   32594
        use   33090
  p52   def   32677
        use   33090
  p53   def   32736
        use   33090
  p54   def   32758
        use   33090
  p55   def   32785
        use   33090
  p56   def   32844
        use   33090
  p57   def   32902
        use   33090
  p59   def   32923
        use   33090
  p60   def   32955
        use   33091
  p61   def   33011
        use   33091
  r0    def   31809
        use   32454  32462  32690  32885
  r1    def   31810
        use   31893  32708
  r2    def   31811
  r3    def   31812
        use   31884  31885  31913  31928  32205  32226  32276
              32277  32303  32304  32458  32459  32546  32547
              32601  32602  32806  32857  32858  32861  32970
              32971  32989  32990  33021  33050  33077
  r4    def   31813
        use   31890  32111  32194  32456  32607  32975  32978
  r5    def   31814
        use   31882  32597  32615  32621  32629  32632  32863
  r6    def   31815
        use   31958  32114  32694  32720  32869  32888  32892
  r7    def   31816
        use   31877  31910  31925  31951  31999  32030  32039
              32045  32066  32072  32102  32140  32159  32223
              32384  32385  32448  32483  32493  32497  32714
              32715  32799  32812  32880  32904  32908  33042
              33069  33088  33089  33089  33089  33089  33090
              33090
  t0    def   26960
        use   26967  32815
  t1    def   26961
        use   26968  26972  26974  26975  26976  26977  32638
  t2    def   26962
        use   26968  26972  26975  26976  26977  32683  32865
  t3    def   26963
        use   26971  26972  26976  26977  29589  29591  30697
              31887  31954  32004  32069  32107  32166  32451
              32742  33046  33073
  t4    def   26964
        use   26972  26973  26976  27107  29592  30707  32767
              32789
  t5    def   26965
        use   26972  26974  26976
  t6    def   26966
        use   26972  26975  26976  26977  32972  33023
  t20   def   26967
  t21   def   26968
        use   32681  32740  32851
  t22   def   26971
        use   32926
  t23   def   26972
        use   32762
  t24   def   26973
  t26   def   26974
  t28   def   26975
        use   32959  33015
  t29   def   26976
        use   32528
  t30   def   26977
        use   32197  32228
  v1    def   29054
        use   28043  28109  28665  28800  28809  28810  28814
  v2    def   29055
        use   27697  28046  28070  28112  28563  28666  28802
              28803  28807  28815
  v3    def   29056
        use   27151  27153  27323  29682  29684
  v4    def   29057
        use   27460  28559  28854  29000  29001
  v5    def   29058
        use   27594  27620  28304  28311  28743  28759  30114
  v6    def   29059
        use   28306  28309  28310  31307
  v7    def   29060
        use   28853  28866  28872  28990  29673
  v8    def   29065
        use   27728
  v11   def   29062
        use   27712  27725  28305
  v12   def   29063
        use   27729
  v13   def   29066
        use   27139  27704  27840  27876  27917
  v14   def   29067
        use   27140  27706  27844  27880  27926
  v15   def   29068
        use   27653
  v26   def   29069
        use   28840
  v27   def   29070
        use   29674  29676  29677  29912
  v30   def   29071
        use   27700
  v31   def   29072
        use   27702
  v32   def   29073
        use   27730  27731
  27051 b. g10, h10
  27084 e.
  g1    def   27057
        use   27054
  h0    def   27081
        use   27059  27078
  h1    def   27082
        use   27062  27065
  h2    def   27083
        use   27053
  27091 b. h10
  27118 e.
  h0    def   27114
        use   27100
  h2    def   27116
        use   27099
  27192 b. g10
  27253 e.
  g0    def   27199
        use   27248
  g1    def   27216
        use   27198
  g2    def   27222
        use   27247
  g4    def   27244
        use   27221
  g5    def   27249
        use   27239
  27272 b. g30, h10
  27450 e.
  g1    def   27313
        use   27329
  g2    def   27316
        use   27322
  g5    def   27330
        use   27319
  g10   def   27375
        use   27326
  g15   def   27378
        use   27443
  g21   def   27410
        use   27429
  g22   def   27414
        use   27424
  g23   def   27418
        use   27438
  g24   def   27430
        use   27417
  g25   def   27439
        use   27433
  h0    def   27444
        use   27310  27440
  h1    def   27445
        use   27307  27332  27352  27358  27368  27380  27399
              27412  27425
  h2    def   27446
        use   27413  27427  27442
  h3    def   27447
        use   27407  27416  27437
  h4    def   27448
        use   27405  27423  27432
  h5    def   27449
        use   27309  27325  27328  27401  27431  27435
  27490 b. i1
  27498 e.
  i0    def   27494
        use   27497
  27508 b. g2
  27540 e.
  g0    def   27524
        use   27537
  g1    def   27535
        use   27527
  27550 b. g5
  27575 e.
  g0    def   27555
        use   27572
  g3    def   27569
        use   27557
  27585 b. g10, h10
  27602 e.
  h0    def   27596
        use   27587  27593
  h1    def   27598
        use   27589  27591
  h2    def   27599
        use   27590  27592
  h3    def   27601
        use   27588
  27617 b. g10
  27658 e.
  g1    def   27625
        use   27645
  g2    def   27642
        use   27654
  g3    def   27650
        use   27623
  27663 b. g30, h7
  27736 e.
  g1    def   27695
        use   27691
  g2    def   27733
        use   27713  27717  27720
  h0    def   27665
        use   27695  27708  27734
  h1    def   27666
  h2    def   27667
        use   27673  27677  27687  27693  27735
  h3    def   27668
        use   27675  27679  27685
  h6    def   27670
        use   27710  27723
  h7    def   27672
        use   27698  27718  27719
  27749 b. g10, h10
  27803 e.
  g0    def   27760
        use   27756
  g1    def   27763
        use   27792  27800
  g5    def   27794
        use   27762
  h0    def   27801
        use   27753  27758  27793
  h1    def   27802
        use   27764  27789
  h3    def   27768
        use   27786
  h4    def   27785
        use   27766  27786
  h5    def   27786
        use   27765  27787  27788  27790
  27812 b. g5, h5
  27829 e.
  g0    def   27817
        use   27823
  h3    def   27828
        use   27813  27827
  27868 b. h0
  27889 e.
  h0    def   27888
        use   27870  27874  27886
  27909 b. g10, h10
  27938 e.
  g1    def   27916
        use   27929  27932
  g2    def   27918
        use   27925
  g10   def   27934
        use   27921
  h0    def   27936
        use   27933  27934
  h1    def   27937
        use   27914  27920
  27949 b. g10
  27963 e.
  g1    def   27955
        use   27959
  27978 b. g10, h10
  28011 e.
  g1    def   27988
        use   28001
  g2    def   27990
        use   27997
  h0    def   28008
        use   27985  27993  28006
  h1    def   28009
        use   27998
  h2    def   28010
        use   27983  27989
  28033 b. g20, h10
  28129 e.
  g5    def   28062
        use   28041
  g10   def   28073
        use   28065
  g20   def   28121
        use   28107
  h0    def   28076
        use   28035  28071  28075  28097  28123
  h1    def   28077
        use   28044  28110
  h2    def   28078
        use   28037  28047  28052  28101  28113  28118
  h5    def   28106
        use   28099
  28155 b. i4
  28205 e.
  i0    def   28157
        use   28157  28158  28159  28160  28161  28162  28163
              28176  28186
  i1    def   28165
        use   28177  28180  28184
  i2    def   28166
        use   28178  28185
  i3    def   28167
        use   28182  28187  28188
  i4    def   28204
        use   28195  28200
  28214 b. g10, h10
  28246 e.
  g0    def   28226
        use   28218  28222
  g1    def   28229
        use   28245
  h0    def   28235
        use   28216  28220  28224  28234  28244
  28250 b. h1
  28262 e.
  h0    def   28254
        use   28257
  28265 b. h1
  28277 e.
  h0    def   28269
        use   28272
  28285 b. h3
  28294 e.
  h3    def   28293
        use   28286  28292
  28302 b. h10
  28347 e.
  h1    def   28304
        use   28319  28320  28324  28337  28338  28342  28343
  h2    def   28305
        use   28318  28319  28332  28336  28337
  h3    def   28306
        use   28317  28318  28325  28326
  h4    def   28307
        use   28336
  h5    def   28308
        use   28316  28317  28324  28325
  h6    def   28309
        use   28315  28316
  h7    def   28310
        use   28314
  h8    def   28311
        use   28342
  h9    def   28312
        use   28314  28315
  28352 b. g20, h10
  28475 e.
  g0    def   28367
  g1    def   28368
        use   28390  28409  28467
  g10   def   28408
        use   28428
  h0    def   28353
        use   28364  28365  28366  28386  28387  28395  28427
              28427
  h1    def   28354
        use   28367  28368  28388  28396  28397  28404  28417
              28424  28433
  h2    def   28356
        use   28405  28406  28408  28413  28415  28422  28429
              28431  28463
  h3    def   28357
        use   28462
  h9    def   28468
        use   28459
  h10   def   28469
        use   28465
  28492 b. i30
  28517 e.
  i0    def   28493
        use   28495  28499
  i1    def   28493
        use   28499
  i2    def   28505
        use   28512
  i3    def   28512
        use   28516
  i10   def   28499  28500  28501  28502  28503  28504
        use   28500  28500  28501  28501  28502  28502  28503
              28503  28504  28504  28508
  i11   def   28504
        use   28504  28508
  i12   def   28503
        use   28503  28507
  i13   def   28502
        use   28502  28507
  i14   def   28501
        use   28501  28506
  i15   def   28500
        use   28500  28506
  i20   def   28499  28500  28501  28502  28503  28504
        use   28500  28500  28501  28501  28502  28502  28503
              28503  28504  28504  28511
  i21   def   28504
        use   28504  28511
  i22   def   28503
        use   28503  28510
  i23   def   28502
        use   28502  28510
  i24   def   28501
        use   28501  28509
  i25   def   28500
        use   28500  28509
  28741 b. g30
  28820 e.
  g0    def   28755
        use   28799
  g1    def   28764
        use   28760
  g8    def   28770
        use   28768
  g10   def   28787
        use   28773
  g20   def   28797
        use   28763  28769
  g21   def   28806
        use   28801
  g22   def   28813
        use   28808
  28828 b. g20, h10
  28971 e.
  g10   def   28896
        use   28844  28855
  g12   def   28908
        use   28901
  g13   def   28920
        use   28946
  g14   def   28935
        use   28930
  g15   def   28940
        use   28934
  g16   def   28950
        use   28926
  g17   def   28953
        use   28944
  h0    def   28967
        use   28897  28906  28948  28961  28965
  h1    def   28968
        use   28910  28932  28936
  h2    def   28969
        use   28917  28958
  h3    def   28970
        use   28830  28899  28931  28951  28960
  28987 b. g20, h10
  29228 e.
  g1    def   29007
        use   29019
  g2    def   29020
        use   29005  29030
  g4    def   29028
        use   28992
  g5    def   29115
        use   29161
  g6    def   29127
        use   29131
  g7    def   29132
        use   29123
  g8    def   29136
        use   29117
  g9    def   29163
        use   29142
  g10   def   29168
        use   29177
  g11   def   29171
        use   29180
  g12   def   29182
        use   29207
  g13   def   29198
        use   29173  29215
  g14   def   29200
        use   29206
  g15   def   29191
        use   29144  29148
  g16   def   29211
        use   29202
  g17   def   29153
        use   29190
  h0    def   29031
        use   29134  29159  29188
  h1    def   29032
        use   29013  29026  29187
  h2    def   29033
        use   29024  29111  29179  29189  29194  29224
  h3    def   29034
        use   29110  29143  29172  29201
  h4    def   29035
        use   29003  29016  29017  29158  29199  29213  29214
  29246 b. g20, h10
  29346 e.
  g0    def   29261
        use   29255
  g2    def   29295
        use   29276  29282
  g3    def   29300
        use   29267
  g10   def   29312
        use   29338
  g11   def   29335
        use   29311  29342
  h0    def   29247
        use   29328  29329
  h1    def   29248
        use   29263  29296  29328
  h2    def   29249
        use   29324  29325
  h3    def   29250
        use   29307  29324
  h4    def   29251
        use   29264  29266
  h5    def   29336
        use   29309
  29382 b. g10, h10
  29442 e.
  g0    def   29388
        use   29404
  g5    def   29406
        use   29441
  g8    def   29412
        use   29434
  29473 b. g10, h10
  29541 e.
  g0    def   29486
        use   29525
  g1    def   29500
        use   29519
  g2    def   29523
        use   29485  29493  29509  29514
  h0    def   29489
        use   29481
  h1    def   29537
        use   29495  29515  29516  29520
  h2    def   29538
        use   29499  29503
  h3    def   29539
        use   29521
  h4    def   29540
        use   29484  29522  29527
  29551 b. g10
  29577 e.
  g1    def   29558
        use   29555
  g5    def   29563
        use   29557
  g10   def   29570
        use   29561
  29618 b. g20, h10
  29845 e.
  g0    def   29637
        use   29643
  g2    def   29649
        use   29653
  g5    def   29672
        use   29655
  g8    def   29701
        use   29844
  g10   def   29710
        use   29734
  g11   def   29720
        use   29728
  g12   def   29729
        use   29744
  g13   def   29732
        use   29709
  g15   def   29737
        use   29718
  g16   def   29739
        use   29743
  h0    def   29656
        use   29630
  h1    def   29745
        use   29686  29690  29717  29829
  h2    def   29746
  h3    def   29747
        use   29705  29714
  h4    def   29748
        use   29730  29732
  h5    def   29749
        use   29683
  h6    def   29750
        use   29625
  29852 b. g10, h10
  29879 e.
  g1    def   29858
        use   29862
  g2    def   29866
        use   29874
  h0    def   29877
        use   29867
  h1    def   29878
        use   29872
  29942 b. g10, h10
  30061 e.
  g1    def   29960
        use   29952  29957
  g5    def   29974
        use   29959  30045
  g9    def   30022
        use   30018
  g10   def   29996
        use   29972  30058
  h1    def   30030
        use   29948  29961  29975  30044
  h2    def   30031
        use   29997  30029
  30079 b. g10, h5
  30108 e.
  g1    def   30088
        use   30105
  g2    def   30101
        use   30093
  h0    def   30107
        use   30091  30095  30101
  h1    def   30106
        use   30089
  30111 b. g10
  30137 e.
  g0    def   30129
        use   30135
  30294 b. g10
  30330 e.
  g0    def   30305
        use   30301
  g5    def   30319
        use   30311
  30337 b. g10, h10
  30355 e.
  h0    def   30346
  h1    def   30347
        use   30340  30352
  30371 b. g10
  30394 e.
  g5    def   30388
        use   30375
  30457 b. g10
  30488 e.
  g0    def   30467
        use   30487
  30565 b. h10
  30577 e.
  h0    def   30576
        use   30568  30571
  30593 b. h10
  30608 e.
  h0    def   30607
        use   30599
  30645 b. g10, h5
  30688 e.
  g0    def   30652
        use   30648
  g1    def   30649
        use   30667  30672  30676
  g2    def   30650
        use   30659  30681  30685
  g3    def   30678
        use   30664
  h0    def   30687
        use   30650  30654
  30692 b. h2
  30719 e.
  h0    def   30712
        use   30698  30701
  h2    def   30718
        use   30705
  30750 b. g10, h10
  30806 e.
  h0    def   30804
        use   30753  30782  30783  30794  30801
  h1    def   30805
        use   30760  30779
  30814 b. g10
  30837 e.
  g2    def   30829
        use   30819
  30852 b. g10, h10
  30876 e.
  g1    def   30857
        use   30873
  g2    def   30866
        use   30874
  h0    def   30875
        use   30858  30865
  30933 b. g5
  30976 e.
  g1    def   30960
        use   30946
  g2    def   30969
        use   30951  30958
  30991 b. g10
  31121 e.
  g0    def   31120
        use   31087  31093  31096  31105
  g1    def   31002
        use   31005
  g2    def   31068
  g3    def   31081
        use   31079
  g5    def   31117
  g6    def   31118
        use   31009  31010
  g8    def   31048
        use   31043
  g9    def   31058
        use   31047
  g10   def   31119
        use   31046
  31134 b. g5
  31149 e.
  g0    def   31138
        use   31143
  g1    def   31142
        use   31140
  31169 b. g10, i5
  31290 e.
  g0    def   31190
        use   31217
  g1    def   31202
        use   31211
  g2    def   31212
        use   31204
  g3    def   31216
        use   31192
  g5    def   31240
        use   31214
  g6    def   31244
        use   31255  31258
  g7    def   31257
        use   31275  31278
  g8    def   31276
        use   31263  31266
  g9    def   31281
        use   31246  31273
  i3    def   31285
        use   31240  31281
  i4    def   31286
        use   31241  31270  31274
  31296 b. g5
  31330 e.
  g0    def   31303
  g3    def   31327
        use   31316
  g4    def   31328
        use   31318
  g5    def   31329
        use   31320
  31348 b. g25, h2
  31616 e.
  g0    def   31396
        use   31362
  g1    def   31434
        use   31360
  g2    def   31448
        use   31472
  g3    def   31376
        use   31367
  g4    def   31469
        use   31457  31461
  g5    def   31440
        use   31444  31517
  g6    def   31446
        use   31535
  g7    def   31551
        use   31373  31468
  g8    def   31570
        use   31554
  g9    def   31368
        use   31365
  g10   def   31477
        use   31499
  g11   def   31497
        use   31494
  g12   def   31592
        use   31415  31496
  g13   def   31609
        use   31601
  g14   def   31615
        use   31592  31614
  g15   def   31458
        use   31454
  g16   def   31462
        use   31459
  g17   def   31526
        use   31532
  g19   def   31503
        use   31512
  g20   def   31510
        use   31505
  g22   def   31408
        use   31418
  g23   def   31427
        use   31411
  g24   def   31431
        use   31400  31408  31420  31448  31469
  g25   def   31432
        use   31404  31428
  h0    def   31538
        use   31463  31466
  31550 b. i10
  31582 e.
  i0    def   31565
        use   31559
  i1    def   31567
        use   31557  31564  31570
  i2    def   31568
        use   31558
  i3    def   31569
        use   31560
  i4    def   31566
        use   31562  31575  31577
  i5    def   31580
        use   31578
  i6    def   31581
        use   31572
  i8    def   31561
        use   31579
  31624 b. g10, h10
  31687 e.
  g5    def   31662
        use   31658
  h0    def   31682
        use   31641  31642
  h1    def   31683
        use   31648
  h2    def   31684
        use   31656
  h3    def   31685
        use   31647  31666  31667  31669  31674
  h4    def   31661
        use   31668
  31695 b. g10, h10
  31752 e.
  h0    def   31748
        use   31720  31721  31728  31729
  h1    def   31749
        use   31739
  h2    def   31750
        use   31724  31733  31734
  h3    def   31751
        use   31713  31718  31726  31740
  h4    def   31743
        use   31735
  31818 b. g10
  31843 e.
  g0    def   31830
        use   31824
  g1    def   31832
        use   31829
  g2    def   31836
        use   31834
  g3    def   31838
        use   31820
  g5    def   31840
        use   31823  31827
  31845 b. g10
  31858 e.
  g0    def   31853
        use   31850
  g5    def   31855
        use   31849  31852
  31949 b.
  31997 b.
  32064 b.
  32100 b.
  32188 b.
  32250 b.
  32446 b.
  32593 b.
  32676 b.
  32784 b.
  32843 b.
  32954 b.
  33067 b.
  33126 b.
  33138 b.
  33167 b.
  33197 b.
  33394 b.
  33428 b.
  33596 b.
  33627 b.
  33679 b.
  33790 b.
  33822 b.
  33901 b.
  33938 b.
  33969 b.
  34052 b.
  34081 b.
  34135 b.
  34203 b.
  34351 b.
  34382 b.
  34399 b.
  34417 b.
  34529 b.
  34812 b.
  34852 b.
  34962 b.
  34987 b.
  35005 b.
  35027 b.
  35049 b.
  35076 b.
  35106 b.
  35126 b.
  35154 b.
  35183 b.
  35211 b.
  35269 b.
  35317 b.
  35367 b.
  35413 b.
  35488 b.
  35604 b.
  35643 b.
  35672 b.
  35712 b.
  35788 b.
  35806 b.
  35922 b.
  36105 b.
  36129 b.
  36353 b.
  36488 b.
  36545 b.
  36615 b.
  36678 b.
  36699 b.
  36742 b.
  36810 b.
  36841 b.
  36861 b.
  36879 b.
  36962 b.
  37004 b.
  37091 b.
  37107 b.
  37171 b.
  37349 b.
  37460 b.
  37501 b.
  37547 b.
  37601 b.
  37748 b.
  37854 b.
  38059 b.
  38126 b.
  38143 b.
  38202 b.
  38319 b.
  38330 b.
  38476 b.
  38499 b.
  38509 b.
  38528 b.
  38567 b.
  38822 b.
  38918 b.
  38946 b.
  38958 b.
  38968 b.
  39258 b.
  39287 b.
  39315 b.
  39324 b.
  39341 b.
  39360 b.
  39367 b.
  39374 b.
  39426 b.
  39474 b.
  39524 b.
  39572 b.
  39628 b.
  39661 b.
  39682 b.
  39874 b.
  40021 b.
  40309 b.
  40362 b.
  40475 b.
  40544 b.
  40585 b.
  40603 b.
  40641 b.
  40732 b.
  40786 b.
  40885 b.
  41048 b.
  41244 b.
  41297 b.
  41504 b.
  41691 b.
  41808 b.
  41965 b.
  42124 b.
  42189 b.
  42210 b.
  42262 b.
  42281 b.
  42342 b.
  42431 b. b1, c25, c107, d80, d90, e27, e109, f29, f60, g0, g6
           g10, g10, g10, g10, g10, g10, g10, g10, g10, g10, g10
           g20, g20, g80, g128, h13, h50, i1, i1, i1, i1, i2
           i3, i4, i4, i4, i5, i5, i5, i5, i5, i5, i5
           i5, i5, i5, i5, i5, i5, i5, i5, i5, i5, i5
           i5, i5, i10, i10, i10, i10, i10, i10, i10, i10, i10
           i10, i10, i10, i10, i10, i10, i10, i10, i10, i10, i10
           i12, i15, i20, i20, i20, i20, i20, i24, i24, i24, i24
           i24, i24, i24, i24, i24, i24, i24, i24, i24, i24, i24
           i24, i24, i24, i24, i24, i24, i24, i24, i24, i24, i24
           i24, i24, i24, i24, i24, i24, i24, i24, i24, i24, i24
           i24, i24, i24, i24, i24, i24, i29, i30, i30, i30, i30
           i30, i30, i30, i30, i30, i30, i40, j0, j0, j0, j1
           j1, j1, j1, j2, j2, j4, j5, j5, j5, j5, j5
           j5, j5, j5, j5, j5, j5, j5, j5, j5, j5, j5
           j5, j5, j10, j10, j10, j10, j10, j10, j10, j10, j10
           j10, j10, j10, j10, j10, j10, j10, j10, j10, j10, j10
           j10, j10, j10, j10, j10, j15, j15, j20, j20, j20, j21
           j24, j24, j30, l90, m0, m2, m3, m10, n2, n10, p2
           p10, p15, p21, q10, r10, r105, s12, s40, u109, v109
  31977 e.
  32048 e.
  32080 e.
  32173 e.
  32208 e.
  32282 e.
  32507 e.
  32649 e.
  32723 e.
  32817 e.
  32896 e.
  32995 e.
  33085 e.
  33130 e.
  33145 e.
  33193 e.
  33426 e.
  33588 e.
  33609 e.
  33665 e.
  33781 e.
  33812 e.
  33880 e.
  33927 e.
  33960 e.
  34041 e.
  34070 e.
  34111 e.
  34194 e.
  34341 e.
  34374 e.
  34391 e.
  34406 e.
  34445 e.
  34798 e.
  34837 e.
  34954 e.
  34979 e.
  34996 e.
  35017 e.
  35039 e.
  35064 e.
  35097 e.
  35118 e.
  35142 e.
  35181 e.
  35254 e.
  35296 e.
  35352 e.
  35397 e.
  35471 e.
  35514 e.
  35616 e.
  35617 e.
  35670 e.
  35710 e.
  35780 e.
  35797 e.
  35821 e.
  35947 e.
  36125 e.
  36158 e.
  36458 e.
  36544 e.
  36614 e.
  36637 e.
  36698 e.
  36722 e.
  36753 e.
  36834 e.
  36857 e.
  36876 e.
  36958 e.
  36999 e.
  37084 e.
  37101 e.
  37148 e.
  37454 e.
  37495 e.
  37541 e.
  37570 e.
  37740 e.
  37840 e.
  37890 e.
  37994 e.
  38125 e.
  38142 e.
  38201 e.
  38318 e.
  38328 e.
  38475 e.
  38498 e.
  38508 e.
  38521 e.
  38555 e.
  38659 e.
  38851 e.
  38936 e.
  38966 e.
  38995 e.
  39244 e.
  39246 e.
  39284 e.
  39321 e.
  39338 e.
  39355 e.
  39365 e.
  39372 e.
  39379 e.
  39466 e.
  39516 e.
  39563 e.
  39620 e.
  39653 e.
  39668 e.
  39861 e.
  40015 e.
  40245 e.
  40356 e.
  40469 e.
  40495 e.
  40579 e.
  40592 e.
  40627 e.
  40728 e.
  40776 e.
  40883 e.
  41045 e.
  41236 e.
  41295 e.
  41500 e.
  41539 e.
  41787 e.
  42042 e.
  42180 e.
  42203 e.
  42255 e.
  42275 e.
  42280 e.
  42312 e.
  42314 e.
  42428 e.
  42433 e.
  b1    def   36066
        use   34571  34815  36593  36970  37014
  c0    def   33208
        use   35950  39100
  c1    def   33325
        use   34153  38817  38818  38824  38825  38837  38838
              38839  38854  38855  38976
  c2    def   33383
        use   35035  38868  38869  38963
  c3    def   33211
        use   33213  33251  38868
  c4    def   33213  33251
        use   35952
  c5    def   33214  33252
        use   35953
  c7    def   33215
        use   36577
  c8    def   33216
        use   36577
  c9    def   33217
        use   36578
  c10   def   33218
        use   36578
  c11   def   33288
        use   34354  38911  38912  38919  38920  38928  38929
  c12   def   33220
        use   36579
  c13   def   33224
        use   36582
  c14   def   33225
        use   36583
  c15   def   33234
        use   36586
  c16   def   33212
        use   33377
  c17   def   33282
        use   33283  34222  34224  34227  34255  34370  36827
  c18   def   33283
        use   33284  34257  34263  34364  36368
  c19   def   33286
        use   33287  34623  34824
  c20   def   33240
        use   33241  33856  33859  33874  33875  34164  34226
              35965  36000  36823  37113  38846
  c21   def   33241
        use   33282  33292  33855  33857  33858  33872  33873
              33876  34355  37114  38836  38845
  c22   def   33285
        use   33286  34367  34386  38504  38571  38578
  c23   def   33242
        use   34704  35671  35711  36056  36059  36587  36784
              36835  36858  36878  36960  37001  38204  38329
              38574  38650  38735
  c24   def   33278
        use   33392
  c25   def   33293  42311
        use   33294  34182  34363  34673  36208  37071  37139
              38971  38975  39288
  c26   def   33294
        use   33295  34660  36550  36592  36709  38260  38264
              38485  38494
  c27   def   33295
        use   33296  34431  34537  34546  34701  35157  36216
              36324  36681  37120  37121  37142  37144  38835
  c28   def   33292
        use   33293  33826  33841  36173
  c29   def   33297
        use   33298  34169  34420  34611  34635  34718  34769
              36623  36849  38166  38265  38488
  c30   def   33298
        use   33299  34536  34543  34610  34640  36682
  c31   def   33299
        use   33300  34545
  c32   def   33300
        use   33301  34572  36600  36711
  c33   def   33301
        use   33302  34577  36603  36711  36713
  c34   def   33302
        use   33303  34582  36553  36606  36713  36715
  c35   def   33303
        use   33304  36608  36738
  c36   def   33235
        use   38807
  c37   def   33304
        use   33305  34569  36551
  c38   def   33305
        use   33306
  c39   def   33308
        use   33309  34532  36555  36610  36682  36683
  c40   def   33309
        use   33310  34859  34861  36570  36572  36623  36625
  c41   def   33306
        use   33307  34596  34602  36558  36595  38135  38136
              38517
  c42   def   33307
        use   33308  34591  34599  36559  36596  38134  38135
              38516
  c43   def   33310
        use   33311  34173  34592  34595  34605  34864  34923
              36560  36597  38134  38518
  c44   def   33315
        use   33316  33324  34738  34740  34741  36567  38280
  c45   def   33316
        use   33317  38176
  c46   def   33317
        use   33318
  c47   def   33318
        use   38176  38180
  c48   def   33324
        use   33325  35129
  c49   def   33328
        use   35129  35135
  c50   def   33344
        use   33345  35033  35088  37067
  c51   def   33345
        use   33347  35051  35094  35095
  c52   def   33354
        use   33355
  c53   def   33355
        use   33356
  c54   def   33356
        use   33357
  c55   def   33357
        use   33358
  c56   def   33358
        use   33359
  c57   def   33364
        use   33366
  c58   def   33366
        use   33367  33469  33473  33500  33504  33532  33583
              33639  36141  36276  36348  38962
  c59   def   33367
        use   33377  33379
  c60   def   33372
        use   33373  33489  33545  33546
  c61   def   33373
        use   33374  33475  33507
  c62   def   33374
        use   33375
  c63   def   33375
        use   33376  33477  33505
  c64   def   33376
        use   33377  33378  33379  33472  33503
  c65   def   33380
        use   33381  33914  33915
  c66   def   33381
        use   33382  33915  36278  36285  36429  36452
  c67   def   33382
        use   33383  36279
  c68   def   33371
        use   33372  33479  33509
  c69   def   35888
        use   35724  38655
  c70   def   39242
        use   33198
  c71   def   33377
        use   33378  33380
  c72   def   33378
        use   33470
  c73   def   33379
        use   33501  33533  33582  33640  36142  36275  36349
              38961
  c74   def   33359
        use   33360
  c75   def   33296
        use   33297  34088  34090  34144  34145  34148  34149
              34177  34179  34435  34436  34439  34440  34631
              34633
  c78   def   33348
        use   33349
  c79   def   33350
        use   33351
  c80   def   33349
        use   33350
  c81   def   33226  33247
        use   38817
  c82   def   33227  33248
        use   38831
  c83   def   33352
        use   33353
  c84   def   33228  33249
        use   38795
  c89   def   33229
        use   38870
  c90   def   33347
        use   33348  35055  35080
  c91   def   33351
        use   33352
  c92   def   33353
        use   33354
  c93   def   33287
        use   33288  34828
  c95   def   33311
        use   33312  33328  34622  36616  38215  38271
  c96   def   33312
        use   33313  36616  36618  38216
  c97   def   33313
        use   33314  34567  34628  34637  34641  35138  38531
  c98   def   33314
        use   33315  34648  35140  36732
  c100  def   33230
  c101  def   33360
        use   33361
  c102  def   33361
        use   33362
  c103  def   33362
        use   33363
  c105  def   33363
        use   33364
  c106  def   33284
        use   33285  34258  34434  34438  34632  34634
  d0    def   33391  39298  40287
        use   33404  33410  35825  39104  40287
  d1    def   33628  41645
        use   33695  33736  35825  41031
  d2    def   33680  35841  36644  37577  41650
        use   33703  33792  33807  35109  35807  35808  35808
              35808  35809  35809  35810  35810  35825  36290
              36845  36862  37462  37511  37550  37603  37792
              38533  38774  41032
  d3    def   33695  40247
        use   33710  33715  33719  33732  35807  35825  40493
              40572  40953  40961  40984  41067  41251
  d4    def   33704  40248
        use   33741  35808  35825  41059  41105  41146
  d5    def   33711  40249
        use   35808  35825  41061  41078  41107
  d6    def   33720  40250
        use   35808  35826  41079  41085  41086  41087  41109
  d7    def   33742
        use   33769  35809  35826
  d8    def   33747  39383
        use   33735  35809  35826  39393  40402  40434  40435
  d9    def   33823  35842  39386
        use   35826  36295  40378  40454  40855  40857  40881
  d10   def   33838  35843  39387
        use   35826  36203  36762  36775  40376  40857
  d11   def   33733  39389
        use   33737  35810  35826  40435
  d12   def   33902  35844  39391
        use   35827  38802  40393  40855
  d13   def   33738
        use   35810
  d14   def   34053  35845  36646  40252
        use   35828  37441  37484  37529  37562  37694  37721
              37829  38799  39947
  d15   def   33791  35846  36645  37578  40251
        use   35828  36476  36627  36866  37005  37110  37132
              37354  37359  37373  38062  38151  38183  38218
              38775  39635  39689  39743  39825  39841  39921
              40221  40252
  d16   def   33806  35847  36647  37579
        use   35828  36508  36620  36685  36706  36717  36725
              37378  37386  37388  37504  37506  37508  37750
              37803  38137  38139  38153  38155  38185  38187
              38469  38480  38512  38514  38776
  d17   def   33854  35848  36648  40253
        use   34388  35828  36264  36375  37122  39530  39702
  d18   def   33871  35849  36649  40254
        use   34359  35828  36218  37146  39527  39529  41327
  d19   def   33908  35850  36650  40255
        use   33401  33904  35828  36108  36304  36382  36893
              37405  37437  37548  37648  38783  41467
  d20   def   33940  34516  35851  36651  40256
        use   33406  33413  33981  33989  34029  34034  34060
              34516  35685  35829  36120  36409  36412  36415
              36424  36952  36969  36975  36980  36984  36994
              37445  37486  37531  37564  37696  37723  37831
              38784  41466
  d21   def   33970  35852  36652  40257
        use   33403  35829  36109  36113  36390  36397  36896
              36920  36922  36927  36931  36935  36939  36943
              36945  36950  36964  37424  37430  37439  37482
              37522  37560  37684  37713  37719  37827  37884
              37886  37888  38785  41465
  d22   def   34008  34517  35853  36653  40258
        use   33408  34517  35702  35829  36117  36415  36419
              36967  36973  36978  36982  37426  37428  37433
              37527  37692  38791  39542  39698  39722
  d23   def   34083  35854  36654
        use   33414  35829  36121  36425  36953  36995  37446
              37487  37532  37565  37697  37724  37832  38786
  d24   def   34138  35855  36655  40259
        use   33398  35829  36260  36369  41330
  d25   def   34250  35856  40260
        use   34428  34818  35008  35829  36365  41336
  d26   def   34085  35857  40261
        use   35830  36282  41331  41458
  d27   def   34279  35858  36656  40262
        use   34539  34540  35830  37039  41459
  d28   def   34300  40263
        use   34539  35830  41134  41462
  d29   def   34325  35859  40264
        use   34534  35830  36966  41133  41464
  d30   def   34352  40265
        use   34621  35830  41139  41463
  d31   def   34383
        use   35014  35830
  d33   def   34400  40266
        use   34817  34965  34989  35007  35831  36385  41460
  d34   def   34418  35860  36657  37580  40267
        use   35831  36769  36776  36781  36787  36815  36844
              38063  38150  38506  41461
  d35   def   34530  35861  40268
        use   35831  36747  36756  36763  39577  39589  39611
              41328
  d36   def   34813  35862  40269
        use   34921  35831  36751  36804  40651  40656  42295
              42297  42299  42303
  d37   def   34853  35863  40270
        use   35831  36757  36764  36770  42295
  d38   def   34964  35864  40272
        use   35832  36765  36777  36805  39797  39827
  d39   def   34988  35865  36658  37581  40273
        use   35832  36385  36386  36445  36782  36788  36816
              36829  38080  39798
  d40   def   35006  35866  40274
        use   34645  34656  34666  34777  35832  36447  36818
              36831  39299  39547  39732  39794  39816  39822
              40045  41307
  d41   def   35029  35867  36659  40275
        use   35832  36234  36272  36377  39815  40047  40232
              41323
  d42   def   35050  35868  36660  37582  40276
        use   35237  35286  35832  36178  36191  36283  36436
              36954  36996  37447  37488  37533  37566  37698
              37725  37833  38413  38641  38787  39690  40062
              40238
  d43   def   35077  40277
        use   35832  36244  39895  39907  39961  40315  40749
              40780  40991  41051  41053  41068  41261
  d44   def   34137  35869  36661  40278
        use   35833  37135  40587  41241
  d45   def   35107  35870  40279
        use   35833  36736  40799  40901  40949  40990  41052
              41083  41260  41270  41321
  d46   def   35127  35871  36662  37583  40280
        use   35833  36561  36611  38217  40482  40533  40536
              41301
  d47   def   41027
        use   39982  40001
  d48   def   35155  41028
        use   35833  36209  40014
  d49   def   40271
        use   40226  40661  40683  40706  42297  42299
  d51   def   35213  35872  36663
        use   35833  37396  38793
  d52   def   35270  35873  36664  39302
        use   35833  37473
  d53   def   35318  35874  36665  39301
        use   35834  37518  37669  40159  40576  40768  40769
  d54   def   35368  35875  36666  39301
        use   35834  37554  40114  40157  40166  40169  41118
  d55   def   35414  35876  36667  39303
        use   35834  37629  37655  38796  40142  40176  40551
              40553  40569  40571  41264
  d56   def   35489  35877  36668  39304
        use   35278  35331  35376  35427  35834  37619  37753
              39305  39306  39307  39308  39308
  d57   def   35415  35878  36669  39305
        use   35834  37819  38797  40051  40762  41106
  d58   def   35572  35879  36670
        use   35834  38809
  d59   def   35212
        use   35835  38814
  d61   def   35645  35880  36671  37584  39306
        use   35835  36563  38190  38285  39994  40325  40327
              40329  40401  40437  40547  40549  40565  40567
              40742  40746  40995  40999  41014
  d64   def   34136  35881  36672  39307
        use   35835  37117  41108  41115
  d66   def   39308
        use   39944  41111  41123
  d67   def   39308
        use   40766  41120
  d70   def   35683  35882
        use   35835  36898
  d71   def   35701  35883
        use   35835  36902  36906  36909  36912
  d73   def   35789
        use   34716  35835
  d74   def   35790  36673  37585
        use   35836  38598
  d76   def   38569
        use   36457  36833
  d77   def   35722  35884  36674  37586
        use   35836  38221  38242  38576
  d78   def   35753  35885  36675  37587
        use   35836  38243  38588
  d79   def   33455  35886
        use   35836  36454  36479  38790
  d80   def   33498  35887
        use   33744  35836  36484
  d81   def   33516
        use   33511  33684  35836
  d82   def   33522
        use   33491  33642  35837
  d83   def   33528
        use   35837
  d84   def   33600
        use   33458  33551  33569  33585  35837
  e0    def   35950
  e1    def   36068  40281
        use   34450  39719  39741  39752  39769  39813  39845
              40063  40191  40213  40374  40398  40424  40463
              40552  40554  40568  40570  40968  40969  40974
              41056  41141  41246  41308
  e2    def   35952  40282
        use   34574  35060  35062  35089  35091  36251  36599
              38012  39962  40548  40550  40562  40566  40759
              40771  40952  40960  40965  40983  41054  41248
              41277
  e3    def   35953
        use   34579  36602  38013
  e4    def   35954
        use   39206
  e5    def   35955  39309
        use   34451  39479
  e6    def   35956  39309
        use   34452
  e7    def   35957  39310
        use   36307  39504
  e8    def   39310
  e9    def   35959  40283
        use   34453  39607
  e10   def   35960
        use   34454
  e11   def   35961  40284
        use   34675  41338
  e12   def   35958
        use   38014
  e13   def   35962  40285
        use   35030  41361
  e14   def   35963
        use   35036
  e15   def   35965
        use   34455  35966  35966  36823  36824
  e16   def   35967
        use   34456  34652  38015  38782
  e17   def   35968
        use   36068  38801  39138
  e18   def   35969  39357
        use   34457  40720
  e19   def   35970  39313
        use   34458  35112  36114  36850  36865  38016  38780
              39361  40717
  e20   def   35973  39322
        use   34459  34715  34770  35053  35078  35281  35382
              35763  36112  36115  36313  36477  36629  36867
              38017  38781  39368  40718
  e21   def   35974  39339
        use   34460  34712  34765  35764  36314  36539  36631
              38018  39375  40719
  e22   def   35975
        use   34461  35767  36744  36812
  e23   def   35976
        use   34462  34714  34767  35768  36427  36438  36448
              36633  38019
  e24   def   35971
        use   33438  34463  35032  35050  35077  35086  36140
              36347  36428  36451  38020
  e25   def   35985
        use   33421  34464  34531  34535  34542  34672  34698
              34717  34735  34744  34768  34858  34922  35128
              35156  36172  36202  36207  36214  36262  36292
              36323  36371  36565  36569  36761  36774  36848
              38021
  e26   def   35986
        use   33439  34465  36288  36434
  e27   def   35987
        use   33441  34466
  e28   def   35988
        use   33440  34467  36286  36435
  e29   def   35989
        use   34468  34620  34854  34883  36372  36748  36789
              36828  38022
  e30   def   35995
        use   34469  34630  35058  35084  36826  38023
  e31   def   35998
        use   34470
  e32   def   36005
        use   33422  33445  35220  35272  35284  35320  35337
              35370  35384  35420  35434  36357  36359  36361
              36363  36383  36394  36398  36400  36402  36421
              36426  36430  36432  38024  38806
  e33   def   35964
        use   34471
  e34   def   35999
  e35   def   36000
        use   34472  36215  38025  38826
  e36   def   36002
  e37   def   36003
        use   34473  38026
  e38   def   36004
        use   34474  38027
  e39   def   36012
        use   36223  36225  36245  36391
  e40   def   36013
        use   34475  34833  34869  34878  34918  34924  34966
              34990  35010  36396  38805
  e41   def   36014
        use   34476  34860
  e42   def   36022
        use   34477  38808
  e43   def   36016
        use   34478  34862
  e44   def   36018
        use   34479  38028  38804
  e45   def   36019
        use   34480
  e46   def   36020
        use   34481  38029  38083
  e47   def   36024
        use   33442  34910  35731  36281  38030
  e48   def   36025
        use   35732
  e49   def   36026
        use   33443  34907  35734  36280  38031
  e50   def   36027
        use   33444  34909  35730  38032
  e51   def   36029
        use   33446  34771  34879  34912  34914  34992  35339
              35387  35439  35590  35736  35738  36237  36248
              36269  37013  37028  38033  38658
  e52   def   36030
        use   34758  35240  35346  36287  38034
  e53   def   36023
        use   34482  38803
  e54   def   36032
        use   38035
  e55   def   36017
        use   34483
  e56   def   36034
        use   34484  38036
  e57   def   36035
        use   34485
  e58   def   36036
        use   34486  34908  38037
  e59   def   36037
        use   34487  34884  35092  36045  36243  37032  38038
  e60   def   36038
        use   34488  34899  37035
  e61   def   36039
        use   34820  34827  34832
  e62   def   36040
        use   34816
  e63   def   36041
        use   34831
  e64   def   36042
        use   34821
  e65   def   36043
  e66   def   36044
        use   34814  34893  34920  36046
  e67   def   36045
        use   34891  38039
  e68   def   36046
  e69   def   36048
  e70   def   36052
        use   35771  38040
  e71   def   36053
        use   35755  35773  38041
  e72   def   36054
        use   35137  38042  38800
  e75   def   35984
        use   33447  36374  36453
  e76   def   36050
        use   33448  36478
  e77   def   36051
        use   36165  36293  36298  36574  38043
  e78   def   35978
        use   36889  36956  38044
  e79   def   35979
        use   34489  34700  36171  38045
  e80   def   36060
        use   36331  38327
  e81   def   35980
        use   36139  36163
  e83   def   35982
        use   35215  35241  35245  35249  35271  35289  35294
              38046
  e85   def   36065
        use   35775  38047
  e86   def   38815
        use   35795
  e87   def   36028
        use   34493  35079  38048
  e88   def   36006
        use   35052  36229
  e89   def   36007
        use   33425  36170  36227  36306  36343  38049
  e90   def   35990
        use   33424  34494  36258  36367  38792
  e101  def   35991
        use   38050
  e102  def   35992
        use   38051  38813
  e103  def   35993
        use   38052
  e104  def   35997
        use   38053
  e105  def   35994
        use   38054
  e109  def   36011
        use   34495  38058
  f0    def   39425  40288  40629
        use   39482  39511  40288  40629  40695  40929
  f1    def   39456  40289  40630
        use   39478  39480  39503  39505  40000  40140  40155
              40164  40174  40192  40194  40214  40216  40289
              40352  40453  40630  41282  41382
  f2    def   39449  40290  40631
        use   39608  40118  40153  40177  40206  40290  40459
              40462  40590  40631  40678  40680  40682  40686
              41004  41092  41097  41314  41340  41362
  f3    def   39415  40291  40632
        use   39484  40161  40171  40178  40198  40219  40291
              40632  40851  40870
  f4    def   41379
        use   41360  41404
  f5    def   39475  40292  40633
        use   40002  40143  40292  40354  40455  40633  41019
              41284  41405
  f6    def   39500  40293
        use   39644  39726  39765  39983  40293
  f7    def   39525
        use   39579
  f8    def   39573  40294
        use   40294  41333  41422
  f9    def   39684
        use   39532  40074
  f10   def   39629
  f11   def   39662
        use   41136
  f12   def   39630  40295  40497
        use   40064  40295  40497  41143  41433  41448
  f13   def   39685
  f15   def   39791  40296
        use   40053  40068  40209  40242  40296  41329
  f16   def   39792
  f17   def   39837  40297
        use   40185  40201  40297  41317
  f18   def   41895
        use   40715
  f19   def   41932
        use   40713
  f20   def   41720
        use   40714
  f21   def   39880  40298
        use   40298  40409  40428  40992  41262
  f22   def   39881  40299
        use   40299  41130
  f23   def   40042
        use   40430  41011
  f24   def   40314
        use   40407  40426  40750  40781  41223  41287
  f25   def   40371
        use   41008
  f26   def   39875
        use   40760
  f27   def   39876
        use   40772
  f29   def   40481
        use   40979  41255
  f30   def   40498
        use   40488  41259  41263
  f31   def   40499
        use   40710  40740  40782  40783  40861  40888  41229
              41242  41315
  f32   def   40500
        use   40862  40989  41228  41288  41289  41320
  f33   def   40501
        use   40792  40957  40962  40971  40976  41062  41252
              41256  41267  41318
  f34   def   40502
        use   40526  41300
  f35   def   40503
        use   40779  40790  41050  41058  41060  41272  41310
  f36   def   40524
        use   40789  41055  41057  41275  41309
  f37   def   40532
        use   40966  40970  40975
  f38   def   40545
        use   39959
  f39   def   40560
        use   39886  39950
  f40   def   40586
        use   40234
  f41   def   40504
        use   39440
  f42   def   40505
        use   39431
  f43   def   40506
        use   39460  40836  40838  40843  40848  40867  40920
  f44   def   40507
        use   39436
  f45   def   40508
        use   39437
  f46   def   40509
        use   40916
  f47   def   40510
        use   41009
  f48   def   40511
        use   40709
  f49   def   40512
        use   40158  40160  40167  40170  40197  40218  40840
              40845  40850  40869  40926  40927
  f50   def   40513
        use   40934
  f51   def   40514
        use   41180
  f52   def   40515
        use   41214
  f53   def   40516
        use   40926
  f55   def   40517
        use   40645  40675  40703
  f56   def   40604
        use   40701
  f57   def   41521
        use   40650
  f58   def   40518
  f60   def   40519  41237
        use   41237  41534  42096
  g0    def   31968  32103  32467  33082  33127  33140  40643
        use   31963  31965  32163  32506  33078  33127  33129
              33140  33142  40274
  g1    def   31975  32106  32473  32801  32848  32965  36069
              36676  41330
        use   31974  32169  32470  32796  32846  32963  36187
              36350  36676  37065  38470  41349
  g2    def   32018  32108  32478  32984  36072  37154  37588
              41333
        use   32014  32172  32471  32982  33797  36110  36303
              36339  36511  37154  37365  37588  37992  38543
              38546  38777  41344
  g3    def   32480  36073  36677  41342
        use   32477  33434  34499  34857  36330  36332  36630
              36677  37141  41337
  g4    def   32116  32487  36074  41345
        use   32133  32136  32485  34500  41335
  g5    def   32023  32078  32124  32200  32274  32490  32634
              32703  32803  36075  41346
        use   32020  32076  32119  32190  32193  32256  32269
              32475  32626  32700  32795  34501  41374
  g6    def   32027  32128  32494  33143  36076  41353
        use   32026  32126  32465  33139  34502  35729
  g7    def   32033  32500  36077  41354
        use   32031  32498  34503  41359
  g8    def   32130  32504  36078  41364
        use   32115  32466  34504  36727  41355
  g9    def   32042  32134  36079  37155  41370
        use   32011  32131  34505  37155  41403  41413  41453
              41662  41663
  g10   def   32035  32137  32279  32706  32808  36080
        use   32008  32009  32122  32273  32702  32792  34506
              36870
  g11   def   32143  36081  37156  37589  40889
        use   32141  34507  34951  35013  35742  37009  37074
              37075  37156  37589  38112  38113  38632  38789
              40688
  g12   def   36082  37590
        use   33435  34950  35727  37012  37075  37076  37590
              38113  38114
  g13   def   36083  37591  41322
        use   34949  37074  37591  38114  38116  41311
  g14   def   36084
        use   34948  37076  37078
  g15   def   32714  36085  37157  37592
        use   32697  32698  33436  34947  37062  37157  37592
              38111  38622
  g16   def   36086  37158
        use   36564  36853  36872  37158  37754  37757  38191
  g17   def   36087
        use   36874
  g18   def   36088
        use   34508  36472
  g19   def   36089  37159
        use   33437  34509  34868  34953  37159  38068
  g20   def   32170  32717  36090  37160  41387
        use   32168  32692  34510  37160  38169  41656
  g21   def   36091  37161  41391
        use   37161  38171  41657
  g22   def   36092  37162  41394
        use   37136  37162  38247  38254  41658
  g23   def   36093  41397
        use   36388  36389  41659
  g24   def   36094  41399
        use   36388  41660
  g25   def   36095  41402
        use   34511  41389  41392  41395  41398  41418
  g26   def   36096
        use   36963
  g27   def   36097  37163
        use   34512  37163  38482  38493
  g28   def   36161
        use   36069  36072  36073  36078  36081  36082  36083
              36085  36088  36099
  g29   def   36098
        use   34952
  g30   def   36221  41409
        use   33423  35063  36250  37064  37083  41661
  g31   def   36223  37164  41420
        use   36235  36253  36378  37164  41435
  g32   def   36224  41422
        use   36222  36230  41429  41441
  g33   def   36245  41436
        use   36255  36261  36366  36370  41424
  g34   def   36251  41450
        use   36233  41444
  g35   def   36290  37165  37593  41454
        use   36182  36195  36351  36455  36480  36485  36543
              36635  36696  36710  36719  36733  36752  36758
              36766  36771  36778  36783  36792  36806  36819
              36825  36884  36998  37099  37123  37147  37165
              37449  37464  37478  37490  37537  37593  37612
              37730  38111  38112  38141  38172  38195  38305
              38326  38345  38471  38486  38495  38519  38552
              38778  41423  41434  41449
  g36   def   36291  37166
        use   36542  36739  36847  36864  37166  37469  37538
              37552  37608  37822  37836  38779
  g37   def   36308
        use   36315  36346
  g38   def   36337
        use   36312
  g39   def   36277
  g40   def   36333  40733
        use   36328  39395
  g41   def   36231  40778
        use   36228  39396
  g42   def   36420  40787
        use   36406  39397
  g43   def   36399  40956
        use   36422  39398
  g44   def   36419  41049
        use   36404  39399
  g45   def   36459  41239
        use   36333  38685  38686  38687  38688  38689  38690
              38691  38692  38693  38694  38695  38696  38697
              38698  38699  38700  38701  38702  38703  38704
              38705  38706  38707  38708  38709  38710  38711
              38712  38713  38714  38715  38716  38717  38718
              38719  38720  38721  38722  38723  38724  38725
              38726  38727  38728  38729  38730  38731  38732
              38733  38734  38736  38738  38739  38740  38741
              38742  38743  38744  38745  38746  38747  38753
              38773  39400
  g46   def   36271  41298
        use   36188  36197  39401
  g47   def   36099  37167  40948
        use   36955  36997  37167  37489  37534  37567  37834
              38788  39402  42305
  g48   def   36070  40887
        use   36168  39403
  g49   def   36505  41245
        use   38698  39404
  g50   def   36354
        use   36257
  g51   def   36547
        use   38719
  g52   def   36623
        use   36575  38726
  g53   def   36625
        use   38727
  g54   def   36679  41316
        use   38686  39619  41334  41341  41363  41406  41457
              41664
  g55   def   36704
        use   38747
  g56   def   36683
        use   38739
  g57   def   36475
        use   38729
  g58   def   36483
        use   38745
  g59   def   36725
        use   38696
  g60   def   36711
        use   38692
  g61   def   36713
        use   38687
  g62   def   36715
        use   38707
  g63   def   36736
        use   38703
  g64   def   36744
        use   38697
  g65   def   36756
        use   38705
  g66   def   36761  37168
        use   37168  38304  38738
  g67   def   36769
        use   38713
  g68   def   36774
        use   38740
  g69   def   36781
        use   38741
  g70   def   36461  36785  39395
        use   38690  41667
  g71   def   36812  39396
        use   38507  38731  41670  41673
  g72   def   36462  36836  39397
        use   38704  41672
  g73   def   36463  36839  39398
        use   38701  41668  41671
  g74   def   36464  36859  39399
        use   38693  41669
  g75   def   36465  36880  39400
        use   38712  41675
  g76   def   36466  36961  39401
        use   38716  41666
  g77   def   36467  37002  39402
        use   38736
  g78   def   39403
        use   41674
  g79   def   38061  39404
        use   38700  39407  41676
  g80   def   38136
        use   38728
  g81   def   38150
        use   38691
  g82   def   38135
        use   38715
  g83   def   36468  36588
        use   38685
  g84   def   38175
        use   38742
  g85   def   38179
        use   38722
  g86   def   38134
        use   38746
  g87   def   38321
        use   38714
  g88   def   38323
        use   38744
  g89   def   36469  38210
        use   38708
  g90   def   36470  38346
        use   38753
  g91   def   36471  38334
        use   38717
  g92   def   38529
        use   38688
  g93   def   38478
        use   38724
  g94   def   36616
        use   38702
  g95   def   36618
        use   38721
  g96   def   38205
        use   38709
  g97   def   36451
        use   36440
  g98   def   36347
        use   36301
  g99   def   38500
        use   38720
  g100  def   38510
        use   38689
  g101  def   36100
        use   34513
  g102  def   38531
        use   38730
  g103  def   36159
        use   36074  36075  36076  36077  36079  36080  36084
              36086  36087  36089  36090  36091  36092  36095
              36097  36098  36100  36101  36102
  g104  def   36821
        use   36832  38734
  g105  def   36104
        use   36177  36190  38648
  g106  def   36186
        use   36175
  g107  def   36201
        use   36192  36196  36284
  g108  def   36206
        use   36179  36184  36273  36444  36450
  g109  def   36213
  g110  def   36128
        use   36181  36194
  g111  def   36101  37594
        use   37594  38338  38342
  g112  def   37352
        use   36746  38695
  g113  def   37461
        use   36814  37477  38699
  g114  def   37502
        use   38710
  g115  def   37549
        use   37556  38743
  g116  def   37602
        use   38711
  g117  def   37749
        use   38706
  g118  def   37614
        use   38794
  g119  def   37092
        use   38694
  g120  def   36103
        use   38647
  g121  def   37991
        use   38723
  g122  def   37992
        use   38718
  g123  def   37861
        use   37492
  g124  def   37108
        use   38725
  g125  def   37130
        use   38733
  g126  def   36102
        use   37115  37118
  g127  def   37862
        use   37732
  g128  def   38477
        use   38732
  h0    def   38663  41655
        use   35955  40255
  h1    def   35811  41664
        use   35956  40256
  h2    def   38684  39300
        use   35957
  h3    def   38754  41665
        use   35958  39300
  h4    def   38817  41678
        use   35959  36001  38824  38825  38827  40259  41679
  h5    def   38855  41679
        use   35960  38988  40260  41680
  h6    def   38858  41680
        use   35961  40263  40265  41681
  h7    def   41681
        use   40264  40265  41682
  h8    def   38867  41682
        use   35962  35971  38989  40006  40025  40364  40578
              41230  41685
  h9    def   38869  41685
        use   35963  38990  41686
  h10   def   38911  41686
        use   35964  38919  38920  39855  41687
  h11   def   38913  41683
        use   37100  38930  41685
  h12   def   38944  41687
        use   38945  39112  42301
  h13   def   38945
        use   38754
  h14   def   38756
        use   37452
  h15   def   38771
        use   37453
  h19   def   38870
        use   36052  38645
  h20   def   38871
        use   33433  36053  38646
  h21   def   38852
        use   35985  35998  38987
  h22   def   38818
        use   36001  38840  38846
  h23   def   38874
        use   35468  37336  38878
  h24   def   38876
        use   35469  37337
  h25   def   38880
        use   37838
  h26   def   38896
        use   37839
  i0    def   33168  33420  33429  33597  33645  33762  33796
              33844  33948  33973  34252  34354  34444  34836
              34974  34995  35031  35054  35080  35109  35131
              35177  35253  35614  35668  35709  35756  35794
              35807  35923  36151  36457  36507  36576  36697
              36743  36811  36845  36862  37015  37100  37855
              38154  38308  38327  38440  38553  38644  38823
              38919  38949  39259  39316  39325  39342  39463
              39483  39529  39578  39663  39689  39906  40373
              40485  40896  41225  41304  42125  42201  42254
              42283  42349
        use   33171  33175  33402  33456  33490  33602  33631
              33636  33771  33791  33795  33806  33811  33824
              33827  33839  33842  33945  33985  34256  34356
              34418  34443  34813  34835  34964  34973  34988
              34994  35037  35059  35085  35116  35136  35170
              35214  35221  35611  35645  35654  35666  35701
              35703  35777  35790  35793  35807  35807  35813
              35814  35925  35929  36147  36446  36515  36548
              36590  36679  36745  36813  36854  36875  37023
              37094  37881  38281  38289  38325  38458  38538
              38828  38829  38849  38921  38923  38951  39029
              39262  39266  39318  39318  39331  39331  39349
              39349  39427  39442  39458  39515  39537  39588
              39666  39756  39937  40411  40491  40893  40909
              40932  40938  41091  41096  41131  41152  41155
              41160  41167  41181  41193  41202  41215  41220
              41224  41493  42129  42179  42190  42196  42211
              42253  42310  42385  42418
  i1    def   33169  33405  33430  33598  33650  33845  33955
              33975  34282  34390  34677  34942  35016  35117
              35137  35178  35465  35615  35669  35708  35771
              35795  35807  35923  36124  36717  36833  36851
              36883  37451  37540  37736  37856  38122  38160
              38309  38441  38497  38506  38554  38645  38825
              38920  38949  39260  39317  39326  39343  39464
              39488  39593  39726  39916  40320  40395  40712
              40736  40813  40981  41158  41257  41486  42126
              42202  42350
        use   33175  33411  33529  33575  33641  33949  33985
              33986  34287  34383  34389  34694  34865  34871
              34926  34939  35006  35015  35107  35111  35133
              35167  35419  35425  35446  35606  35612  35647
              35648  35650  35664  35683  35689  35705  35760
              35765  35769  35791  35817  35929  36106  36122
              36817  36830  36843  36892  36957  37521  37523
              37683  37685  37881  37882  38065  38071  38118
              38163  38276  38287  38357  38368  38481  38502
              38532  38551  38593  38607  38609  38832  38924
              38925  38951  39030  39266  39318  39331  39332
              39349  39350  39428  39443  39459  39481  39582
              39693  39948  40326  40390  40648  40665  40751
              40761  40764  40773  40774  40795  40895  40993
              41012  41017  41018  41163  41254  41492  42133
              42195
  i2    def   33181  33421  33431  33599  33629  33797  33879
              33926  33987  34068  34108  34304  34795  34944
              35179  35796  35807  35935  36150  36578  36720
              36855  36922  37074  37452  37737  37858  38124
              38145  38310  38451  38507  38646  38826  38949
              39272  39327  39344  39465  39489  39607  39732
              39884  40054  40713  40738  40834  40985  41166
              41698  42127  42377
        use   33188  33400  33601  33604  33643  33794  33809
              33854  33860  33871  33877  33909  33922  33979
              34054  34064  34095  34098  34311  34530  34726
              34748  34938  35169  35789  35820  35942  36146
              36552  36704  36842  36919  37027  37361  37679
              37738  37861  38119  38152  38184  38279  38282
              38293  38296  38364  38505  38575  38612  38842
              38951  39279  39332  39332  39350  39350  39432
              39475  39485  39500  39594  39601  39696  39879
              40127  40653  40744  40811  40980  41172  41709
              42159  42356  42382
  i3    def   33188  33422  33432  33662  33959  34069  34192
              34328  34682  34945  35180  35350  35395  35466
              35512  35808  35942  36579  36721  36924  37075
              37453  37838  37859  38196  38453  38520  38653
              38827  38950  39279  39328  39345  39490  39538
              39610  39650  39765  40622  40714  40739  40859
              40940  41174  41266  41707  42128  42301  42393
        use   33192  33415  33457  33486  33530  33574  33647
              33940  33957  34055  34065  34140  34184  34188
              34332  34679  35165  35172  35319  35347  35369
              35392  35417  35462  35490  35509  35813  35816
              35816  35946  36554  36708  36917  37031  37364
              37770  37879  37889  38164  38189  38358  38373
              38513  38515  38592  38602  38833  38834  38843
              38844  38951  39182  39283  39332  39333  39350
              39351  39476  39486  39501  39531  39606  39739
              39751  39777  40605  40620  40663  40735  40871
              40913  41170  41280  41285  41710  42155  42284
              42426
  i4    def   33423  33663  33763  34001  34193  34333  34692
              35467  35808  36149  36580  36929  37076  37350
              37839  37857  38197  38447  38654  38950  39329
              39346  39508  39550  39615  39652  39769  40623
              40715  40864  41199  42302  42363
        use   33419  33659  33714  33751  33758  34017  34021
              34031  34139  34158  34180  34329  34681  35418
              35450  35458  35813  35819  36143  36568  36926
              37034  37362  37363  37775  37861  37862  38146
              38361  38379  38595  38596  38603  38606  38951
              39183  39333  39333  39351  39351  39514  39534
              39603  39604  39642  39730  40606  40615  40658
              40798  40803  40805  40816  41206  42285  42368
              42370
  i5    def   33424  33433  33664  33764  34239  34373  34706
              35469  35808  36119  36156  36580  36933  37077
              37351  37860  38199  38449  38655  38950  39330
              39347  39553  39616  39652  39707  39942  40069
              40338  40406  40624  40716  40987  41124  41312
              42303  42424
        use   33397  33535  33628  33661  33691  33727  33729
              33731  33739  34230  34237  34357  34362  34365
              34725  35423  35813  35819  36111  36137  36152
              36571  36930  37052  37370  37863  37883  38148
              38362  38385  38616  38634  38951  39184  39333
              39351  39546  39549  39632  39648  39819  39828
              39928  40059  40211  40341  40347  40445  40608
              40668  40942  40955  40964  40973  40978  41129
              41490  42293  42359  42360
  i6    def   33425  33990  34265  35809  36157  36583  36937
              37078  38200  38443  38656  38951  39559  39616
              39651  39697  40078  40625  40717  41095  41709
              42305  42409
        use   33418  34253  35814  35814  35816  35817  35820
              36138  36153  36566  36934  37040  38182  38193
              38365  38393  39129  39539  39578  39585  39633
              39782  40240  40617  40677  41073  41752  42290
              42403
  i7    def   33991  34290  34722  35809  36941  38445  38647
              38951  39560  39617  39775  40718  41100  41710
              42306  42412
        use   34039  34283  34710  35816  35817  35819  35820
              36938  38359  38395  38639  39130  39554  39573
              39590  39598  39612  39734  40679  41090  41757
              42291  42416
  i8    def   33544  34315  34734  36584  36945  38455  38648
              38951  39561  39618  39843  40082  40719  41010
              41142  41711  42308
        use   33539  34305  34307  34703  36591  36942  38409
              38640  39131  39525  39556  39574  39580  39591
              39609  39613  39839  40090  40096  40112  40120
              40681  41007  41147  41733  41735  41736  41768
              41770  41771  42287
  i9    def   34930  35810  36585  36947  38111  38456  38999
              39562  39602  39746  39971  40720  41088  41286
              41485  41712  42309
        use   34875  35814  35817  35820  36556  36557  36915
              38099  38102  38459  38986  39526  39533  39557
              39597  39759  39958  40684  41082  41269  41303
              41738  42288
  i10   def   33175  33176  33177  33178  33179  33180  33567
              34013  34931  34975  35684  35744  35810  35929
              35930  35931  35932  35933  35934  36568  38113
              38311  38457  38657  38956  39266  39267  39268
              39269  39270  39271  39430  39555  39619  39712
              39973  40098  40345  40412  40721  41221  41713
        use   33176  33176  33177  33177  33178  33178  33179
              33179  33180  33180  33184  33534  34010  34873
              34882  34968  35688  35707  35723  35743  35754
              35758  35770  35779  35819  35930  35930  35931
              35931  35932  35932  35933  35933  35934  35934
              35938  36612  38073  38262  38410  38569  38573
              38633  38637  39204  39241  39243  39267  39267
              39268  39268  39269  39269  39270  39270  39271
              39271  39275  39462  39552  39600  39715  39910
              40093  40337  40382  40690  41144  41740  41750
              41774  41776
  i11   def   33180  33578  34021  34728  34932  34976  35934
              38114  38461  38658  39271  39757  39976  40113
              40349  40722  41714
        use   33180  33184  33466  34026  34706  34722  34877
              34888  34969  35934  35938  38075  38352  38411
              38422  38626  38628  39271  39275  39737  39913
              40111  40343  40700  41720  41786
  i12   def   33179  33577  34027  34727  34933  34978  35933
              37066  38115  38312  38462  39240  39270  39780
              39979  40724  41715
        use   33179  33183  33557  33566  34018  34971  35933
              35937  37083  38079  38226  38256  38356  38956
              39205  39270  39274  39776  39931  40705  41725
              41743  41753  41754  41756  41780
  i13   def   33178  33579  34028  34736  34934  35932  38313
              38463  39206  39269  39760  39985  40130  40725
              41716
        use   33178  33183  33471  34023  34790  34895  34906
              35932  35937  38239  38252  38360  39269  39274
              39783  39941  40094  40108  40697  41759  41760
  i14   def   33177  34030  34751  34935  35931  38314  38464
              39210  39268  39989  40148  40726
        use   33177  33182  34037  34786  34917  35931  35936
              38224  38238  38250  38363  39196  39200  39268
              39273  39965  40107  40696
  i15   def   33176  34040  34757  34938  35930  38315  38465
              39211  39267  39441  39992  40184  40351  40446
        use   33176  33182  34015  34028  34038  34763  34928
              35930  35936  38257  38283  38297  38392  39222
              39267  39273  39435  39970  40072  40405
  i16   def   34779  34947  38316  38466  40123  40452
        use   34774  34935  38213  38303  38429  40087  40101
              40243
  i17   def   34787  38317  40190  40448
        use   34776  38261  40076  40414
  i18   def   38467  39226  40200  40457
        use   38434  39000  39093  39146  39231  40223  40417
  i19   def   34672  38468  39232  40450
        use   34662  34665  38425  38428  39237  40443
  i20   def   33175  33176  33177  33178  33179  33180  34791
              34946  35929  35930  35931  35932  35933  35934
              37082  38989  39266  39267  39268  39269  39270
              39271  39999  40204  40460
        use   33176  33176  33177  33177  33178  33178  33179
              33179  33180  33180  33187  34755  34778  34863
              34936  34941  35930  35930  35931  35931  35932
              35932  35933  35933  35934  35934  35941  37048
              37073  38959  39267  39267  39268  39268  39269
              39269  39270  39270  39271  39271  39278  39974
              39977  39987  39990  39997  40065  40408  40410
              40427  40429  40431  40456
  i21   def   33180  34731  35934  38990  39271  40212  41717
        use   33180  33187  34561  35934  35941  38964  39271
              39278  40075  41747
  i22   def   33179  34792  35730  35933  37083  38469  39270
              40242  41718
        use   33179  33186  34737  34788  35933  35940  37063
              38335  38340  38343  38348  38350  39270  39277
              40235  41748
  i23   def   33178  34793  35932  38470  39269
        use   33178  33186  34742  34782  35932  35940  38355
              39269  39277
  i24   def   33177  34794  35931  38471  39268
        use   33177  33185  34739  34761  34781  35931  35939
              38424  39268  39276
  i25   def   33176  34610  35930  36586  38472  39267
        use   33176  33185  35930  35939  36562  38403  39267
              39276
  i26   def   34796  38473
        use   34674  34689  38399
  i28   def   34797
        use   34682  34691
  i30   def   40466
        use   40385  40394
  j0    def   33434  34143  34213  34442  34624  35240  35289
              36489  37363  37471  37548  37610  37877  38282
              38356  38487  38532  38588  38828  38921  38960
              38971  39316  39325  39342  39361  39368  39375
              39848  40004  40022  40310  40363  40476  41021
              41230  41290  41473  41722  41970  42163  42229
              42346
        use   33578  33579  33579  33580  34156  34251  34281
              34303  34327  34433  34629  35251  36509  37368
              37494  37568  37734  37871  37874  38298  38420
              38484  38530  38850  38935  38965  38978  39319
              39319  39334  39334  39352  39352  39364  39371
              39378  39695  39885  39940  39971  39984  40003
              40043  40188  40203  40331  40355  40372  40465
              40467  40484  40967  41103  41276  41485  41746
              41978  42138  42153  42158  42224  42367  42424
  j1    def   33435  33716  33916  34057  34153  34217  34569
              35244  35345  35392  35434  35505  35648  36491
              36627  37435  37529  37681  37764  37882  38293
              38400  38542  38596  38835  38926  38977  39317
              39326  39343  39849  40005  40023  40311  40364
              40479  40705  40775  40874  41022  41231  41291
              41472  41744  42008  42170  42233  42347
        use   33577  33578  33712  33905  34063  34146  34150
              34251  34252  34281  34282  34303  34304  34327
              34328  34563  35238  35341  35389  35451  35500
              35503  35659  35663  36510  36622  37397  37525
              37670  37767  37876  38286  38408  38535  38611
              38841  38931  38970  39319  39334  39335  39352
              39353  39738  39745  39877  39882  39919  39938
              40048  40057  40099  40236  40328  40330  40334
              40353  40377  40400  40436  40487  40692  40737
              40745  40791  40796  40807  40809  40813  40826
              40831  40839  40856  40865  40868  40996  40997
              41000  41001  41075  41149  41197  41271  41485
              41487  41724  42006  42020  42165  42228  42393
  j2    def   33436  33759  33922  34226  34648  35234  35455
              36493  36636  37443  37485  37682  37771  37881
              38299  38394  38551  38603  38987  39327  39344
              39850  40006  40024  40365  40480  40578  40875
              41023  41232  41292  41484  41754  42027  42173
              42425
        use   33577  33750  33912  34216  34639  34644  35224
              35442  35449  36512  36516  36523  36525  36527
              36532  36628  37434  37493  37678  37776  37867
              38284  38390  38539  38541  38600  38969  39335
              39335  39353  39353  39735  39753  39915  39943
              39955  39967  40056  40091  40228  40439  40484
              40486  40546  40561  40810  40823  40844  41003
              41024  41025  41176  41213  41273  41283  41489
              41779  41784  42038  42349  42351  42361  42373
              42374  42381  42394
  j3    def   33437  33756  34170  34222  34660  35235  35293
              35343  35391  35462  37390  37492  37648  37792
              38240  38425  38988  39328  39345  39851  40007
              40025  40366  40876  41024  41233  41293  41472
              41743  42032  42177  42427
        use   33459  33552  33570  33753  34174  34219  34650
              34655  35233  35279  35332  35377  35379  35454
              37384  37466  37705  37809  38253  38369  38374
              38380  38386  38396  38977  39335  39336  39353
              39354  39686  39723  39762  39772  39796  39837
              39844  39918  40050  40133  40187  40447  40800
              40828  40849  40854  40998  41183  41191  41274
              41491  41731  42030  42162  42169  42344
  j4    def   34180  35294  35453  37479  37659  37811  38255
              38426  38631  39329  39346  39852  40026  40877
              41025  41234  41472  41772  42159  42422
        use   34151  35287  35428  37474  37651  37794  38245
              38439  39336  39336  39354  39354  39718  39747
              39749  40052  40793  40859  41002  41063  41080
              41226  41306  41472  41766  42157  42369  42371
  j5    def   33438  33766  34187  36495  37694  37824  38267
              38427  38623  39330  39347  39853  40009  40027
              40312  40367  40878  41035  41235  41294  41498
              42142  42423
        use   33468  33499  33531  33581  33705  33728  34160
              34166  36522  37687  37820  38272  38437  38620
              39336  39354  39740  39889  39953  40049  40070
              40124  40126  40196  40217  40230  40348  40447
              40449  40837  40915  41195  41199  41281  42146
              42357  42375
  j6    def   33439  37701  38421  38634  39854  40010  40028
              40879  41030  41499  42419
        use   33474  33508  33540  37680  38414  38630  38643
              39775  39891  39933  39935  40222  40842  40890
              40899  41380  41383  42402
  j7    def   33440  37707  38639  39855  40011  40029  40313
              40368  40880  41031  41458  42420
        use   33476  33506  33541  37642  37662  37727  38590
              39804  39904  40215  40348  40350  40458  40847
              40891  41346  41365  41371  41373  41431  41446
              41450  41454  42404
  j8    def   33441  37722  38232  39856  40012  40030  41032
              41494  41785  42421
        use   33543  37714  37733  39821  39896  39899  40117
              40898  41313  41758  42412
  j9    def   37711  39858  40013  40031  40369  40881  41033
              41459  42345
        use   37620  37623  39820  39884  39956  40205  40449
              40451  40788  40835  40853  40892  40897  40903
              41345  41347  42397  42399
  j10   def   33442  37716  39860  40014  40032  40882  41034
        use   33558  37630  37656  39758  39905  40139  40866
              40894  40950  40958  40986
  j11   def   33443  36498  37729  40033  40370  41041  41460
        use   33537  36530  37605  40152  40461  41044  41436
              41438
  j12   def   33444  40034  41042  41461
        use   33547  40154  40918  41044  41411  41439
  j13   def   33445  36499  40035  41043  41462
        use   33560  36524  40163  40919  40921  40930  41420
              41442
  j14   def   33446  36500  40036  41044  41463
        use   33462  36528  36531  40173  40917  41414  41430
              41445
  j15   def   33447  40037  41464
        use   33478  33487  33510  33549  40193  41427
  j16   def   33448  41465
        use   33568  33584  41364  41370
  j17   def   36501  40038  41466
        use   36520  41357
  j18   def   36502  40039  41467
        use   36533  40141  40149  40156  40165  40175  40180
              41353
  j19   def   40040  41495
        use   40116  40119  40131  40144  41381
  j20   def   36503  40041  41496
        use   36535  40132  40138  40145  40150  40181  41351
  j21   def   41385
        use   41379  41384
  j30   def   36504
        use   36538
  l0    def   35825
  l1    def   35825
  l2    def   35825
        use   35841  36644  37577
  l3    def   35825
  l4    def   35825
  l5    def   35825
  l6    def   35826
  l7    def   35826
  l8    def   35826
  l9    def   35826
        use   35842
  l10   def   35826
        use   35843
  l11   def   35826
  l12   def   35827
        use   35844
  l14   def   35828
        use   35845  36646
  l15   def   35828
        use   35846  36645  37578
  l16   def   35828
        use   35847  36647  37579
  l17   def   35828
        use   35848  36648
  l18   def   35828
        use   35849  36649
  l19   def   35828
        use   35850  36650
  l20   def   35829
        use   35851  36651
  l21   def   35829
        use   35852  36652
  l22   def   35829
        use   35853  36653
  l23   def   35829
        use   35854  36654
  l24   def   35829
        use   35855  36655
  l25   def   35829
        use   35856
  l26   def   35830
        use   35857
  l27   def   35830
        use   35858  36656
  l28   def   35830
  l29   def   35830
        use   35859
  l30   def   35830
  l31   def   35830
  l33   def   35831
  l34   def   35831
        use   35860  36657  37580
  l35   def   35831
        use   35861
  l36   def   35831
        use   35862
  l37   def   35831
        use   35863
  l38   def   35832
        use   35864
  l39   def   35832
        use   35865  36658  37581
  l40   def   35832
        use   35866
  l41   def   35832
        use   35867  36659
  l42   def   35832
        use   35868  36660  37582
  l43   def   35832
  l44   def   35833
        use   35869  36661
  l45   def   35833
        use   35870
  l46   def   35833
        use   35871  36662  37583
  l48   def   35833
  l51   def   35833
        use   35872  36663
  l52   def   35833
        use   35873  36664
  l53   def   35834
        use   35874  36665
  l54   def   35834
        use   35875  36666
  l55   def   35834
        use   35876  36667
  l56   def   35834
        use   35877  36668
  l57   def   35834
        use   35878  36669
  l58   def   35834
        use   35879  36670
  l59   def   35835
  l61   def   35835
        use   35880  36671  37584
  l64   def   35835
        use   35881  36672
  l70   def   35835
        use   35882
  l71   def   35835
        use   35883
  l73   def   35835
  l74   def   35836
        use   36673  37585
  l77   def   35836
        use   35884  36674  37586
  l78   def   35836
        use   35885  36675  37587
  l79   def   35836
        use   35886
  l80   def   35836
        use   35887
  l81   def   35836
  l82   def   35837
  l83   def   35837
  l84   def   35837
  m0    def   35184  41468  41529  41939
        use   35217  35219  35235  35335  35431  39736  40044
              41475  41538  41924  42078  42088  42100
  m1    def   41469  41914
        use   39818  41476  41477  41479  41480  41481  41482
              41483  41923
  m2    def   41470  41532  41947
        use   39548  39733  41478  41973  41985  41998  42015
  m3    def   41898
        use   41929
  m4    def   41926
        use   41906  41911
  n0    def   42129
        use   42044  42052  42060
  n1    def   35586  42190
        use   35348  35393  35463  41937  41972  41984  41997
              42005  42014  42029  42037  42081  42106  42152
              42243  42251
  n2    def   35605  42211
        use   35282  35336  35383  35432  41945  42049
  n3    def   42263
        use   41969  41981
  p0    def   37172  41511  41810
        use   37645  37788  37799  37801  37808  37814  41811
              42213  42215
  p1    def   37317  41512  41811
        use   37438  41812  41914  42217  42225
  p2    def   37318  41513  41812
        use   37429  41537  41813  42239
  p3    def   37319  41813
        use   37481  41902  41904  41904  41933  41940
  p4    def   37320  41815
        use   37519  37681
  p5    def   37321  41816
        use   37519  37520  37681  37682  41977  42019
  p6    def   37322  41692
        use   37559
  p7    def   37323  41693
        use   37718  37826
  p8    def   37324  41695
        use   37712  41761  41781
  p9    def   37326  41696
        use   37356  37358  37375  37377  37391  37393  37395
              41782
  p10   def   37330  41697
        use   37369  37503  37663  37667  37668  41709  41755
  p11   def   37336  41694
        use   37632  37640  37763  37769  37778  41767  41769
  p12   def   37337
        use   37641  37766
  p13   def   37338
        use   37411
  p14   def   37339
        use   37415
  p15   def   37340
        use   37417
  p16   def   37341
        use   37419
  p17   def   37342
        use   37421
  p20   def   37343
        use   37423
  q0    def   42044
        use   41949
  q1    def   42047
        use   41951
  q2    def   42049
        use   41953
  q3    def   42052
        use   41955
  q4    def   42060
        use   41957  42062
  q5    def   42069
        use   41959  41979  42007  42021  42031  42041
  q6    def   42102
        use   41961
  q7    def   42104
        use   41963
  q8    def   42110
        use   41964
  r1    def   41967
        use   41986  41999  42108
  r2    def   41981
        use   42050  42058  42067  42102  42110
  r3    def   34499  41988
        use   34429  34437  34441  42045  42047
  r4    def   34500  42001
        use   34541  34614  41946
  r5    def   34501  42023
        use   34576  42011
  r6    def   34502
        use   34581
  r7    def   34503
        use   34585
  r8    def   34504
        use   34657
  r9    def   34505
        use   34427
  r10   def   34506
        use   34618
  r11   def   34507
        use   34616
  r18   def   34508
        use   34730
  r19   def   34509
        use   34594  34598  34601  34606  34609
  r20   def   34510
        use   34721  34750
  r25   def   34511
        use   34784
  r27   def   34512
        use   34667
  r101  def   34513
        use   34646
  s0    def   41505  41826
        use   41528  42003
  s1    def   41509  41828
        use   41530  41970
  s2    def   41515  41834
        use   41521  41531  41982
  s3    def   41516  41840
        use   41529  41532  41536  41990  41994  41995  42026
              42028
  s4    def   41846
        use   42012
  s5    def   41849
        use   41920  41947  42154  42192  42194
  s6    def   41855
        use   41829  41835  42272  42273
  s7    def   41857
        use   41830  41836
  s8    def   41859
        use   41971  41983  41996  42004  42008  42013  42027
              42083  42089  42214  42216
  s9    def   41865
        use   41905  41942
  s10   def   41517  41866
        use   41522  42055  42065  42263
  s11   def   41518  41867
        use   41523  41991  42057  42066  42177  42235  42264
  s12   def   41520  41868
        use   41525  42175  42237  42269
  s13   def   41869
        use   42161  42167  42178  42238  42270
  s14   def   41870
        use   41988  42130  42135  42136  42140  42163  42248
  s15   def   41871
        use   41907  41932  41943
  s16   def   41872
        use   41903  41934  41939  41941  42074  42212
  s17   def   41873
        use   41968  41975  41976  42002  42017  42018
  s18   def   41874
        use   42242
  s19   def   41876
        use   42240
  s20   def   41879
        use   42025  42032  42034  42036  42148  42149  42150
              42241  42249
  s21   def   41884
        use   41913  41915  42035  42070  42073  42151  42220
              42226  42229  42231  42232  42250
  s22   def   42276
        use   42246  42247  42277  42278
  s23   def   42277
        use   42137  42143  42279
  s24   def   42278
        use   41842  41881  42142
  s25   def   41887
        use   41918  41935  42079  42104
  s26   def   41890
        use   41936  42080  42105
  s27   def   42279
        use   41880
  s28   def   41860
  s29   def   41892
        use   42024  42040  42076
  s30   def   41817
        use   41897  41914  41933
  s31   def   41824
        use   41865  41927
  s32   def   41893
        use   41896  41928
  s33   def   41894
        use   42039
  u1    def   34450
        use   34229
  u5    def   34451
        use   33653
  u6    def   34452
        use   33693  33701
  u9    def   34453
        use   34141
  u10   def   34454
        use   34154
  u15   def   34455
        use   34215  34218  34228  34233
  u16   def   34456
        use   34214
  u18   def   34457
        use   33746  33747  33748
  u19   def   34458
        use   33688  33704  33706  33709  33717  33720  33725
              33740  33754  33757  33810
  u20   def   34459
        use   33776  33778
  u21   def   34460
        use   33689
  u22   def   34461
  u23   def   34462
        use   33690
  u24   def   34463
        use   33638  33913
  u25   def   34464
        use   34087  34419  34430
  u26   def   34465
        use   33634
  u27   def   34466
  u28   def   34467
        use   33629  33649
  u29   def   34468
        use   34400  34422  34442
  u30   def   34469
        use   34213  34217  34220  34236  34254  34262  34358
              34361  34384  34387
  u31   def   34470
  u33   def   34471
        use   34353
  u35   def   34472
        use   34163  34165
  u37   def   34473
        use   34279  34284
  u38   def   34474
        use   34280  34288  34290
  u40   def   34475
        use   34092  34105
  u41   def   34476
        use   34089  34102  34402
  u42   def   34477
        use   33918  33941
  u43   def   34478
        use   34091  34104  34404
  u44   def   34479
        use   34084
  u45   def   34480
        use   33916
  u46   def   34481
        use   33917  33943  33956
  u53   def   34482
        use   33902  33910
  u55   def   34483
        use   33920  33942  33955
  u56   def   34484
        use   33718  33721
  u57   def   34485
        use   33694  33696  33702  34300  34309
  u58   def   34486
        use   33980  33982  33990  34301  34313  34315  34325
              34339
  u59   def   34487
        use   33681  33759
  u60   def   34488
        use   33680  33760  33970  33991  34008  34086  34109
              34250  34266  34352  34371
  u79   def   34489
        use   34366  34369
  u87   def   34493
        use   33573  33682  33686
  u90   def   34494
  u109  def   34495
        use   33660
  v2    def   38012
        use   36972
  v3    def   38013
        use   36977
  v12   def   38014
        use   37097  37674
  v16   def   38015
        use   37095  38540
  v19   def   38016
        use   37470  37515  37553  37609  37795  38544
  v20   def   38017
        use   37006  37024  37054  37079  37111  37133  37399
              37864  37885  38069  38076  38091  38536  38583
              38597
  v21   def   38018
        use   37355  37360  37374  37392  38145  38232
  v23   def   38019
        use   37357  37376  37394  38147  38233
  v24   def   38020
        use   37066  37625  37649  37759
  v25   def   38021
        use   37070  38165  38181  38258  38300
  v29   def   38022
        use   38081  38581
  v30   def   38023
        use   38570  38577
  v32   def   38024
  v35   def   38025
        use   37112  37145
  v37   def   38026
        use   38349  38366  38370  38376  38382  38387  38397
              38415  38417
  v38   def   38027
        use   38351  38418
  v44   def   38028
        use   38092  38624
  v46   def   38029
        use   38090  38579  38615
  v47   def   38030
        use   37053
  v49   def   38031
        use   37043  37049
  v50   def   38032
        use   37045
  v51   def   38033
        use   37056  37058  37406  37431  38094  38096  38108
              38156  38158  38162  38188
  v52   def   38034
        use   38154  38157  38186  38192
  v54   def   38035
        use   37688
  v56   def   38036
        use   38107
  v58   def   38037
        use   37044
  v59   def   38038
        use   38104
  v67   def   38039
        use   37046
  v70   def   38040
        use   38220  38222  38277
  v71   def   38041
        use   38240
  v72   def   38042
        use   38529
  v77   def   38043
        use   38208
  v78   def   38044
        use   37472  37475  37512  37535  37816  37821  37835
  v79   def   38045
        use   38241  38248
  v83   def   38046
        use   37615  37708  37731
  v85   def   38047
        use   38231
  v87   def   38048
        use   38302  38636
  v89   def   38049
        use   37611
  v101  def   38050
        use   37616  37627  37654  37690
  v102  def   38051
        use   37617  37666  37751  37818
  v103  def   38052
        use   37639  37657  37671  37702  37704  37785  37812
  v104  def   38053
        use   37626  37650  37652  37760
  v105  def   38054
        use   37646  37703
  v109  def   38058
        use   37471

slang ok
su2mon     =set 144 disc2 d.680103.2049 0 0 8.6 17.3916  ; user
           ;  1560 6 3 1170 1170
▶EOF◀