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 - download

⟦5bf6b9993⟧ TextFile

    Length: 124416 (0x1e600)
    Types: TextFile
    Names: »tmount«

Derivation

└─⟦00964e8f7⟧ Bits:30007478 RC8000 Dump tape fra HCØ.
    └─⟦b2ec5d50f⟧ 
        └─⟦0b92c64d5⟧ »ctb« 
            └─⟦this⟧ 

TextFile

(bmount = set 1 disc
bmount = slang proc.options  
scope user bmount
print bmount integer words.4 0.6
)

b.  w.
p.1


; kll 17.11.71                    boss 2, psjob, mount,   ...1...
s0=0, s1=0 

; Watchdog sends a message to the remoter process in the monitor
; and gets the answer when the remote buttom is pressed on a mt-
; station. Watchdog scans the stations treated by boss and if one
; is found in the state unidentified document mounted, an operation 
; is sent to the corresponding remoter corutine.
; The remoter reads and writes labels on tapes when they are moun-
; ted as demanded by the operator. If a psjob has ordered a tape
; the remoter will send an operation when it is mounted.
; The psjob, mount receives all messages from job concerning mount
; and release of tapes. The psjob is using an action-state algo-
; rithm to reserve and release stations, include or exclude jobs
; as users and correspond with the operator.
; The rewinder can rewind or unload tapes on demand from a psjob.
; In that way the psjob does not need to wait for the rewinding 
; itself.

s. f16,g50  b. b130 , s20 , t20 w.;
f14, f15      ;
 77 12 16, 133   ; version id:
m.          boss 2  tmount
b. a1  w.              ;

; g1  length psjob mount    g2  entry length station table
; g3  start tape table      g4  entry length tape table
; g5  length tape table     g6  length mount table
; g7  reserved state        g8  start station table
; g9  rel mount spec        g10 rel mount ring
; g11 rel mount tape        g12 rel suspend
; g13 rel release           g14 rel tape ready
; g15 start remoter         g16 rel entry remoter
; g17 length remoter        g18 start label page
; g19 start watchdog        g20 length watchdog
; g21 rel entry watchdog    g22 start rewinder
; g23 length rewinder       g24 rel entry rewinder
; g25 start device list     g26 start commandio, name, label
; g27 length name, label    g28 rel entry name
; g29 rel entry label

; s-names are used for relatives in station table
; t-names are used for relatives in tape table


f0:  b1.,  b3.,  b5.,  b6.,  b8.,  b10., b11., b14., b15., b16., b17.
     b18., b20., b21., b22., b23., b24., b25., b28., b29., b37.
     b30., b31., b32., b33., b34., b35., b36., b39., b40., b41., b42.
     b43., b44., b45., b46., b47., b48., b49., b50., b58., b59. 
     b60., b61., b62., b63., b64., b65., b66., b67., b70., b71., b72.
     b73., b74., b75., b77., b78., b79., b80., b81., b82., b84.
     b86., b87., b91., b92., b93., b96., b97., b101.,b102.,b103.,b113.,b114.
     b111.,b115.,b116.,b117.,b118.,b119.,b120.,b122.,b123.,b51., b52.
     b124.,b125.,b126.,b127.
     b53., b54., b55., b56., b7.
     f2.,  f3.,  f4.,  f5.,  f6.,  f7.,  f8.,  f9.,  f10., f12., f13., f16.
     0                 ;

     al. w3     f0.    ;    w3:= program base;
     rl. w2     a1.    ;
     jl.     x2+a1.    ;    goto init;

a1:  f1.               ;
e.                     ;
\f


; kll 27.7.71                    boss 2, psjob, mount,   ...2...

; Content:

; c1    10   first action
; c2    10   next action
; c3    10   end action
; c4    11   mount special
; c5    12   mount tape
; c6    11   mount ring
; c7    12   suspend
; c8    12   release
; c9    12   tape ready
; c10   13   mount work
; c11   12   search ready tapes
; c12   15   search station
; c13   17   include user
; c14   17   exclude user
; c15   16   remove reservation
; c16   18   reserve station (implies evt. stop job)
; c17   18   stop
; c18   18   proc banker
; c19   19   proc unload
; c20   19   unload
; c21   19   rewind
; c22   20   mount ring
; c23   20   remove ring
; c24   20   display(mount tape)
; c25   15   start job
; c26   15   answer
; c27   18   reserve tape entry
; c28   18   account mount
; c29   15   clear job number
; c30   22   release request line
; c31   19   alarm
; c32   21   proc search name
; c33   23   check work tape exists
; c34   23   check named tape exist
; c35   25   check ring
; c36   24   check station kind
; c38   20   display(mount on special)
; c39   19   release tape entry
; c40   17   not special station
; c41   17   not ordered special
; c42   17   reject mount ring
; c43   17   tape stealer
; c44   17   stations exceeded
; c45   17   suspendings exceeded
; c46   18   release station
; c47   17   tape used by other job
; c48   19   get station
; c49   22   init tape entry
; c50   25   check ring work
; c51   23   action(d4)
; c52   25   set spec device nr
; c53   23   check mount special after mount
; c54   17   mount special after mount
; c56   24   mount on special
; c57   16   change station
; c58   14   finis next
; c59   15   mount
; c60   25   alarm param
; c61   25   alarm param(index)
; c62   24   move bit
; c63   16   search min state
; c64   25   fp syntax
\f


; kll 27.7.71                    boss 2, psjob, mount,   ...3...

; mount table
; dummy entry in tape table

g8=2     ; start station table
;   station table format:
s0  =   0 , s1  =   1   ; device, tape ref
s2  =   2 , s3  =   3   ; label mode < 6 + state, tape kind
s4  =   4               ; project number
s6  =   6               ; descr addr for user
s8  =   8 , s9  =   9   ; rel sem, free and standard
s10 =  10               ; operation: chain
s12 =  12               ;
s14 =  14               ;            remoter buf
s16 =  16               ;

g2=18    ; entry length

; state     0: local              3: in use
;           1: named local        4: remoted
;           2: labelled local     5: unreadable

; tape kind 0: work no ring       1: work with ring
;           2: named work no ring 3: named work with ring
;           4: project no ring    5: project with ring
;           6: reserved no ring   7: reserved with ring

; free and standard  1<0: standard else special
;                    1<1: reserved to operator else free
g3=g2*e25+g8        ; end station and start tape table

; tape table format:
t0  =   0 , t1  =   1   ; state, station ref
t2  =   2               ; job nr
t4  =   4               ; request line addr
t6  =   6 , t7  =   7   ; abs device, psjob rel
t8  =   8               ; name
t16 =  16               ; name table addr

g4=18    ; entry length

; abs device:   spec device nr or 0 for standard stations

; request line addr: 0    == no request line
;                    even == request line being removed (may contain rel return etc.)
;                    odd  == virt request line addr

g5=g4*e27           ; length tape table
g6=g5+g3            ; end tape table and length of page


; The mounter treates 3 different claims:

;   stations   : simultaneously used standard stations
;   mounts     : number of tape mounts
;   suspends   : simultaneously suspended work tapes

; The page descriptions are used to

;   page 1     : mount table
;   page 3     : job description
;   page 4     : operation
\f


; kll 27.7.71                    boss 2, psjob, mount,   ...4...

g31:  b. c70, d10  w.  b. j160  h.


;     0: free

j0=k-g31, c28, c49, c30, c52, c26, c12,                                80;  mount special
j1=k-g31, c28, c49, c30, c52, c17, c12,                               130;  mount special wait
j2=k-g31, c28, c49, c30, c16, c25, c12,                                80;  mount named
j3=k-g31, c28, c49, c30, c17, c16, c12,                               130;  mount named wait
j4=k-g31, c28, c49, c30, c16, c25, c12,                                60;  mount work
j5=k-g31, c28, c49, c30, c17, c16, c12,                               120;  mount work wait
j6=k-g31; c26,                                                     0;  mount ring
j7=k-g31; c26,                                                     0;  suspend
j8=k-g31, c26,                                                     0;  release
j9=k-g31, c11,                                                     0;  tape ready


;    10: not wanted mounted named

j10=k-g31, c28, c52, c36, g38, c30, c12, c26,                    110;  mount special
j11=k-g31, c28, c52, c36, g40, c30, c12, c17, c13, c25,          150;  mount special wait
j12=k-g31, c28, c16, c36, g38, c30, c12, c25,               110;  mount named
j13=k-g31, c28, c16, c36, g40, c30, c12, c17, c13, c25,          150;  mount named wait
j14=k-g31; c31                                                      ;  mount work
j15=k-g31, c31                                                      ;  mount work wait
j16=k-g31; c26,                                                   10;  mount ring
j17=k-g31; c26,                                                   10;  suspend
j18=k-g31, c26,                                                   10;  release
j19=k-g31, c11,                                                   10;  tape ready


;    20: not wanted mounted work

j20=k-g31, c28, c52, c36, g38, c30, c12, c26,                    110;  mount special
j21=k-g31, c28, c52, c36, g40, c30, c12, c17, c13, c25,          150;  mount special wait
j22=k-g31, c28, c16, c36, g37, c30, c12, c25,               100;  mount named
j23=k-g31, c28, c16, c36, g39, c30, c12, c17, c13, c25,          140;  mount named wait
j24=k-g31, c28, c16, c36, g36, c30, c12, c25,                90;  mount work
j25=k-g31, c28, c16, c36, g39, c30, c12, c17, c13, c25,          140;  mount work wait
j26=k-g31; c26,                                                   20;  mount ring
j27=k-g31; c26,                                                   20;  suspend
j28=k-g31, c26,                                                   20;  release
j29=k-g31, c11,                                                   20;  tape ready


;    30: suspended not mounted work

j30=k-g31, c28, c52, c26, c12, c39,                               80;  mount special
j31=k-g31, c28, c52, c17, c12, c39,                              130;  mount special wait
j32=k-g31, c28, c16, c25, c12, c39,                          70;  mount named
j33=k-g31, c28, c17, c16, c12, c39,                              120;  mount named wait
j34=k-g31; c31                                                      ;  mount work
j35=k-g31, c31                                                      ;  mount work wait
j36=k-g31; c26,                                                   30;  mount ring
j37=k-g31, c26,                                                   30;  suspend
j38=k-g31, c26, c29, c39,                                          0;  release
j39=k-g31, c11,                                                   40;  tape ready
\f


; kll 27.7.71                    boss 2, psjob, mount,   ...5...


;    40: suspended mounted work

j40=k-g31, c28, c52, c30, c39, c36, g38, c12, c26,               110;  mount special
j41=k-g31, c28, c52, c30, c39, c36, g40, c12, c17, c13, c25,     150;  mount special wait
j42=k-g31, c28, c16, c30, c39, c36, g37, c12, c25,          100;  mount named
j43=k-g31, c28, c16, c30, c39, c36, g39, c12, c17, c13, c25,     140;  mount named wait
j44=k-g31; c31                                                      ;  mount work
j45=k-g31, c31                                                      ;  mount work wait
j46=k-g31; c26,                                                   40;  mount ring
j47=k-g31, c26,                                                   40;  suspend
j48=k-g31, c26, c29, c39,                                         20;  release
j49=k-g31, c11,                                                   40;  tape ready


;    50: suspended mounted named

j50=k-g31, c28, c52, c30, c36, g38, c12, c26,                    110;  mount special
j51=k-g31, c28, c52, c30, c36, g40, c12, c17, c13, c25,          150;  mount special wait
j52=k-g31, c28, c16, c30, c36, g38, c12, c25,               110;  mount named
j53=k-g31, c28, c16, c30, c36, g40, c12, c17, c13, c25,          150;  mount named wait
j54=k-g31; c31                                                      ;  mount work
j55=k-g31, c31                                                      ;  mount work wait
j56=k-g31; c26,                                                   50;  mount ring
j57=k-g31, c26,                                                   50;  suspend
j58=k-g31, c26, c29,                                              10;  release
j59=k-g31, c11,                                                   50;  tape ready


;    60: ordered not mounted work name zero allowed

j60=k-g31, c53, c26,                                              80;  mount special
j61=k-g31, c53, c17,                                             130;  mount special wait
j62=k-g31, c26,                                                   60;  mount named
j63=k-g31, c17,                                                  120;  mount named wait
j64=k-g31, c31                                                      ;  mount work
j65=k-g31, c17,                                                  120;  mount work wait
j66=k-g31, c26,                                                   60;  mount ring
j67=k-g31, c26, c15, c46, c30, c27,                               30;  suspend
j68=k-g31, c26, c15, c46, c30, c29,                                0;  release
j69=k-g31, c36, g41, c62, c11,                                    90;  tape ready


;    70: ordered not mounted work name zero not allowed

j70=k-g31, c53, c26,                                              80;  mount special
j71=k-g31, c53, c17,                                             130;  mount special wait
j72=k-g31, c26,                                                   70;  mount named
j73=k-g31, c17,                                                  120;  mount named wait
j74=k-g31; c31                                                      ;  mount work
j75=k-g31, c31                                                      ;  mount work wait
j76=k-g31, c26,                                                   70;  mount ring
j77=k-g31, c26, c15, c46, c30, c27,                               30;  suspend
j78=k-g31, c26, c15, c46, c30, c29,                                0;  release
j79=k-g31, c36, g42, c62, c11,                                   100;  tape ready

\f


; kll 27.7.71                    boss 2, psjob, mount,   ...6...


;    80: ordered not mounted named

j80=k-g31, c53, c26,                                              80;  mount special
j81=k-g31, c53, c17,                                             130;  mount special wait
j82=k-g31, c26,                                                   80;  mount named
j83=k-g31, c17,                                                  130;  mount named wait
j84=k-g31; c31                                                      ;  mount work
j85=k-g31, c31                                                      ;  mount work wait
j86=k-g31, c26,                                                   80;  mount ring
j87=k-g31; c26, c15, c46, c30, c29,                                0;  suspend
j88=k-g31, c26, c15, c46, c30, c29,                                0;  release
j89=k-g31, c36, g43, c62, c11,                                   110;  tape ready


;    90: ordered mounted work name zero allowed

j90=k-g31, c53, c26,                                             110;  mount special
j91=k-g31, c53, c17, c13, c25,                                   150;  mount special wait
j92=k-g31, c26,                                                   90;  mount named
j93=k-g31, c36, g44, c17, c13, c25,                              140;  mount named wait
j94=k-g31, c31                                                      ;  mount work
j95=k-g31, c36, g44, c17, c13, c25,                              140;  mount work wait
j96=k-g31, c26,                                                   90;  mount ring
j97=k-g31; c26, c15, c46, c29,                                    20;  suspend
j98=k-g31, c26, c15, c46, c29,                                    20;  release
j99=k-g31, c11,                                                   90;  tape ready


;   100: ordered mounted work name zero not allowed

j100=k-g31, c53, c26,                                            110;  mount special
j101=k-g31, c53, c17, c13, c25,                                  150;  mount special wait
j102=k-g31, c26,                                                 100;  mount named
j103=k-g31, c36, g44, c17, c13, c25,                             140;  mount named wait
j104=k-g31; c31                                                     ;  mount work
j105=k-g31, c31                                                     ;  mount work wait
j106=k-g31, c26,                                                 100;  mount ring
j107=k-g31, c27, c26, c15, c46,                                   40;  suspend
j108=k-g31, c26, c15, c46, c29,                                   20;  release
j109=k-g31, c11,                                                 100;  tape ready


;   110: ordered mounted named

j110=k-g31, c53, c26,                                            110;  mount special
j111=k-g31, c53, c17, c13, c25,                                  150;  mount special wait
j112=k-g31, c26,                                                 110;  mount named
j113=k-g31, c36, g45, c17, c13, c25,                             150;  mount named wait
j114=k-g31; c31                                                     ;  mount work
j115=k-g31, c31                                                     ;  mount work wait
j116=k-g31, c26,                                                 110;  mount ring
j117=k-g31, c26, c15, c46,                                        50;  suspend
j118=k-g31, c26, c15, c46, c29,                                   10;  release
j119=k-g31, c11,                                                 110;  tape ready

\f


; kll 17.11.71                    boss 2, psjob, mount,   ...7...


;   120: waited not mounted work

j120=k-g31; c64                                                     ;  mount special
j121=k-g31; c64                                                     ;  mount special wait
j122=k-g31; c64                                                     ;  mount named
j123=k-g31; c64                                                     ;  mount named wait
j124=k-g31; c64                                                     ;  mount work
j125=k-g31; c64                                                     ;  mount work wait
j126=k-g31; c64                                                     ;  mount ring
j127=k-g31; c64                                                     ;  suspend
j128=k-g31, c64, c17,                                            120;  release
j129=k-g31, c36, g46, c13, c25, c62, c11,                        140;  tape ready


;   130: waited not mounted named

j130=k-g31; c64                                                     ;  mount special
j131=k-g31; c64                                                     ;  mount special wait
j132=k-g31; c64                                                     ;  mount named
j133=k-g31; c64                                                     ;  mount named wait
j134=k-g31; c64                                                     ;  mount work
j135=k-g31; c64                                                     ;  mount work wait
j136=k-g31; c64                                                     ;  mount ring
j137=k-g31; c64                                                     ;  suspend
j138=k-g31, c64, c17,                                            130;  release
j139=k-g31, c36, g47, c13, c25, c62, c11,                        150;  tape ready


;   140: waited mounted work

j140=k-g31, c53, c33, c14, c26, c30, c59,                         80;  mount special
j141=k-g31, c53, c33, c14, c17, c30, c59,                        130;  mount special wait
j142=k-g31, c33, c14, c26, c30, c59,                              70;  mount named
j143=k-g31, c33, c14, c17, c30, c59,                             120;  mount named wait
j144=k-g31; c31                                                     ;  mount work
j145=k-g31, c31                                                     ;  mount work wait
j146=k-g31, c50, c14, c17, c20, c30, c22,                        120;  mount ring
j147=k-g31, c14, c27, c26, c15, c46, c30, c21,                    40;  suspend
j148=k-g31, c14, c26, c15, c46, c21, c30, c29,                    20;  release
j149=k-g31, c11,                                                 140;  tape ready


;   150: waited mounted named

j150=k-g31, c53, c34, c14, c26, c30, c59,                         80;  mount special
j151=k-g31, c53, c34, c14, c17, c30, c59,                        130;  mount special wait
j152=k-g31, c34, c14, c26, c30, c59,                              80;  mount named
j153=k-g31, c34, c14, c17, c30, c59,                             130;  mount named wait
j154=k-g31; c31                                                     ;  mount work
j155=k-g31, c31                                                     ;  mount work wait
j156=k-g31, c35, c14, c17, c20, c30, c22,                        130;  mount ring
j157=k-g31, c14, c26, c15, c46, c30, c21,                         50;  suspend
j158=k-g31, c14, c26, c15, c46, c21, c30, c29,                    10;  release
j159=k-g31, c11,                                                 150;  tape ready
\f



; kll 20.3.72                    boss 2, psjob, mount,   ...8...

b19=k-g31              ; action matrix:

; mount mount mount mount mount mount mount sus-  rel-  tape
; spec  spec  named named work  work  ring  pend  ease  ready
;       wait        wait        wait
;                                                                state:
  j0  , j1  , j2  , j3  , j4  , j5  , j6  , j7  , j8  , j9    ;   0
  j10 , j11 , j12 , j13 , j14 , j15 , j16 , j17 , j18 , j19   ;  10
  j20 , j21 , j22 , j23 , j24 , j25 , j26 , j27 , j28 , j29   ;  20
  j30 , j31 , j32 , j33 , j34 , j35 , j36 , j37 , j38 , j39   ;  30
  j40 , j41 , j42 , j43 , j44 , j45 , j46 , j47 , j48 , j49   ;  40
  j50 , j51 , j52 , j53 , j54 , j55 , j56 , j57 , j58 , j59   ;  50
  j60 , j61 , j62 , j63 , j64 , j65 , j66 , j67 , j68 , j69   ;  60
  j70 , j71 , j72 , j73 , j74 , j75 , j76 , j77 , j78 , j79   ;  70
  j80 , j81 , j82 , j83 , j84 , j85 , j86 , j87 , j88 , j89   ;  80
  j90 , j91 , j92 , j93 , j94 , j95 , j96 , j97 , j98 , j99   ;  90
  j100, j101, j102, j103, j104, j105, j106, j107, j108, j109  ; 100
  j110, j111, j112, j113, j114, j115, j116, j117, j118, j119  ; 110
  j120, j121, j122, j123, j124, j125, j126, j127, j128, j129  ; 120
  j130, j131, j132, j133, j134, j135, j136, j137, j138, j139  ; 130
  j140, j141, j142, j143, j144, j145, j146, j147, j148, j149  ; 140
  j150, j151, j152, j153, j154, j155, j156, j157, j158, j159  ; 150

g7=k-b19-g31  w.       ;    reserved state
e.                     ; end j-names

b. j25  h.             ;     finis actions:

j0 =k-g31, c29, c58,                 0; state 0 , 30
j1 =k-g31, c29, c58,                10; state 10, 50
j2 =k-g31, c29, c58,                20; state 20, 40
j6 =k-g31, c15, c46, c30, c29, c58,  0; state 60, 70, 80, 120,130
j9 =k-g31, c15, c46, c29, c58,      20; state 90,100
j11=k-g31, c15, c46, c29, c58,      10; state 110
j14=k-g31, c15, c46, c21, c29, c58, 20; state 140
j15=k-g31, c15, c46, c21, c29, c58, 10; state 150
g33=k-g31, j0,j1,j2,j0,j2,j1,j6,j6,j6,j9,j9,j11,j6,j6,j14,j15

g34=k-g31,      c20, c23,          130; remove ring actions
g35=k-g31,                    150, 140; check ring

g36=k-g31,      c20, c30, c12, c11, c25, 60; move tape from spec
g37=k-g31,      c20, c30, c12,      c25, 70;    to standard or opposite:
g38=k-g31,      c20, c30, c12,      c25, 80;
g39=k-g31, c17, c20, c30, c12,     120;
g40=k-g31, c17, c20, c30, c12,     130;
g41=k-g31,      c20, c30, c59, c11, 60;
g42=k-g31,      c20, c30, c59, c11, 70;
g43=k-g31,      c20, c30, c59, c11, 80;
g44=k-g31, c17, c20, c30, c59,     120;
g45=k-g31, c17, c20, c30, c59,     130;
g46=k-g31,      c20, c30, c59, c11,120;
g47=k-g31,      c20, c30, c59, c11,130;
w.e.

g32=k-g31              ;     length of page
w.
\f


; kll 27.7.71                    boss 2, psjob, mount,   ...9...


; job descr page:

     d1=0              ; index
     d2=2              ; action
     d3=4              ; old state
     d4=6, d5=8, d6=10 ; work
     d8=12             ; tape name used by alarms
     d9=20             ; spec device used by alarms
     d0=22             ; message address
     d7=24             ; work

;    324  psjob nr         336  rest mounts
;    325  dump area spec   337  rest suspends
;    326  project nr       338  job file descr
;    327  job nr           339  finis cause
;    328  job name         340  special mask
;    329    + 2            341  sender table addr
;    330    + 6            342  process descr addr job
;    331  psjob sem rel
;    332  psjob operation
;    333    + 2
;    334    + 4: psjob buf
;    335    + 6


b0:       0, r.5       ;    page addresses
     50<12 + 0         ;    page ident:  psmount
b1:       1            ;    send and wait
b3:       3            ;    lock
b4:       10           ;    constant   
b5:       5            ;    lock chained
b6:       6            ;    open chained
b7:       21           ;    private output
b8:       8            ;    page jump
b9:       <:   :>      ;    spaces
b10:      427          ;    rel finis(finis cause)
b11:      26           ;    current descr
b12:      0            ;    work
b13:      0            ;    work
b26:      0            ;    work
b68:      0            ;    work
b27:      2            ;    constant
b14:      320          ;    psjob io point: virt
b15:      321          ;                    rel
b16:      426          ;    break point:    virt
b17:      361          ;                    rel
b54:      473          ;    banker kill point:  virt
b55:      364          ;                        rel
b62:      417          ;    finis point:    virt
b63:      478          ;                    rel
b18:      52           ;    request free
b20:      51           ;    request que
b57:      0            ;    rewinder que
b38:      0            ;    rewinder operation
\f


; kll 27.7.71                    boss 2, psjob, mount,   ...10...


b. a9  w.              ;
c1:  dl. w3     b0.+6  ; first action: w1=operation code (0-9)
     rl  w2  x2+4      ;    save message addr;
     rs  w2  x3+d0     ;
     rl. w2     b0.+6  ;
     rl. w3     b0.+2  ;
     wa  w3  x2+d1     ;
     bz  w0  x3+t0     ;
jd -1                  ; w0=state(tape), w1=operation code
     rs  w0  x2+d3     ;    save old state;
     ba  w1  x3+t0     ;    w1:= w1 + state(index);
     al  w0     g7     ;
     se. w3    (b0.+2) ;    if index <> dummy then
     hs  w0  x3+t0     ;    state(index):= reserved;
     wa. w1     b0.+8  ;
     bz  w0  x1+b19    ;
     rs  w0  x2+d2     ;    action:= action matrix(w1);
rl.w2 b0.+2, al  w2  x2+g8
a0:al w1 x2, sl w1 x3+g3, am (:g4-g2:)<6+1,alw0 g2<6+18,jl.w3(b7.)
sl w2 x3+g3, am g4-g2,al w2 x2+g2,am. (b0.+2),sh w2 g6-g2
jl. a0.
c2:  rl. w3     b0.+2  ; next action:
     rl. w2     b0.+6  ;
     rl  w1  x2+d2     ;    w1:= action;
     al  w1  x1+1      ;    action:= action+1;
     rs  w1  x2+d2     ;   
     wa. w1     b0.+8  ;
     bz  w1  x1-1      ;    w1:= action table(w1);
rlw0x2+d1,jd-1         ; w0=index, w1=action
     sl  w1     g7     ;    if w1 >= first action then
     jl.     x1+b0.    ;    goto w1;
     wa  w3  x2+d1     ;
     hs  w1  x3+t0     ;    state(index):= w1;

c3:  rl. w2     b0.+6  ; end action:
     rl. w1    (b11.)  ;    w1:= current description;
     ld  w0    -100    ;   
     ds  w0  x1+14     ;    page 2:= page 3:= page 4:= 0;
     rs  w0  x1+10     ;
a1:  rl  w0  x2+338    ;
     rs  w0  x1+8      ;    page 1:= job file descr;
     dl. w3     b15.   ;
     jl.       (b8.)   ;    page jump(io);

b21=a1+1, e.           ;
\f


; kll 17.11.71                    boss 2, psjob, mount,   ...11...

b. a9, j4  w.          ;
c4:  jl. w3     c60.   ; mount special:   alarm param;
     al  w1  x3-g2     ;    w1:= station:= station base;
a1:  al  w1  x1+g2     ; rep:   station:= station + length;
     sl  w1  x3+g3-g8  ;    if station > last then
     jl.        c40.   ;    goto not special station;
     bz  w0  x1+g8     ;    if device(station)<>
     se  w0 (x2+14)    ;    device(message) then
     jl.        a1.    ;    goto rep;
     bz  w0  x1+g8+s9  ;
     sz  w0     1      ;    if station not special then
     jl.        c40.   ;    goto not special station;
     al  w0     0      ;
     ws. w1     b0.+2  ;
     wd. w1     a3.    ;
     ac  w1  x1-e17    ;    shift:= number of devices - station nr rel;
     rs. w1     b12.   ;
     am.       (b0.+6) ;
j1:  dl  w1    +340    ;    w0.w1:= device word<shift;
     ld. w1    (b12.)  ;  
     sl  w0     0      ;    if bit 0 in w0 = 0 then
     jl.        c41.   ;    goto not ordered special;
     jl. w1     c32.   ;    search name;
     al  w1     0      ;    w1:= 0;

a2:  am.       (b0.+4) ; add wait:
     rl  w2    +4      ;    w2:= message addr;
     rl  w0  x2+8      ;
     sz  w0     1      ;    if wait then
     al  w1  x1+1      ;    w1:= w1 + 1;
     jl.        c1.    ;    goto first action;

c6:  jl. w3     c60.   ; mount ring message:   alarm param;
     jl. w1     c32.   ;    search name;
     wa  w3  x2+d1     ;    w3:= tape(index);
     bl  w0  x3+t1     ;
     al  w1     6      ;    w1:= 6;
     sn  w0     0      ;    if station ref = empty then
     jl.        c1.    ;    goto first action;
     ba  w3  x3+t1     ;    w3:= station(w3);
     bz  w0  x3+s3     ;   
j2:  rl  w2  x2+326    ;    w2:= project nr;
     se  w2 (x3+s4)    ;    if project(w3) = project
     sh  w0     3      ;    or work tape then
     jl.        c1.    ;    goto first action;
     jl.        c42.   ;    goto reject mount ring;

a3:  g2                ;
g9=c4-b0, g10=c6-b0    ;    rel entries
\f


; kll 17.11.71                    boss 2, psjob, mount,   ...12...

c5:  jl. w3     c60.   ; mount tape:   alarm param;
     rl  w0  x2+16     ;   
     sn  w0     0      ;    if name = 0 then
     jl.        c10.   ;    goto mount work;
     jl. w1     c32.   ;    search name;
     al  w1     2      ;    w1:= 2;
     jl.        a2.    ;    goto add wait;

c7:  jl. w3     c60.   ; suspend:   alarm param;
     jl. w1     c32.   ;    search name;
     al  w1     7      ;    w1:= 7;
     jl.        c1.    ;    goto first action;

c8:  jl. w3     c60.   ; release:   alarm param;
     jl. w1     c32.   ;    search name;
     al  w1     8      ;    w1:= 8;
     jl.        c1.    ;    goto first action;

c11=k-b0    ; search ready tapes:
     rl  w1  x2+d2     ;
     am.       (b0.+8) ;
     bz  w0  x1        ;    comment set tape in new state;
     wa  w3  x2+d1     ;
     hs  w0  x3+t0     ;    state(index):= state(action);

a7:  rl. w2     b0.+6  ; scan stations:
     rl. w3     b0.+2  ;
     al  w1  x3+g8-g2  ;    w1:= station:= station base;
a6:  al  w1  x1+g2     ; rep:   station:= station + 1;
     sl  w1  x3+g3     ;    if station > last then
     jl.        c3.    ;    goto end action;
     bz  w0  x1+s2     ;
     se  w0     4      ;    if station not remoted then
     jl.        a6.    ;    goto rep;
     ba  w1  x1+s1     ;
     rl  w0  x1+t2     ;    if job nr(tape(station)) <>
     ba  w1  x1+t1     ;    job nr(job descr) then
j3:  se  w0 (x2+327)   ;    goto rep;
     jl.        a6.    ;
     al  w0     3      ;
     hs  w0  x1+s2     ;    station state:= in use;
     ba  w1  x1+s1     ;    w1:= tape(station);
     ws. w1     b0.+2  ;
     rs  w1  x2+d1     ;    index:= tape(station);
     jl. w3     c61.   ;    alarm param(index);
     al  w1     9      ;    w1:= 9;
     jl.        c1.    ;    goto first action;

c9:  rl. w1     b0.+4  ; tape ready:
     rl  w2  x1+4      ;
     jl. w3    (b6.)   ;    open chained(remoter buf, op);
     jl.        a7.    ;    goto scan stations;

b22=j1+1, b23=j2+1, b24=j3+1   
e.                     ;
g11=c5-b0, g12=c7-b0, g13=c8-b0, g14=c9-b0    ; rel entries
\f


; kll 17.11.71                    boss 2, psjob, mount,   ...13...

b. a9, j4  w.          ;
c10:                   ; mount work
     al  w3  x3+g6     ;
     rs. w3     b12.   ;    limit:= top tape table entry;
     al  w3  x3-g5-g4  ;    w3:= abs index:= start tape table;
     rl  w0  x2+8      ;
     rl. w2     b0.+6  ;    w2:= job descr;
     al  w1     0      ;
     rs  w1  x2+d1     ;    index:= dummy;
     sz  w0     1      ;    if wait then
     jl.        a2.    ;    goto search work wait;

     al  w1     4      ;    w1:= 4;
a1:  al  w3  x3+g4     ; search work rep:
     sl. w3    (b12.)  ;    w3:= abs index:= abs index + length;
     jl.        c1.    ;    if abs index >= limit then goto first action;
     bz  w0  x3+t0     ;    w0:= state(abs index);
     se  w0     20     ;    if state <> 20 then
     jl.        a1.    ;    goto search work rep;
     jl.        a7.    ;    goto found;

a2:  al  w1    -1      ; search work wait:   w1:= max:= -1;
a3:  al  w3  x3+g4     ; rep:   w3:= abs index:= abs index + length;
     sl. w3    (b12.)  ;    if abs index > limit then
     jl.        a5.    ;    goto work wait found;
     bz  w0  x3+t0     ;    w0:= state(abs index);
     sh  w0  x1        ;    if state < max then
     jl.        a3.    ;    goto rep;
     sn  w0     20     ;    if state = 20 then
     jl.        a4.    ;    goto ok;
     se  w0     60     ;
     sn  w0     90     ;    if state = 60 or state = 90
     jl.        4      ;    and
     jl.        a3.    ;    jobnr(abs index) = jobnr(job descr)
j1:  rl  w0  x2+327    ;    then goto ok else goto rep;
     se  w0 (x3+t2)    ;
     jl.        a3.    ;
a4:  bz  w1  x3+t0     ; ok:   max:= state(abs index);
     rs  w3  x2+d4     ;    save abs index;
     jl.        a3.    ;    goto rep;
a5:  rl  w3  x2+d4     ; work wait found:
     al  w0     5      ;    abs index:= saved abs index;
     rx  w0     2      ;    w1:= 5;
     sn  w0    -1      ;    if max = -1 then
     jl.        c1.    ;    goto first action;
a7:                    ; found:
j2:  rl  w0  x2+327    ;
     rs  w0  x3+t2     ;    job nr(index):= job nr(descr);
j3:  rl  w0  x2+331    ;
     rs  w0  x3+t6     ;    psjobrel(index):= psjobnr(descr);
     ws. w3     b0.+2  ;
     rs  w3  x2+d1     ;    index:= abs index - mount table;
     jl.        c1.    ;    goto first action(w1);

b25=j1+1, b66=j2+1, b67=j3+1
e.                     ;

\f



; kll 17.3.72                    boss 2, psjob, mount,   ...14...


b. a9  ,j9 w.              ;
g30=k-b0               ; finis mount:
     rl. w2     b0.+6  ;
     al  w3  x3+g3     ;    tape:= first tape;

a0:  bz  w1  x3+t0     ; rep:
     rl  w0  x3+t2     ;
     se  w1     g7     ;    if state(tape) = reserved or
j9:  se  w0 (x2+327)   ;    jobnr(tape) <> job nr on descr then
     jl.        a1.    ;    goto next;

     al  w0     g7     ;    action:= action table(state(index));
     hs  w0  x3+t0     ;    
     al  w0     0      ;
     wd. w1     b4.    ;
     am.       (b0.+8) ;
     bz  w0  x1+g33    ;    state(tape):= reserved;
     ws. w3     b0.+2  ;
     ds  w0  x2+d2     ;    index:= relative tape;
     jl.        c2.    ;    goto next action;

c58=k-b0               ; finis next:
     wa  w3  x2+d1     ;    tape:= abs tape index;
     rl  w1  x2+d2     ;
     wa. w1     b0.+8  ;
     bz  w1  x1        ;    state(tape):= state(action);
     hs  w1  x3+t0     ;
jd-1

a1:  al  w3  x3+g4     ; next:
     am.       (b0.+2) ;    tape:= tape + 1;
     se  w3    +g6     ;    if tape <> top then
     jl.        a0.    ;    goto rep;

     rl. w2    (b11.)  ;
     al  w0     0      ;    page 3:= 0;
     rx  w0  x2+12     ;    page 1:= descr;
     rs  w0  x2+14     ;    page 4:= descr;
     rs  w0  x2+8      ;
     dl. w3     b63.   ;
     jl.       (b8.)   ;    page jump(finis);

b64=j9+1
e.                     ;


\f


; kll 27.7.71                    boss 2, psjob, mount,   ...15...

b. a9, j5  w.          ;
c12=k-b0    ; search station:
     al  w0     1      ;
     jl. w1     c57.   ;    change station(free standard);
     rl. w2     b0.+6  ;
     bz  w0  x1+s1     ;
     se  w0     0      ;    if tape(station) <> 0 then
     jl.        a6.    ;    goto test unload;
a5:                    ; after unload:
     rl. w3     b0.+2  ;
c59=k-b0               ; mount:
     wa  w3  x2+d1     ;
     bz  w0  x3+t1     ;
     se  w0     0      ;    if station(index) <> 0 then
     jl.        c2.    ;    goto next action else
     bz  w1  x3+t6     ;    if
     se  w1     0      ;    special station then
     jl.        c56.   ;    goto mount on special else
     jl.        c24.   ;    goto display(mount tape);

a6:  ba  w1  x1+s1     ; test unload:
     rl  w3  x1+t4     ;    w1:= tape(station);
     bz  w0  x1+t0     ;
     sn  w3     0      ;    if request(w1) <> 0 or
     sn  w0     g7     ;    state(w1) = reserved then
     jl.        a5.    ;    goto after unload;
     ws. w1     b0.+2  ;

     rx  w1  x2+d1     ;    save index;
     rs  w1  x2+d7     ;    index:= w1;
     jl. w1     c19.   ;    unload(index);
     rl. w2     b0.+6  ;    w2:= job descr;
     rl  w0  x2+d7     ;
     rs  w0  x2+d1     ;    index:= saved index;
     jl.        a5.    ;    goto after unload;

c25=k-b0    ; start job:
     rl. w1    (b11.)  ;
     rl  w1  x1+12     ;    w1:= page 3;
j2:  al  w1  x1+325    ;    w1:= dump area spec;
     al  w0     16     ;
     jl. w3     c18.   ;    banker(start job, w1);
     rl. w2     b0.+6  ;    w2:= job descr;

c26=k-b0    ; answer:
     wa  w3  x2+d1     ;
     al  w1  x3+t8     ;    w1:= name(index);
j3:  rl  w3  x2+341    ;    w3:= sender table addr;
     al  w2     0      ;    w2:= message(sender table);
     rx  w2  x3+8      ;    message(sender table):= 0;
     al  w0     1      ;    result:= 1;
     sl  w2     2      ;    if answer pending then
     jd         1<11+22;    send answer;
     jl.        c2.    ;    goto next action;

c29=k-b0    ; clear job nr:
     wa  w3  x2+d1     ;
     al  w0     0      ;    job nr(index):= 0;
     rs  w0  x3+t2     ;
     rs  w0  x3+t6+t7-t7;    spec device:= psjob rel:= 0;
     jl.        c2.    ;    goto next action;

b28=j2+1, b29=j3+1
e.                     ;
\f



; kll 13.3.72                    boss 2, psjob, mount,   ...16...


b. a9, j9  w.          ;
c15=k-b0    ; remove reservation:
     al. w1     c2.    ;    return:= next action;
     al  w0     3      ;    change station(reserved standard);

c57:        ; change station:
; entry: w0 = searched state, w1 = link, w2 = descr, w3 = mount table.
; exit:  w1 = station.
     ds. w1     b13.   ;
     al  w1  x3+g8+e26*g2;  w1:= first special station;
     wa  w3  x2+d1     ;    w3:= tape(index);
     bz  w2  x3+t6     ;
     sn  w2     0      ;    if abs device(w3) = o then
     jl.        a2.    ;    goto standard;
a1:  bz  w0  x1+s0     ;
     sn  w0  x2        ;    for w1:= all special stations do
     jl.        a5.    ;    if device(w1) = abs device then
     al  w1  x1+g2     ;    goto found;
     jl.        a1.    ;
a2:  al  w1  x3        ; standard:
     ba  w1  x1+t1     ;    w1:= station(w3);
     bz  w2  x1+s9     ;
     se  w1  x3        ;    if station ref(w3) empty or
     se  w0  x2        ;      state(w1) <> searched state then
     jl. w1     c63.   ;      w1 := search min state(searched state);
a5:  bz  w2  x1+s9     ; found:
     lx. w2     b27.   ;    exchange reserved bit(w1);
     hs  w2  x1+s9     ;
     jl.       (b13.)  ;    goto return;

c63: rs. w1     b68.   ; search min state(searched state):
     rl. w3     b0.+2  ;
     al  w1  x3+g8     ;    w1:= station:= station table;
     al  w0     g7+1   ;    w0:= min state:= max state + 1;
a3:  bz  w2  x1+s9     ; rep:
     se. w2    (b12.)  ;    if state(w1) <> search state then
     jl.        a4.    ;    goto next;
     al  w2  x1        ;
     ba  w2  x2+s1     ;    if tape ref(w1) = 0 then
     sn  w2  x1        ;    goto return;
     jl.       (b68.)  ;
     bz  w2  x2+t0     ;    if tape state(station) < min state
     sh  w0  x2        ;    then
     jl.        a4.    ;    begin save station;
     rs. w1     b26.   ;      min state:= tape state(station);
     al  w0  x2        ;    end;
a4:  al  w1  x1+g2     ; next:   station:= station + 1;
     sh  w1  x3+g3-2   ;    if station <= last then
     jl.        a3.    ;    goto rep;
     rl. w1     b26.   ;
;***** test begin
     sn  w0     g7+1   ;    if no station is in the searched state then
c.-1, o112, z.         ;      (bossfault xref)
     jd        -112    ;      bossfault xref;
;***** test end
     jl.       (b68.)  ;    goto return;
e.                     ;


\f


; kll 17.11.71                    boss 2, psjob, mount,   ...17...

b. a5, j2  w.          ;
c13=k-b0    ; include user:
     am        (66)    ;    nb: w3=ref dummy entry in mount table
     dl  w1    +74     ;
     jd         1<11+72;    set catbase(boss maxbase);
     jl. w1     c48.   ;    get station;
     rl  w1  x3+s4     ;
     bz  w0  x3+s3     ;
j2:  se  w1 (x2+326)   ;    if project(tape) = job project or
     sh  w0     4      ;    work tape or project no ring then
     jl.        a2.    ;    goto ok;
     sl  w0     6      ;    if reserved then
     jl.        c43.   ;    goto tape stealer;
     al  w0     g34    ;    action:= remove ring actions;
     rs  w0  x2+d2     ;
     jl.        c2.    ;    goto next action;

a2:  rl  w0  x2+342    ; ok:
     rs  w0  x3+s6     ;    user(station):= descr addr for user;
     ba  w3  x3+s1     ;    w3:= tape(index);
     al  w3  x3+t8     ;
     jd         1<11+6 ;    initialize process;
     al  w2  x3        ;    w2:= name(index);
     al. w1     a4.    ;
     jl. w3    (b1.)   ;    send and wait(sense tape);
     rl. w2     b0.+6  ;
     am        -2      ;

c14=k-b0    ; exclude user:
     al  w0    -1<11+14;
     hs. w0     a3.    ;
     am        (66)    ;    nb: w3=ref dummy entry in mount table;
     dl  w1    +74     ;
     jd         1<11+72;    set catbase (boss maxbase);
     jl. w1     c48.   ;    get station;
     bz  w1  x3+s0     ;    w1:= device(station(index));
     ba  w3  x3+s1     ;    w3:= tape(index);
     al  w3  x3+t8     ;
     jd         1<11+10;    release process;
j1:  al  w3  x2+328    ;    w3:= job name;
h.   jd   ,  a3:       ;    in- or exclude user;
w.   se  w0     0      ;    if result <> 0 then
c.-1, o50, z.          ;    (bossfault xref)
     jd        -50     ;    goto alarm;
     jl.        c2.    ;    goto next action;

\f


; kll 04.04.73          boss 2, psjob, mount,   ...17a...



c43: al  w0     150    ; 12:   tape stealer:
     rs  w0  x2+d3     ;    old tape state:= 150;
     am        -11     ;
c54: am         9      ; 23:   mount special after mount:
c45: am         1      ; 14:   suspendings exceeded:
c44: al  w1    -3      ; 13:   stations exceeded:
     rl. w3     b0.+2  ;
     rl. w2     b0.+6  ;
     rl  w0  x2+d3     ;    state(tape):= saved old state;
     wa  w3  x2+d1     ;
     hs  w0  x3+t0     ;
     am      x1        ;
c47: am         5      ; 16:   tape used by other job:
c42: am         1      ; 11:   reject mount ring:
c41: am         1      ; 10:   not ordered special:
c40: al  w0     9      ;  9:   not special station:
     rl. w2     b0.+6  ;
j0:  hs  w0  x2+339    ;    set finis cause;
     rl. w2    (b11.)  ;
     al  w0     0      ;    page 3:= 0;
     rs  w0  x2+14     ;    page 4:= 0;
     rx  w0  x2+12     ;    page 1:= job descr;
     rs  w0  x2+8      ;
     dl. w3     b17.   ;
     jl.       (b8.)   ;    goto break;

a4:             0      ;    sense message;
b56=j0+1, b30=j1+1, b37=j2+1, b53=a2+1
e.                     ;
\f


; kll 17.11.71                    boss 2, psjob, mount,   ...18...

b. j9  w.              ;
c46=k-b0, am    1      ; release station:
c16=k-b0, al w0 6      ; reserve station:   w0:= opcode;
     wa  w3  x2+d1     ;
     bz  w3  x3+t6     ;    if spec device(index) then
     se  w3     0      ;
     jl.        c2.    ;    goto next action;
     al  w1     1      ;    w1:= banker param;
     jl. w3     c18.   ;    banker(w0);
     rl. w2     b0.+6  ;
     ba. w2     b52.   ;
     bz  w1  x2+2      ;    w1:=killed;
     bz  w0  x2+5      ;    w0:=exceeded;
     sn  w0     0      ;    if exceeded then
     jl.        c44.   ;    goto stations exceeded;
     se  w1     0      ;    if not killed then
     jl.        c2.    ;    goto next action;
     rl. w2     b0.+6  ;
     rl  w0  x2+d3     ;
     wa  w3  x2+d1     ;    state(tape):= saved old state;
     hs  w0  x3+t0     ;
     rl. w2    (b11.)  ;    w2:=current desc;
     al  w1     0      ;
     rs  w1  x2+8      ;    page1:=0;
     rx  w1  x2+12     ;    page3:=0;
     rs  w1  x2+14     ;    page4:= job desc;
     dl. w3     b55.   ;
     jl.       (b8.)   ;    page jump(banker kill);

c17=k-b0, al w0 17     ; stop:
     al. w3     c2.    ;    return:= next action;

c18: ws. w3     b0.    ; banker(w0):
     rs  w3  x2+d4     ;    rel return:= w3 - page 0;
j6:  rs  w1  x2+349    ;    param:= w1;
j7:  al  w1  x2+335    ;    w1:= operation;
     hs  w0  x1+2      ;    code:= w0;
     rl. w2     b31.   ;
     jl. w3    (b6.)   ;    open chained(banker que);

     rl. w2     b0.+6  ;
     rl  w3  x2+d4     ;
     wa. w3     b0.    ;    return:= rel return + page 0;
j2:  rl  w2  x2+334    ;
     jl.       (b3.)   ;    lock(psjob buf);

c27=k-b0    ; reserve tape table entry:

j3:  bl  w1  x2+337    ;
     sh  w1     0      ;    if rest suspends < 1 then
     jl.        c45.   ;    goto suspendings exceeded;
     al  w1  x1-1      ;
j4:  hs  w1  x2+337    ;    rest suspends:= rest suspends - 1;
     jl.        c2.    ;    goto next action;

c28=k-b0    ; account mount:

j1:  bl  w1  x2+336    ;
     al  w1  x1-1      ;    rest mounts:= rest mounts - 1;
j5:  hs  w1  x2+336    ;
     jl.        c2.    ;    goto next action;

b31:            67     ;    banker que
b32=j1+1, b33=j2+1, b34=j3+1, b35=j4+1, b36=j5+1
b51=j6+1, b52=j7+1
e.                     ;
\f


; kll 17.11.71                    boss 2, psjob, mount,   ...19...

b. f1 w. b. a5, j5 w.   ; procedure unload:
c19: al  w0     2      ;    operation:= unload;
     ws. w1     b0.    ;    rel return:= w1 - page 0;
     rl. w3     b0.+2  ;
     jl.        a1.    ;    goto rewinder operation;

c20=k-b0, am    1      ; unload:
c21=k-b0, al w0 1      ; rewind:
     al  w1  c2-b0     ;    rel return:= next action;
a1:  ds  w1  x2+d5     ; rewinder operation:
     jl. w1     c48.   ;    get station;
     bz  w1  x3+s8     ;    w1:= relativ sem(station);
     rs  w1  x2+d6     ;    save relativ sem(station);
     wa. w1     b38.   ;    sem:= rewinder buf + w1;
     al  w2  x1        ;
     jl. w3    (b5.)   ;    lock chained(sem);

     rl. w2     b0.+6  ;    w2:= job descr;
     rl  w0  x2+d4     ;
     rs  w0  x1+2      ;    operation code:= saved code;
     se  w0     2      ;    if saved code = unload then
     jl.        a2.    ;    begin
     wa  w3  x2+d1     ;      w3:= tape(index);
     al  w1  x3        ;      w1:= station(w3);
     ba  w1  x1+t1     ;      tape state(w3):=
sn  w1  x3        ;   if tape already released then
c.-1, o59, z.          ;    (bossfault xref)
jd        -59     ;      bossfault 59
     al  w0     0      ;      station ref(w3):=
     hs  w0  x1+s2     ;      station state(w1):=
     hs  w0  x1+s1     ;      tape ref(w1):= 0;
     hs  w0  x3+t1     ;
     bz  w1  x3+t0     ;      tape state(w3):= remove(old state);
     wd. w1     b4.    ;
     bz. w1  x1+j3.    ;
     hs  w1  x3+t0     ;    end;
a2:  dl  w2  x2+d6     ;
     wa. w2     b57.   ;    sem:= saved rel sem + rewinder que;
     al. w3  x1+b0.    ;    return:= rel return + page 0;
     rl. w1     b0.+4  ;    operation:= page 2;
     jl.       (b6.)   ;    open chained(sem, operation);

h. ;  0, 10, 20, 30, 40, 50, 60, 70, 80, 90,100,110,120,130,140,150,160
j3:   0,  0,  0, 30, 30,  0, 60, 70, 80, 60, 70, 80,120,130,140,150,160   
f1:   5  w.

c48: wa  w3  x2+d1     ; get station:
     al  w0  x3        ;
     ba  w3  x3+t1     ;    w3:= station(tape(index));
     se  w0  x3        ;    if station ref(tape) <> 0 then
     jl      x1        ;    goto return else
     jl.        c2.    ;    goto next action;

c39=k-b0    ; release tape table entry:
j1:  bl  w1  x2+337    ;
     al  w1  x1+1      ;    rest suspends:= rest suspends + 1;
j2:  hs  w1  x2+337    ;
     jl.        c2.    ;    goto next action;

c31=k-b0    ; alarm:
     dl  w1  x2+d2     ;    w0:= index; w1:= action;
c.-1, o51, z.          ;    (bossfault xref)
     jd        -51     ;    goto boss alarm;

b39=j1+1, b40=j2+1
e.                     ;
\f


; kll 27.7.71                    boss 2, psjob, mount,   ...20...

b. a5, j9  w.          ;
a4:  <: mounts exceeded:>
c22=k-b0, am    8      ; mount ring:
c23=k-b0, am    7      ; remove ring:
c38: am         1      ; display(mount on special):
c24: al  w0     a1     ; display(mount tape):
     rs  w0  x2+d4     ;    save text addr;
     rl. w2     b18.   ;
     jl. w3    (b5.)   ;    lock chained(request free);
     rl. w2     b18.   ;    w2:=request free sem;
     am.       (b0.+6)  ;
     wa  w3    +d1     ;    w0:=old request line;
     rl  w0  x3+t4     ;
     sn  w0     0      ;    if w0<>0 then
     jl.        a0.    ;      begin
     sz  w0     1      ;    if w0 not even then
c.-1, o54, z.          ;         (bossfault xref)
     jd        -54     ;        bossfault 54
     jl. w3    (b6.)   ;      else
     jl.        c2.    ;        regret the request (tape has just been remoted)
a0:  rl. w2     b0.+6   ;    w2:=job descr;
j1:  dl  w0  x2+329    ;
     lo. w0     b9.    ;    spaces;
     lo. w3     b9.    ;
     ds  w0  x1+8      ;    job name
j2:  dl  w0  x2+330    ;
     lo. w0     b9.    ;    spaces;
     lo. w3     b9.    ;
     ds  w0  x1+12     ;    job name
     rl  w2  x2+d4     ;    w2:= saved text rel;
     dl. w0  x2+b0.+2  ;
     ds  w0  x1+16     ;    text
     dl. w0  x2+b0.+6  ;
     ds  w0  x1+20     ;    text
     so  w2     1      ;    if special then
     jl.        a2.    ;    begin
     am.       (b0.+6) ;
     dl  w0    +d7     ;      move(on <device>);
     ds  w0  x1+32     ;      length:= 28;
     am         4      ;    end
a2:  al  w3     24     ;    else length:=24;
     al  w2  1<3+1<1      ;
     ds  w3  x1+4      ;    code:=insert line;
     rl. w2     b0.+6  ;
j3:  bl  w0  x2+336    ;
     sl  w0     0      ;    if rest mounts <0 then
     jl.        a3.    ;    begin
     ba. w0     f1.    ;
j4:  hs  w0  x2+336    ;      rest mounts:= rest mounts+ 5;
j5:  bl  w0  x2+344    ;
     ba. w0     f1.    ;      mounts:= mounts+ 5;
j6:  hs  w0  x2+344    ;
     al  w2  x3+12     ;      length:=length+12;
     rs  w2  x1+4      ;
     wa  w2  2         ;      move <: mounts exceeded:>
     dl.a4.+2,dsx2-4,dl.a4.+6,dsx2,dl.a4.+10,dsx2+4
a3:  rl. w2     b0.+2  ;    end;
     am.       (b0.+6) ;
     wa  w2    +d1     ;    w2:= tape(index);
     rl. w3    (b11.)  ;
     rl  w0  x3+10     ;
     rx  w0  x2+t4     ;    request(w2):= virt operation;
     dl  w0  x2+t8+2   ;
     ds  w0  x1+24     ;    tape name
     dl  w0  x2+t8+6   ;
     ds  w0  x1+28     ;    tape name
     rl. w2     b20.   ;
     jl. w3    (b6.)   ;    open chained(request que);
     jl.        c2.    ;    goto next action;
a1=k-b0, <:mount  tape remove ring mount  ring :>
b41=j1+1, b42=j2+1, b58=j3+1, b59=j4+1, b60=j5+1, b61=j6+1
e.e.                     ;
\f


; kll 17.11.71                    boss 2, psjob, mount,   ...21...

b. a9, j5  w.          ; procedure search name:
; entry:   w0 = irr, w1 = return, w2 = message, w3 = mount table.
; exit:    w0 = undef, w1 = undef, w2 = job descr, w3 = mount table.
c32: rs. w1     b12.   ;    save return;
     al  w3  x3+g6-2   ;    save limit of tape table;
     rs. w3     b13.   ;
     al  w3  x3-g5-g4+2;    w3:= abs index:= base tape table;
a1:  al  w3  x3+g4     ; rep:
     sl. w3    (b13.)  ;    w3:= abs index:= abs index + length;
     jl.        a3.    ;    if abs index > limit then goto not found;
     bz  w0  x3+t0     ;    w0:= state(abs index);
     se  w0     g7     ;    if state=reserved
     sn  w0     0      ;    or state = 0 then
     jl.        a1.    ;    goto rep;

a2:  dl  w1  x2+18     ;    if name(message) <>
     sn  w0 (x3+t8)    ;    name(abs index)
     se  w1 (x3+t8+2)  ;
     jl.        a1.    ;    then goto rep;
     dl  w1  x2+22     ;
     sn  w0 (x3+t8+4)  ;
     se  w1 (x3+t8+6)  ;
     jl.        a1.    ;    comment name found: ;

     rl. w2     b0.+6  ;    w2:= job descr;
j1:  rl  w0  x2+327    ;
     rl  w1  x3+t2     ;    if job nr(abs index) = 0 then
     sn  w1     0      ;    job nr(abs index):= job nr(descr);
     rs  w0  x3+t2     ;
     se  w0 (x3+t2)    ;    if job nr(abs index) <> job nr(descr) then
     jl.        a6.    ;    goto used;
j4:  rl  w0  x2+331    ;
     hs  w0  x3+t7     ;    psjobrel(abs index):= psjob rel(descr);
     jl.        a4.    ;    goto found;
a3:  rl. w3     b0.+2  ; not found:   abs index:= dummy entry;
a4:  ws. w3     b0.+2  ; found:
     rl. w2     b0.+6  ;    w2:= job descr;
     rs  w3  x2+d1     ;    index:= abs index - mount table;
     rl. w3     b0.+2  ;    w3:= mount table;
     jl.       (b12.)  ;    goto return;

a6:  ws. w3     b0.+2  ; used:
     rs  w3  x2+d1     ;    index:= abs index - mount table;
     jl.        c47.   ;    goto tape used by other job;


\f



; kll 20.3.72                    boss 2, psjob, mount,   ...22...


c49=k-b0    ; init tape entry:
     al  w3  x3+g3-g4  ;    w3:= abs index:= base of tape table;
a5:  al  w3  x3+g4     ; rep:
     bz  w0  x3+t0     ;    abs index:= abs index + length;
     se  w0     0      ;    or state(abs index)<> free then
     jl.        a5.    ;    goto rep;
     al  w0     g7     ;
     hs  w0  x3+t0     ;    state(abs index):= reserved;

j2:  rl  w1  x2+327    ;
     rs  w1  x3+t2     ;    job nr(abs index):= job nr(descr);
j3:  rl  w1  x2+331    ;
     rs  w1  x3+t6     ;    psjob rel(abs index):= psjob rel(descr);
     rl  w2  x2+d0     ;
     dl  w1  x2+18     ;    name (abs index):= name(message);
     ds  w1  x3+t8+2   ;
     dl  w1  x2+22     ;
     ds  w1  x3+t8+6   ;
     rl. w2     b0.+6  ; 
     ws. w3     b0.+2  ;    index:= abs index - page 1;
     rs  w3  x2+d1     ;
     jl.        c2.    ;    goto next action;
b43=j1+1, b44=j2+1, b45=j3+1, b65=j4+1
e.                     ;

b. a3, j6  w.          ;
c30=k-b0    ; release request line:
     al  w0     1      ;    code:= release request;
     wa  w3  x2+d1     ;
     rl  w1  x3+t4     ;
     so  w1     1      ;    if no pending request line then
     jl.        c2.    ;      goto next action;
     al  w1     2      ;    request := request(tape)
     rx  w1  x3+t4     ;    request(tape) := even (i.e. being removed);
j1:  rs  w0  x2+333    ;    op + 2:= code;
j2:  rs  w1  x2+335    ;    op + 6:= request;
j3:  al  w1  x2+332    ;
     rl. w2     b20.   ;
     jl. w3    (b6.)   ;    open chained(request que);

     rl. w1     b0.+6  ;
j4:  rl  w2  x1+334    ;
     jl. w3    (b3.)   ;    lock(psjob buf);
     rl. w2     b0.+6  ;
     wa  w3  x2+d1     ;    w3 := abs tape entry;
     al  w0     0      ;
     rs  w0  x3+t4     ;    request(tape) := 0  (i.e. removed);
     jl.        c2.    ;    goto next action;
\f



; kll 20.3.72                    boss 2, psjob, mount,   ...23...


c33=k-b0, am       1   ; check work tape exists:
c34=k-b0, al w0    g35 ; check named tape exists:
     rs  w0  x2+d4     ;    d4:= save state pointer;
     am        (66)    ;    nb: w3=ref dummy entry in mount table;
     dl  w1    +74     ;
     jd         1<11+72;    set catbase(boss maxbase);
     wa  w3  x2+d1     ;
     al  w3  x3+t8     ;    w3:= name(index);
     jd         1<11+4 ;
     se  w0     0      ;    if process(w3) exists then
     jl.        a2.    ;    goto skip actions;
     al  w1  x3-t8     ;
     ba  w1  x1+t1     ;    w1 := station ref;
     hs  w0  x3-t8+t1  ;    station(tape) := 0;
     sn  w1  x3-t8     ;    if station ref empty then
     jl.        c2.    ;      goto next action;
     hs  w0  x1+s1     ;    tape(station) := 0;
     hs  w0  x1+s2     ;    station  state:= 0;
     jl.        c2.    ;    goto next action;

a2:                    ; skip actions:
     bz  w0  x3-t8+t1  ;
     sn  w0     0      ;    if station ref not empty then
     jl.        c51.   ;    begin
     ba  w3  x3-t8+t1  ;
     bz  w1  x3-t8+s0  ;      w1:= device(station(index));
j5:  al  w3  x2+328    ;      w3:= job name;
     jd         1<11+12;      include user;
     se  w0     0      ;      if result <> 0 then
c.-1, o52, z.          ;    (bossfault xref)
     jd        -52     ;      goto boss alarm;
                       ;    end;
c51: rl  w0  x2+d4     ; action(d4):
     rs  w0  x2+d2     ;    action:= d4;
     rl. w3     b0.+2  ;    w3:= mount table;
     jl.        b0.+c26;    goto answer;

c53=k-b0   ; check mount spec after mount:
     wa  w3  x2+d1     ;    w3:= tape(index);
     rl  w1  x2+d0     ;    w1:= message addr;
     bz  w0  x3+t6     ;  
     se  w0 (x1+14)    ;    if abs device <> device in message then
     jl.        c54.   ;    goto mount spec after mount else
     jl.        c2.    ;    goto next action;

b46=j1+1, b47=j2+1, b48=j3+1, b49=j4+1, b50=j5+1
e.                     ;
\f


; kll 17.11.71                    boss 2, psjob, mount,   ...24...
b. a9  w.              ;

c36=k-b0    ; check station kind:
     rl  w1  x2+d2     ;
     al  w1  x1+1      ;    action:= action + 1;
     rs  w1  x2+d2     ;
     jl. w1     c48.   ;    get station;
     bz  w1  x3+s9     ;
     bz  w0  x3+s0     ;    w0:= device(station);
     ba  w3  x3+s1     ;    w3:=tape(index);
     bs  w0  x3+t6     ;
     sn  w0     0      ;    if device(station) = abs station then
     jl.        c2.    ;    goto next action;
     bz  w0  x3+t6     ;
     sz  w1     1      ;    if station kind = standard 
     se  w0     0      ;    and abs station = 0 
     jl.        4      ;    then
     jl.        c2.    ;    goto next action;

     rl  w1  x2+d2     ;
     am.       (b0.+8) ;    action:= alternative
     bz  w1  x1-1      ;    actions(action);
     rs  w1  x2+d2     ;
     jl.        c2.    ;    goto next action;

c56:                   ; mount special:   w1 = device.
     al  w0     0      ;    convert device to text form: ;
     wd. w1     b4.    ;    w0:= device mod 10; w1:= device // 10;
     ls  w1     8      ;    w1:= w1 < 8 + w0;
     lo  w1     0      ;    add text bits to w1;
     lo. w1     a5.    ; 
     rl. w0     a6.    ;
     ds  w1  x2+d7     ;    save text:   on <device>
     rl. w3     b0.+2  ;
     jl.        c38.   ;    goto display(mount on special);
     a5:      <: 00:>  ;
     a6:      <: on:>  ;

c62=k-b0               ; move bit:
     jl. w1     c48.   ;    get station;
     bz  w0  x3+s9     ;
     se  w0     1      ;    if special or reserved then
     jl.        c2.    ;      goto next action;
     al  w0     3      ;
     rs. w0     b12.   ;
     jl. w1     c63.   ;    w1 := search min state(reserved standard);
     rl. w2     b0.+6  ;
     al  w0     1      ;
     hs  w0  x1+s9     ;    free and standard.w1 := free standard;
     jl. w1     c48.   ;
     al  w0     3      ;
     hs  w0  x3+s9     ;    free and standard.station(index) := reserved std;
     jl.        c2.    ;    goto next action;
e.                     ;

\f



; kll 20.3.72                    boss 2, psjob, mount,   ...25...


b. a9,j9  w.           ;
c52=k-b0   ; set spec device nr:
     rl  w1  x2+d0     ;    w1:= message addr;
     rl  w0  x1+14     ;
     wa  w3  x2+d1     ;    spec device(index):= device(message);
     hs  w0  x3+t6     ;
     jl.        c2.    ;    goto next action;

c50=k-b0, am       1   ; check ring work:
c35=k-b0, al w0    g35 ; check ring:
     rs  w0  x2+d4     ;
     wa  w3  x2+d1     ;    w3:= tape(index);
     al  w1  x3        ;    w1:= station(tape);
     ba  w1  x1+t1     ;
     bz  w0  x1+s3     ;    w0:= tape kind;
     se  w1  x3        ;    if tape not mounted or
     so  w0     1      ;    no ring then
     jl.        c2.    ;    goto next action else
     jl.        c51.   ;    goto action(d4);

; entry: w3 = return. exit: w2 = message addr, w3 = mount table
c60: am.       (b0.+4) ; alarm params:
     rl  w2    +4      ;    w2:= message addr; first of text = w2 + 8 + 8.
a1:  rs. w3     b12.   ; move text:
     rl. w3     b0.+6  ;    w3 := job descr;
     dl  w1  x2+8+10   ;    move text from w2 + 16, + 18, + 20, + 22
     ds  w1  x3+d8+2   ;
     dl  w1  x2+8+14   ;    to text param field on descr;
     ds  w1  x3+d8+6   ;
     rl  w0  x2+8+6    ;
     rs  w0  x3+d9     ;    move device param in message to descr;
     rl. w3     b0.+2  ;    w3:= mount table;
     jl.       (b12.)  ;    goto return;

c61: am.       (b0.+2) ; alarm params (index):
     al  w2  x1+t8-8-8 ;    w2:= tape(index) + t8 - (8+8); tape name is tape(index) + t8;
                       ;    (note: 8+8 is the displacement used in move text)
     jl.        a1.    ;

c64=k-b0               ; fp syntax:
j1:  bz  w0  x2+339    ;
     sn  w0     0      ;    if finis cause undef then
     jl.        c2.    ;    goto next action;
     rl  w0  x2+d3     ;
     wa  w3  x2+d1     ;    tape state:= saved old state;
     hs  w0  x3+t0     ;    comment after a provoke break fp has sent
     rl. w2    (b11.)  ;    a mount message to a tape in state 130 or 140;
     al  w0     0      ;
     rs  w0  x2+14     ;    page 3:= 0;
     rx  w0  x2+12     ;    page 4:= 0;
     rs  w0  x2+8      ;    page 1:= job descr;
     rl. w2     b62.   ;
     rl. w3     b10.   ;
     jl.       (b8.)   ;    page jump(finis(finis cause));
b127=j1+1
e.                     ;

i.e.                   ;
g1=k-b0                ;    length of page;
\f


; kll 27.7.71                    boss 2, remoter,   ...26...


;    Contents:

;    c0    28     wait operation
;    c1    28     name or label state 0
;    c2    28     name or label state 1, 2
;    c3    29     name or label state 3, 4
;    c4    29     name or label state 5
;    c5    30     remote pressed state 0
;    c6    32     remote pressed state 1, 2
;    c7    32     remote pressed state 3, 4
;    c8    32     remote pressed state 5
;    c9    33     search name
;    c10   34     save operation
;    c11   34     sense ring
;    c12   35     answer commandio ok
;    c13   35     answer commandio not ok
;    c14   35     answer watch dog
;    c15   35     find and link empty tape entry
;    c16   35     link
;    c17   35     link of tape entry
;    c18   36     remove request
;    c19   36     name station
;    c20   37     write label
;    c21   39     add stopped, word defect
;    c22   40     erase
;    c23   40     exclude user
;    c24   41     input (mode)
;    c25   41     check ciffer 3
;    c26   41     check ciffer 2
;    c27   41     check ciffer 1
;    c28   41     reserve label read
;    c29   41     reserve label write
;    c30   41     release label read
;    c31   41     release label write
;    c32   43     not found
;    c33   43     unwriteable
;    c34   43     mount ring
;    c35   35     unmount tape
;    c36   43     write name syntax
;    c37   43     name illegal
;    c38   43     unreadable
;    c39   43     c38 - c36
;    c40   29     return from input(mode)
;    c41   41     check ciffer or letter 3
;    c42   41     check ciffer or letter 2
;    c43   41     check ciffer or letter 1
;    c44   43     not wanted
;    c45   40     local
;    c46   41      rewind tape
\f


; kll 27.7.71                    boss 2, remoter,   ...27...

b. b40, c50  w.        ;

g15: b0:  0,r.5        ; page addresses
     52<12 + 0         ;    page ident:  remoter

b1:       0            ;    sense message
b2:       3<12         ;    input
b3:       0            ;    (saved return from c45)
b4:       0            ;
b5:       5<12         ;    output, mode
b6:       0            ;
b7:       0            ;
b8:       6<12         ;    erase
b9:       8<12, 3      ;    backspace block
b10:      8<12, 4      ;    rewind
b11:      8<12, 5      ;    unload
b12:      10<12        ;    output mark
b13:      10           ;
b14:      533328       ;    48'4 + 48'3 + 48'2 + 48'1 + 48
b15:      255          ;    last 8 bits
b16:      1<15         ;    test writing enabled
b17:      1<16         ;    tapemark
b18:      45<18+61+1<14;    hard - parity
b19:      63<18+61+1<14;    hard
b20:      28           ;    label length

b21:      <:VOL:>      ,b22:      <:mt :>
b23:      <:   :>      ,b24:      <:000:>
b25:      <: 00:>      ,b26:      <:0  :>
b27:      <: on:>      ,b28:      <: w     p  r :>
b29:      <:<0>mt:>    ,b36:      <:1  :>

b30: h. 0,4            ;    input modes
b31=k-b30  w.          ;    max modus

c.  -e25, b84=k, b86=k+2  z.   ;
b32: 0, b33: 0, b34: 0, b35: 0 ;    work
b37:      0            ;    work
b38:      63           ;    mask

b70:      1            ;    send and wait
b71:      9            ;    send and wait slow
b72:      3            ;    lock
b73:      4            ;    open
b74:      5            ;    lock chained
b75:      6            ;    open chained
b77:      26           ;    current descr
b78:      51           ;    request que
b79:      52           ;    request free
b80: h. e25*e13, 19  w.;    remoter que
b81: h. i45*e13, 19  w.;    remote operation
b82:      63           ;    psjob que 
b83:      0            ;    virt label read
b84=k, h.   e13, 19  w.;    label read sem
b85:      0            ;    virt label write
b86=k, h.   e13, 19  w.;    label write sem
b87:      21           ;    private output
\f


; kll 27.7.71                    boss 2, remoter,   ...28...

; the job of the remoter is to read labels on tapes when they
; are mounted and to find the corresponding psjob and tell what
; has happened. On operator request the remoter will name or
; name and write label on special tape stations. All error
; situations are reported to the operator.
; The remoter uses its page description like this:

;     page 1    station entry in mount table
;     page 2
;     page 3    tape table
;     page 4    answer sem or label buf or saved state

b. a9  w.              ;
c0:  rl. w3     b0.+2  ; wait operation:
     rl. w2     b0.+6  ;
     al  w2  x2-g3+g8  ;
a0:  al  w1  x2        ;
     sl. w1    (b0.+6) ;
     am         (:g4-g2:)<6+1;
     al  w0     g2<6+18;
     jl. w3    (b87.)  ;
     sl. w2    (b0.+6) ;
     am         g4-g2  ;
     al  w2  x2+g2     ;
     am.       (b0.+6) ;
     sh  w2     g5-1   ;
     jl.        a0.    ;
     rl. w2     b80.   ;
     ba  w2  x3+s8     ;    sem:= remoter que + rel semaphor;
     jl. w3    (b74.)  ;    lock chained(sem, buf);

g16=k-b0               ;    rel first time entry;

     rl. w2    (b77.)  ;
     rl  w0  x1+4      ;
     rs  w0  x2+14     ;    page 4:= answer sem;
     bz  w2  x3+s2     ;    w2:= station state;
     la. w2     b38.   ;
     rl  w0  x1+2      ;    w0:= operation code;
     jd        -1      ;
     se  w0     3      ;
     am         a2     ;    if operation code = 3 then
     bz. w2  x2+a1.    ;    goto remote pressed(station state) else
     jl.     x2+b0.    ;    goto name or label(station state);

;state:   0,  1,  2,  3,  4,  5
a1: h.   c5, c6, c6, c7, c7, c8 ;    remote pressed (code= 3)
a2=k-a1, c1, c2, c2, c3, c3, c4 ;    name or label  (code<>3)
w.

c1=k-b0    ; name or label state 0:
     jl. w2     c15.   ;    find and link empty tape entry;

c2=k-b0    ; name or label state 1, 2:
     jl. w2     c10.   ;    save operation;
     jl. w3     c12.   ;    answer commandio ok;
     jl. w2     c18.   ;    remove request;
     jl.        c48.   ;    goto wait operation (c0.) via operator request (c48.) ;

e.                     ;
\f


; kll 27.7.71                    boss 2, remoter,   ...29...

b. a5  w.              ;
c3=k-b0     ; name or label state 3, 4:
; comment the actions until c4 must be undividable.
     ba  w3  x3+s1     ;    get tapeaddres;
     al  w3  x3+t8     ;    get tapenameaddres;
     jd         1<11+64;    remove process;
     rl. w3     b0.+2  ;    w3:= station
     se  w0     0      ;    if process removed
     sn  w0     3      ;    or removed by another then
     jl.        a1.    ;    continue label-name funktion;

     al. w3     c0.    ;    else answer commandio: not-ok (c13.)
     jl.        c13.   ;    and continue at c0. (wait-operation).

a1:  jl. w2     c23.   ;    exclude user;
     ba  w3  x3+s1     ;
     al  w0     0      ;
     rx  w0  x3+t4     ;    save request addr and clear;
     rs. w0     b37.   ;
     rl. w3     b0.+2  ;
     jl. w2     c35.   ;    unmount tape;
     jl. w2     c15.   ;    find and link empty tape entry;
     ba  w3  x3+s1     ;
     rl. w0     b37.   ;
     rs  w0  x3+t4     ;    request addr:= saved request addr;
     rl. w3     b0.+2  ;
     rl. w1     b0.+4  ;    w1:=operation;
     jl.        b0.+c2 ;    goto name or label state 1, 2;

c4=k-b0     ; name or label state 5:
     jl. w2     c10.   ;    save operation;
     jl. w3     c12.   ;    answer commandio ok;
     jl. w2     c18.   ;    remove request;
     jl. w2     c19.   ;    name station;
     ba  w3  x3+s1     ;
     al  w2  x3+t8     ;    ref name;
     al. w1     b1.    ;
     jl. w3    (b70.)  ;    send and wait(sense tape);
     so  w0     1<1    ;    if not normal answer then
     jl.        c0.    ;    goto wait; comment local;
     jl. w2     c20.   ;    write label;
     jl.        c9.    ;    goto search name;

e.                     ;
\f


; kll 27.7.71                    boss 2, remoter,   ...30...

b. a9  w.              ;
c5=k-b0     ; remote pressed state 0:
     jl. w2     c15.   ;    find and link empty tape entry;
     al  w0     0      ;
     ba  w3  x3+s1     ;
     rs  w0  x3+t8     ;    name(tape(station)):= 0;
     rl. w3     b0.+2  ;
     jl. w2     c19.   ;    name station;
     jl. w3     c14.   ;    answer watch dog;
     jl. w2     c18.   ;    remove request;
     jl. w2     c11.   ;    sense ring;
     jl. w3     c28.   ;    reserve label read;
     ld  w1    -100    ;    mode:= parity count:= 0;
     ds  w1  x3+s12+s10-s10;
                       ; read:
a1:  jl.        c24.   ;    input(mode);
c40: sz  w0     1<5    ;    if not exist then
     jl.        a6.    ;    goto local;
     sz. w0    (b18.)  ;    if status and hard-parity <> 0 then
     jl.        a5.    ;    goto mode count;
   
     la. w0     b19.   ;
     sn  w0     0      ;    if status and hard = 0 then
     jl.        a4.    ;    goto status ok;

     rl  w1  x3+s12    ;
     al  w1  x1+1      ;    parity count:= parity count + 1;
     rs  w1  x3+s12    ;   
     sl  w1     10     ;    if parity count > 9 then
     jl.        c38.   ;    goto unreadable else
     jl.        a1.    ;    goto read;

a5:  rl  w1  x3+s10    ; mode count:
     al  w1  x1+1      ;    mode:= mode + 1;
     rs  w1  x3+s10    ;
     sl  w1     b31    ;    if mode >= max mode then
     jl.        c38.   ;    goto unreadable else
     jl.        a1.    ;    goto read;

a6:  jl. w3     c30.   ; local:   release label read;
     jl. w2     c45.   ;    call local;
     jl.        c0.    ;    goto wait operation;

a4:  rl  w1  x1+2      ; status ok:   
     se  w1     56     ;    if bytes transferred <> 56 then
     jl.        c38.   ;    goto unreadable;

     rl. w3     b0.+8  ;    w3:= label;
     dl  w1  x3+2      ;
     ls  w1    -16     ;
     sn. w0    (b21.)  ;    if character(1:4) <> VOL1 then
     se  w1     49     ;
     jl.        c38.   ;    goto unreadable;

e.                     ;
\f


; kll 3.1.72                    boss 2, remoter,   ...31...


; project number:

                       ;    the ciffer values correspond to the label
     rl  w0  x3+24     ;    shown on page 41.
     jl. w1     c26.   ;    check ciffer 2;
     rl  w2     0      ;    w2:= 3;
     al  w2  x2-48     ;
     rl  w0  x3+24     ;
     jl. w1     c27.   ;    check ciffer 1;
     wm. w2     b13.   ;
     wa  w2     0      ;    w2:= w2 * 10 + 1;
     rl  w0  x3+26     ;
     jl. w1     c25.   ;    check ciffer 3;
     wm. w2     b13.   ;
     wa  w2     0      ;    w2:= w2 * 10 + 0;
     rl  w0  x3+26     ;
     jl. w1     c26.   ;    check ciffer 2;
     wm. w2     b13.   ;
     wa  w2     0      ;    w2:= w2 * 10 + 4;
     rl  w0  x3+26     ;
     jl. w1     c27.   ;    check ciffer 1;
     wm. w2     b13.   ;
     wa  w2     0      ;    w2:= w2 * 10 + 9;
     rl  w0  x3+28     ;
     jl. w1     c25.   ;    check ciffer 3;
     wm. w2     b13.   ;    w2:= w2 * 10 + 3;
     wa  w2     0      ;    comment a ciffer is 48 + value;
     ws. w2     b14.   ;    w2:= w2 - 5333328;
     rl. w3     b0.+2  ;    w3:= station;
     rs  w2  x3+s4     ;    project(station):= w2;
     rl. w2     b0.+8  ;    w2:= label;
     rl  w0  x2+6      ;
     al  w1    -1      ;    w1:= -1;
     ls  w0    -8      ; 
     la. w0     b15.   ;    w0:= tape kind position;
     sn  w0     119    ;  
     al  w1     0      ;    if w0 = w then w1 := 0 else
     sn  w0     32     ;
     al  w1     2      ;    if w0 = <sp> then w1:= 2;
     sn  w0     112    ;
     al  w1     4      ;    if w0 = p then w1:= 4 else
     sn  w0     114    ;
     al  w1     6      ;    if w0 = r then w1:= 6;
     sn  w1    -1      ;    if w1 = -1 then
     jl.        c38.   ;    goto unreadable;
     hl  w0  x3+s3     ; 
     sz  w0     1      ;    if writing enable then
     al  w1  x1+1      ;    w1:= w1 + 1;
     hs  w1  x3+s3     ;    tape kind:= w1;
\f


; kll 3.1.72                    boss 2, remoter,   ...32...


; tape name:

     ba  w3  x3+s1     ;    w3:= tape;
     rl  w0  x2+2      ;
     jl. w1     c42.   ;    check ciffer or letter 2;
     lo. w0     b22.   ;
     rs  w0  x3+t8     ;    tape name + 0:= <:mt2:>;
     rl  w0  x2+2      ;
     jl. w1     c41.   ;    check ciffer or letter 1;
     ls  w0     16     ;
     rs. w0     b32.   ;    save 8;
     rl  w0  x2+4      ;
     jl. w1     c25.   ;    check ciffer 3;
     ls  w0     8      ;
     rs. w0     b33.   ;    save 5;
     rl  w0  x2+4      ;
     jl. w1     c26.   ;    check ciffer 2;
     lo. w0     b32.   ;
     lo. w0     b33.   ;
     rs  w0  x3+t8+2   ;    tape name + 2:= <:850:>;
     rl  w0  x2+4      ;
     jl. w1     c27.   ;    check ciffer 1;
     ls  w0     16     ;
     rs. w0     b32.   ;    save 6;
     rl  w0  x2+6      ;
     jl. w1     c25.   ;    check ciffer 3;
     ls  w0     8      ;
     lo. w0     b32.   ;
     rs  w0  x3+t8+4   ;    tape name + 4:= <:64<0>:>;
     al  w0     0      ;
     rs  w0  x3+t8+6   ;    tape name + 6:= 0;
     jl. w3     c46.   ;    rewind tape
     jl. w3     c30.   ;    release label read;
     jl. w2     c19.   ;    name station;
     jl.        c9.    ;    goto search name;

c6=k-b0     ; remote pressed state 1, 2:
     jl. w3     c14.   ;    answer watch dog;
     jl. w2     c18.   ;    remove request;
     jl. w2     c19.   ;    name station;
     jl. w2     c11.   ;    sense ring;
     jl. w2     c20.   ;    write label;
     jl.        c9.    ;    goto search name;

c7=k-b0     ; remote pressed state 3, 4:
     jl. w2     c23.   ;    exclude user;
     jl. w2     c18.   ;    remove request;
     jl. w2     c35.   ;    unmount tape;
     jl.        b0.+c5 ;    goto remote pressed state 0;
c8=k-b0     ; remote pressed state 5:
     jl. w2     c18.   ;    remove request;
     jl. w2     c17.   ;    link of tape entry;
     jl.        b0.+c5 ;    goto remote pressed state 0;
\f


; kll 27.7.71                    boss 2, remoter,   ...33...

b. a5  w.              ;
c9:  rl. w2     b0.+6  ; search name:
     al  w2  x2+g5     ;
     rs. w2     b32.   ;    save tape table top;
     al  w2  x2-g5-g4  ;    w2:= tape:= tape table base;
     ba  w3  x3+s1     ;    w3:= old tape;
     al  w3  x3+t8     ;    w3:= tape name;
     jd         1<11+10;    release process;
     al  w3  x3-t8     ;    w3:= old tape;

a1:  al  w2  x2+g4     ; next tape:   tape:= tape + length;
     sl. w2    (b32.)  ;    if tape >= tape table top then
     jl.        a3.    ;    goto search work tape;
     rl  w0  x2+t0+t1-t1;    if tape state = 0 or
     sl  w0     2047   ;       tape ref <>  0 then
     sz  w0     2047   ;   
     jl.        a1.    ;       goto next tape;

     dl  w1  x3+t8+2   ;
     sn  w1 (x2+t8+2)  ;    if name part(old tape)<>
     se  w0 (x2+t8)    ;    name part(tape) then
     jl.        a1.    ;    goto next tape;
     dl  w1  x3+t8+6   ;
     sn  w1 (x2+t8+6)  ;    if name part(old tape) <>
     se  w0 (x2+t8+4)  ;    name part(tape) then
     jl.        a1.    ;    goto next tape;

a2:  rl  w0  x3+t16    ; found:
     rs  w0  x2+t16    ;    name table(new):=name table(old);
     al  w0     0      ;
     rs  w0  x3+t0+t1-t1;    state(old tape) := station(old tape) := 0;
     rl. w3     b0.+2  ;    w3:= station;
     jl. w1     c16.   ;    link(w2, station);

     al  w0     4      ;
     hs  w0  x3+s2     ;    station state:= remoted;
     jl. w2     c18.   ;    remove request;

     rl. w2     b81.   ;
     ba  w3  x3+s1     ;
sn. w3 (b0.+2) ; if tape gone then
c.-1, o110, z.         ;    (bossfault xref)
jd     -110    ; bossfault;
     ba  w2  x3+t7     ;    w2:= remote op(rel psjob);
     rl  w0  x2        ;
     rl  w1  x3+t2     ;
     sn  w1     0      ;    if jobnr(index) = 0 then
     jl.        c32.   ;    goto not found;
     sh  w0     0      ;    if w2 > 0 then
     jl.        c0.    ;    begin
     al  w0     2      ;      request(tape) := even  (i.e. reserve the tape);
     rs  w0  x3+t4     ;
     jl. w3    (b74.)  ;      lock chained(w2);
     rl. w2     b82.   ;      comment w1 = operation;
     ba  w3  x3+s1     ;      w2:= psjob que(rel psjob);
sn. w3 (b0.+2) ; if tape gone then
c.-1, o111, z.         ;    (bossfault xref)
jd     -111    ;   bossfault
     al  w0     0     ;    request(tape) := 0  (i.e. release the tape entry);
     rs  w0  x3+t4    ;
     ba  w2  x3+t7     ;      open chained(w2, w1);
     jl. w3    (b75.)  ;    end;
     ba  w3  x3+s1     ;
     sn. w3    (b0.+2) ;    if tape ref(station) = 0 then
     jl.        c0.    ;      goto wait;
     bz  w0  x3+t0     ;    if tape wanted then
     sl  w0     60     ;
     jl.        c0.    ;    goto wait else
     jl.        c44.   ;    goto not wanted;
\f


; kll 27.7.71                    boss 2, remoter,   ...34...


a3:  rl. w1     b0.+2  ; search work tape:
     bz  w0  x1+s3     ;
     sl  w0     2      ;    if not work tape then
     jl.        c32.   ;    goto not found;
     rl. w2     b0.+6  ;    w2:= tape:= tape table base;

a4:  sl. w2    (b32.)  ; rep:   if tape < top then
     jl.        c32.   ;    goto not found;
     bz  w0  x2+t0     ;
     se  w0     60     ;    if state = 60 or
     sn  w0     120    ;    state = 120 then
     jl.        a5.    ;    goto work found;
     al  w2  x2+g4     ;    tape:= tape + length;
     jl.        a4.    ;    goto rep;
a5:  dl  w1  x3+t8+2   ; work found:
     ds  w1  x2+t8+2   ;
     dl  w1  x3+t8+6   ;    move tape name from old tape
     ds  w1  x2+t8+6   ;    to tape;
     jl.        a2.    ;    goto found;

c10:    ; save operation:
; entry:   w0 = irr, w1 = operation, w2 = return, w3 = irr.
; exit:    w0 = undef, w1 = operation, w2 = undef, w3 = station.
     rs. w2     b32.   ;    save return;
     rl. w2     b0.+2  ;    w2:= station;
     rl  w3  x1+2      ;   
     al  w0  x3-2      ;
     ls  w0     6      ;
     sl  w3     3      ;    if operation code > label
     al  w3     2      ;    then operation code:= label;
     lo  w3     0      ;
     ls  w3     12     ;    station state:= label mode < 6 + operation code;
     hl  w3  x1+17     ;
     bz  w0  x2+s3     ;    tape kind(station):= tape kind(op)
     sz  w0     1      ;    + writing enabled;
     al  w3  x3+1      ;
     rl  w0  x1+14     ;    project(station):= project(op);
     ds  w0  x2+s2-s2+s3-s3+s4;
     ba  w2  x2+s1     ;    w2:= tape(station);
     dl  w0  x1+8      ;
     ds  w0  x2+t8+2   ;    move name(operation) to
     dl  w0  x1+12     ;    name(tape(station));
     ds  w0  x2+t8+6   ;
     rl. w3     b0.+2  ;    w3:= station;
     jl.       (b32.)  ;    goto saved return;

c11:    ; sense ring:
; entry:   w0 = irr, w1 = irr, w2 = return, w3 = station.
; exit:    w0 = undef, w1 = undef, w2 = undef, w3 = station.
     ws. w2     b0.    ;    w2:= return - page 0;
     rs  w2  x3+s10    ;    save relativ return;
     ba  w3  x3+s1     ;
     al  w2  x3+t8     ;    w2:=tape name;
     al. w1     b1.    ;
     jl. w3    (b70.)  ;    send and wait(sense);
     al  w1    -1<1    ;
     la  w1  x3+s3     ;
     sz. w0    (b16.)  ;    if writing enable then
     al  w1  x1+1      ;    tape kind:= tape kind + ring;
     hs  w1  x3+s3     ;
     rl  w2  x3+s10    ;
     rl. w3     b0.+2  ;    w3:= station;
     jl.     x2+b0.    ;    goto relativ return + page 0;
e.                     ;
\f


; kll 9.2.72                    boss 2, remoter,   ...35...

b. a5  w.              ;
; answer commandio:
; entry:   w0 = irr, w1 = operation, w2 = irr, w3 = return.
; exit:    w0 = undef, w1 = undef, w2 = undef, w3 = station.
c12: al  w0     0      ; ok:
     rs  w0  x1+2      ;    code:= 0;
c13: al  w0     0      ; not ok:
     rl. w2    (b77.)  ;
     rs  w0  x2+10     ;    page 2:= 0;
     rl  w2  x2+14     ;    w2:= answer sem;
     jl.       (b73.)  ;    open(w2); return to w3;

c14=c13     ; answer watchdog;

c15:    ; find and link empty tape entry:
; entry:   w0 = irr, w1 = irr, w2 = return, w3 = station.
; exit:    w0 = undef, w1 = unch, w2 = undef, w3 = station.
     ds. w2     b33.   ;    save w1, return;
     rl. w2     b0.+6  ;    w2:= tape:= tape table start;
a1:  bz  w0  x2+t0     ; rep:
     sn  w0     0      ;    if state(tape) = 0 then
     jl.        a3.    ;    goto reserve and link;
     al  w2  x2+g4     ;    tape:= tape + length;
     jl.        a1.    ;    goto rep;
a3:  al  w1     g7     ; reserve and link:
     hs  w1  x2+t0     ;    state(tape):= reserved;
a2:  al  w1  x2        ; link tape:
     ws  w1     6      ;    w1:= tape - station;
     hs  w1  x3+s1     ;    tape ref(station):= w1;
     ac  w1  x1        ;
     hs  w1  x2+t1     ;    station ref(tape):= - w1;
     rl. w1     b32.   ;    reestablish w1;
     jl.       (b33.)  ;    goto saved return;
c16:                   ; link:   w1 = return, w2 = tape, w3 = station.
     rs. w1     b33.   ;    save return;
     jl.        a2.    ;    goto link tape;

c17:    ; link off tape entry:
; entry:   w0 = irr, w1 = irr, w2 = return, w3 = station.
; exit:    w0 = 0, w1 = undef, w2 = unch, w3 = station.
     al  w1  x3        ;    w1:= tape(station);
     ba  w1  x3+s1     ;  
     sn  w1  x3        ;    if tape already linked off then
c.-1, o56, z.          ;    (bossfault xref)
     jd        -56     ;      bossfault 56
     al  w0     0      ;    state(w1):= 0;
     rs  w0  x1+t0+t1-t1;    station(w1):= 0;
     hs  w0  x3+s1     ;    tape(station) := 0;
     jl      x2        ;    goto return;

c35:                   ; unmount tape:
; entry:   w0 = irr, w1 = irr, w2 = return, w3 = station
; exit:   w0 = undef, w1 = undef, w2 = unch, w3 = station.
     al  w1  x3        ;
     ba  w3  x3+s1     ;    w3:= tape(station);
     sn  w1  x3  ; if tape linked off then bossfault 57
c.-1, o57, z.          ;    (bossfault xref)
jd  -57  ;
     al  w0     0      ;
     hs  w0  x1+s1     ;    station ref:=
     hs  w0  x3+t1     ;    tape ref:= 0;
     bz  w1  x3+t0     ;
     wd. w1     b13.   ;
     bz. w1  x1+a4.    ;    state(w1):= remove(old state);
     hs  w1  x3+t0     ;
     rl. w3     b0.+2  ;    w3:=station;
     jl      x2        ;    goto return;

h. a4:  0,  0,  0, 30, 30,  0, 60, 70, 80, 60, 70, 80,120,130,140,150,160 w.
e.                     ;
\f


; kll 27.7.71                    boss 2, remoter,   ...36...

b. a5  w.              ;
c18:    ; remove request:
; entry:   w0 = irr, w1 = irr, w2 = return, w3 = station.
; exit:    w0 = undef, w1 = undef, w2 = undef, w3 = station.
     al  w1  x3+s10    ;    w1:= remoter operation;
     ba  w3  x3+s1     ;
     rl  w0  x3+t4     ;    w0:= request line(tape);
     sz  w0     1      ;    if not pending request then
     jl.        a1.    ;    begin
     rl. w3     b0.+2  ;      w3:= station;
     jl      x2        ;      goto return;
                       ;    end;
a1:  ws. w2     b0.    ;
     rs  w2  x3+t4     ;    request(tape) := even  (i.e. being removed);
     rs  w2  x1-s10+s6 ;    save rel return in user descr addr;
     rs  w0  x1+6      ;    save request line in operation;
     al  w0     1      ;    operation code:= remove line;
     rs  w0  x1+2      ;
     rl. w2     b78.   ;
     jl. w3    (b75.)  ;    open chained(request que, w1);

     rl  w2  x3+s14    ;    w2:= request buf;
     jl. w3    (b72.)  ;    lock(remoter buf);
     al  w0     0      ;
     ba  w3  x3+s1     ;
     se. w3    (b0.+2) ;    if tape ref(station) <> 0 then
     rs  w0  x3+t4     ;      request(tape) := 0  (i.e. free);
     rl. w3     b0.+2  ;
     rl  w2  x3+s6     ;
     jl.     x2+b0.    ;    goto save rel return + page 0;

c19:    ; name station:
; entry:   w0 = irr, w1 = irr, w2 = return
; exit:    w0 = undef, w1 = undef, w2 = undef, w3 = station.
     am        (66)    ;
     dl  w1    +74     ;    w0, w1:= max interval;
     al. w3     b1.    ;
     jd         1<11+72;    set catalog base;
     rl. w3     b0.+2  ;    w3:= station;
     bz  w1  x3+s0     ;    w1:= device;
     ba  w3  x3+s1     ;
     al  w3  x3+t8     ;    w3:= tape name(station);
     jd         1<11+6 ;    initialize process;
     jd         1<11+4 ;    w0:=lookup process;
     sn  w0     0      ;    if not exist then
     jl.        a2.    ;    goto create;
     am        (74)    ;    if nametable(device) does not
     am      x1        ;      address the same
     se  w0 (x1)       ;      process description then
     jl.        a2.    ;    goto create;
     rl. w3     b0.+2  ;    w3:= station;
     jl      x2        ;    goto return;
a2:  jd         1<11+54;    w1:=create peripheral process;
     rl  w1     0      ;
     jd         1<11+6 ;    initialize process;

     rl. w3     b0.+2  ;    w3:= station;
     se  w1     5      ;    if result = 5 or
     sn  w1     0      ;       result = 0 then
     jl      x2        ;    goto return;
     se  w1     3      ;
     sn  w1     6      ;    if result = 3 or result = 6 then
     jl.        c37.   ;    goto name illegal;
c.-1, o53, z.          ;    (bossfault xref)
     jd        -53     ;    goto boss alarm;

e.                     ;
\f


; kll 3.1.72                    boss 2, remoter,   ...37...

c20:    ; write label:
; entry:   w0 = irr, w1 = irr, w2 = return, w3 = station.
; exit:    w0 = undef, w1 = undef, w2 = undef, w3 = station.
     bz  w0  x3+s2     ;
     la. w0     b38.   ;
     se  w0     2      ;    if station state = named then
     jl      x2        ;    goto return;
     bz  w0  x3+s3     ;
     so  w0     1      ;    if no ring then
     jl.        c34.   ;    goto mount ring;
     ws. w2     b0.    ;
     rs  w2  x3+s10    ;    save relativ return;
     jl. w3     c29.   ;    reserve label write;

; project number:

; the ciffer values correspond to the label shown on page 19.
     rl  w2  x3+s4     ;    w2:= project nr;
     rl. w3     b0.+8  ;    w3:= label write;
     al  w1     0      ;
     wd. w2     b13.   ;    w1:= 5;
     ld  w1     40     ;    w0:= 5<16 or <:0  :>;
     lo. w0     b26.   ;
     rs  w0  x3+28     ;    label + 28:= w0;
     rl. w0     b24.   ;    w0:= <:000:>;
     wd. w2     b13.   ;    w1:= 9;
     lo  w0     2      ;    w0:= w0 or 9;
     al  w1     0      ;
     wd. w2     b13.   ;    w1:= 4;
     ls  w1     8      ;
     lo  w0     2      ;    w0:= w0 or 4<8;
     al  w1     0      ;
     wd. w2     b13.   ;    w1:= 0;
     ls  w1     16     ;
     lo  w0     2      ;
     rs  w0  x3+26     ;    label + 26:= w0 or 0<16;
     rl. w0     b25.   ;    w0:= <: 00:>;
     al  w1     0      ;
     wd. w2     b13.   ;    w1:= 1;
     lo  w0     2      ;    w0:= w0 or 1;
     ls  w2     8      ;
     lo  w0     4      ;
     rs  w0  x3+24     ;    label + 24:= w0 or 3<8;
\f


; kll 3.1.72                    boss 2, remoter,   ...38...

; comment tape name as on page 41.
     rl. w2     b0.+2  ;
     bz  w1  x2+s3     ;
     rl. w0  x1+b28.   ;    label + 6:= case tape kind of
     rs  w0  x3+6      ;    (<: w :>, <:   :>, <: p :>, <: r :>);
     ba  w2  x2+s1     ;
     rl  w0  x2+t8+4   ;
     jl. w1     c26.   ;    check ciffer 2;
     ls  w0     16     ;
     lo  w0  x3+6      ;    label + 6:= label + 6 or <:4  :>;
     rs  w0  x3+6      ;
     rl  w0  x2+t8+4   ;
     jl. w1     c25.   ;    check ciffer 3;
     rs. w0     b32.   ;    save 6;
     rl  w0  x2+t8+2   ;
     jl. w1     c27.   ;    check ciffer 1;
     rs. w0     b33.   ;    save 0;
     rl  w0  x2+t8+2   ;
     jl. w1     c26.   ;    check ciffer 2;
     ls  w0     8      ;
     lo. w0     b33.   ;    w0:= <: 50:>;
     ls  w0     8      ;
     lo. w0     b32.   ;    w0:= <:506:>;
     rs  w0  x3+4      ;    label + 4:= w0;
     rl  w0  x2+t8+2   ;
     jl. w1     c43.   ;    check ciffer or letter 3;
     rs. w0     b32.   ;    save 8;
     rl  w0  x2+t8     ;
     jl. w1     c41.   ;    check ciffer or letter 1;
     ls  w0     8      ;
     lo. w0     b32.   ;
     lo. w0     b36.   ;    label + 2:= <:128:>;
     rs  w0  x3+2      ;
     rl  w0  x2+t8     ;
     ls  w0    -8      ;
     se. w0    (b29.)  ;    if name + 0 shift - 8 <> <: mt:> then
     jl.        c36.   ;    goto write name syntax;
     dl  w1  x2+t8+6   ;
     ls  w0     16     ;    if rest of name <> 0 then
     sn  w0     0      ;
     se  w1     0      ;    goto write name syntax;
     jl.        c36.   ;
\f


; kll 27.7.71                    boss 2, remoter,   ...39...

b. a5  w.              ;
     rl. w3     b0.+2  ;
     al  w0    -1      ;    erase limit:= -1;
     rs  w0  x3+s12    ;
     ba  w3  x3+s1     ;
     al  w2  x3+t8     ;    w2:= tape name;
     al. w1     b10.   ;
     jl. w3    (b70.)  ;    send and wait(rewind);

a1:  jl. w2     c22.   ; write again:
     rl. w1     b0.+8  ;    erase;
     al  w2  x1+54     ;    first addr:= label write page;
     ds. w2     b7.    ;    last addr:= first addr + 54;
     bz  w0  x3+s2     ;
     ls  w0    -6      ;    output mode:= label mode;
     hs. w0     b5.+1  ;
     ba  w3  x3+s1     ;
     al  w2  x3+t8     ;    w2:= tape name;
     al. w1     b5.    ;    w1:= message;
     jl. w3    (b71.)  ;    send and wait slow(output);
     sz  w0     1<5    ;    if not exist then
     jl.        a3.    ;    goto local;
     jl. w2     c21.   ;    add stopped, word defect;
     sz. w0    (b19.)  ;    if status and hard then
     jl.        a1.    ;    goto write again;
a4:  al  w0    -1      ;
     rs  w0  x3+s12    ;    erase limit:= -1;
a2:  jl. w2     c22.   ; write tape mark:
     ba  w3  x3+s1     ;    erase;
     al  w2  x3+t8     ;    w2:= tape name;
     al. w1     b12.   ;
     jl. w3    (b70.)  ;    send and wait(write mark);
     sz. w0    (b17.)  ;    if no tape mark or
     sz. w0    (b19.)  ;    hard error then
     jl.        a2.    ;    goto write tape mark;
     rl  w2  x1+6      ;    w2:=file number from answer;
jd -1
     sh  w2     i99-1  ;    if first tape mark then 
     jl.        a4.    ;      write another tape mark;
     jl. w3     c46.   ;    rewind tape;
     rl  w3  x3+s10    ;
     wa. w3     b0.    ;    return:= saved return + page 0;
     jl.        c31.   ;    release label write;

c21: ds. w2     b33.   ; add stopped, word defect:
     dl  w2  x1+4      ;    save w1, return;
     se  w1     56     ;    if bytes transferred <> 56 then
     ba. w0     1      ;    add hard error;
     al  w1     0      ;
     wd. w2     b20.   ;    if characters transferred mod 28
     se  w1     0      ;    <> 0 then
     ba. w0     1      ;    add hard error;
     rl. w1     b32.   ;    w1:= saved w1;
     jl.       (b33.)  ;    goto saved return;

a3:  jl. w3     c31.   ; local:   release label write;
     jl. w2     c45.   ;    call local;
     jl.        c0.    ;    goto wait operation;

e.                     ;
\f


; kll 27.7.71                    boss 2, remoter,   ...40...

b. a5  w.              ;
c22: bl  w1  x3+s12    ; erase:   
     al  w1  x1+1      ;    erase:= erase limit:=
     sl  w1     5      ;    erase limit + 1;
     jl.        c33.   ;    if erase limit > 4 then
     hs  w1  x3+s12    ;    goto unwritable;
     hs  w1  x3+s12+1  ;
     sh  w1     0      ;    if erase limit < 1 then
     jl      x2        ;    goto return;
     ws. w2     b0.    ;
     rs  w2  x3+s16    ;    save relativ return;
     ba  w3  x3+s1     ;
     al  w2  x3+t8     ;    w2:= tape name(station);
     al. w1     b9.    ;
     jl. w3    (b70.)  ;    send and wait(back space block);

a1:  bl  w1  x3+s12+1  ; rep:
     al  w1  x1-1      ;
     hs  w1  x3+s12+1  ;    erase:= erase - 1;
     ba  w3  x3+s1     ;
     al  w2  x3+t8     ;    w2:= tape name;
     al. w1     b8.    ;
     jl. w3    (b70.)  ;    send and wait(erase);
     bz  w1  x3+s12+1  ;    w1:= erase;
     sl  w1     1      ;    if erase > 0 then
     jl.        a1.    ;    goto rep;
     rl  w1  x3+s16    ;
     jl.     x1+b0.    ;    goto saved relativ return + page 0;

c23:    ; exclude user:
; entry:   w0 = irr, w1 = irr, w2 = return, w3 = station.
; exit:    w0 = undef, w1 = undef, w2 = unch, w3 = station.
     rx  w2  x3+s6     ;
     dl  w1  x2+4      ;
     ds. w1     b33.   ;    move job process;
     se  w2     0      ;    because of changed microprogram conventions;
     dl  w1  x2+8      ;    name(descr addr);
     ds. w1     b35.   ;
     rx  w2  x3+s6     ;
     bz  w1  x3+s0     ;    w1:= device;
     al. w3     b32.   ;    w3:= job name;
     jd         1<11+14;    exclude user;
     rl. w3     b0.+2  ;    w3:= station;
     jl      x2        ;    goto return;

; entry:   w0 = irr, w1 = irr, w2 = return, w3 = station,
; exit:   w0 = undef, w1 = undef, w2 = undef, w3 = station.
c45: rs. w2     b3.    ; local:
     jl. w2     c17.   ;    link off tape entry;
     hs  w0  x3+s2     ;    station state:= local;
     jl.       (b3.)   ;    goto return;

e.                     ;
\f


; kll 17.11.71                    boss 2, remoter,   ...41...

 
b. a5 w.
c24:    ; input(mode):
; w3 = station, mode = x3+10.
     al. w3     c47.   ;    w3:=return
c46: rl. w2     b0.+2  ; rewind tape: w3=return
     ba  w2  x2+s1     ;    w2:=tape(station)
     al  w2  x2+t8     ;    w2:=tape name
     al. w1     b10.   ;
     jl.       (b70.)  ;    send and wait(rewind);

c47: dl  w2  x3+s12+s10-s10;    w2:= parity count;
     bz. w1  x1+b30.   ;    w1:= mode table(mode);
     sl  w2     5      ;    if parity count > 4 then
     al  w1  x1+2      ;    w1:= w1 + even;
     hs. w1     b2.+1  ;    mode(message):= w1;
     rl. w1     b0.+8  ; 
     al  w2  x1+54     ;    first addr:= page 4;
     ds. w2     b4.    ;    last addr:= first addr + 54;
     ba  w3  x3+s1     ;
     al  w2  x3+t8     ;    w2:= tape name(station);
     al. w1     b2.    ;
     jl. w3    (b71.)  ;    send and wait slow(input);
     jl. w2     c21.   ;    add stopped, word defect;
     jl.        c40.   ;    goto return;

c25: ls  w0    -8      ; check ciffer 3:
c26: ls  w0    -8      ; check ciffer 2:
c27: la. w0     b15.   ; check ciffer 1:
     sn  w0     32     ;    if char = space then
     al  w0     48     ;    char:= zero;
a1:  sh  w0     57     ;    if ciffer > 47 and
     sh  w0     47     ;    ciffer < 58 then
     jl.        4      ;    goto return;
     jl      x1        ;    if called from write then
     sh. w1     c20.   ;    goto write name syntax else
     am         c39    ;    goto unreadable;
     jl.        c36.   ;

c43: ls  w0    -8      ; check ciffer or letter 3:
c42: ls  w0    -8      ; check ciffer or letter 2:
c41: la. w0     b15.   ; check ciffer or letter 1:
     sh  w0     125    ;    if letter>125
     sh  w0     96     ;    or letter<97 then
     jl.        a1.    ;    goto check ciffer else
     jl      x1        ;    goto return;

c28: am         b84-b86; reserve label read:
c29: dl. w1     b86.   ; reserve label write:
     rl. w2    (b77.)  ;
     rs  w0  x2+14     ;    page 4:= label read or write;
     al  w2  x1        ;
     jl.       (b72.)  ;    lock(label read or write);

c30: am         b84-b86; release label read:
c31: rl. w2     b86.   ; release label write:
     al  w0     0      ;
     rl. w1    (b77.)  ;    page 4:= 0;
     rs  w0  x1+14     ;
     jl.       (b73.)  ;    open(label read or write);
e.
\f


; kll 27.7.71                    boss 2, remoter,   ...42...

b. a10  w.              ;
a0:  rl. w2     b79.   ; display(saved text addr):
     jl. w3    (b72.)  ;    lock chained(request free);
     rl  w2  x3+s10    ;    w2:= saved text addr;
     dl. w0  x2+b0.+2  ;
     ds  w0  x1+8      ;    move text part;
     dl. w0  x2+b0.+6  ;
     ds  w0  x1+12     ;    move text part;
     dl. w0  x2+b0.+10 ;
     ds  w0  x1+4      ;    move(operation, length);
     so  w3     1<1    ;    if operation = insert line then

     jl.        a1.    ;
     sz  w3     1      ;
     jl.        a1.    ;    begin
     rl. w3     b0.+2  ;
     ba  w3  x3+s1     ;
     rl. w2    (b77.)  ;      request line(tape):=
     rl  w2  x2+10     ;      virt addr request line(page 2);
     rx  w2  x3+t4     ;
     se  w2     0      ;      if old request <> 0 then
c.-1, o55, z.          ;    (bossfault xref)
     jd        -55     ;      boss fault 55;  
     sh  w0     12     ;      if length > 12 then
     jl.        a1.    ;      begin
     al  w2  x3+t8     ;        w2:= tape name;
     rl. w0     b23.   ;
     rs  w0  x1+18     ;
     dl  w0  x2+2      ;        move tape name;
     ds  w0  x1+22     ;
     dl  w0  x2+6      ;      end;
     ds  w0  x1+26     ;    end;
a1:  am.       (b0.+2) ;    w3:= device nr;
     bz  w3    +s0     ;
; test fidifut ***************
     sn  w3     0      ; if device no = 00 then
c.-1, o58, z.          ;    (bossfault xref)
     jd        -58     ;   bossfault 58
; test slut ******************
     al  w2     0      ;
     wd. w3     b13.   ;    comment convert device nr
     ls  w3     8      ;    to text form;
     lo  w3     4      ;
     lo. w3     b25.   ;
     rl. w2     b27.   ;
     ds  w3  x1+16     ;    save(on <device>);
     rl. w2     b78.   ;
     jl. w3    (b75.)  ;    open chained(request que);
     jl.        c0.    ;    goto wait;
a10=k-b0,<:labelcommand:>,2,22,<:namecommand :>,2,22
a2=k-b0,<:not wanted  :>,2,22,<:no label    :>,1<3+1<1,12
a3=k-b0,<:mount  ring :>,1<3+1<1,12,<:too bad tape:>,3,12
a4=k-b0,<:label name  :>,2,22
a5=k-b0,<:name illegal:>,2,22,a6=12
\f


; kll 27.7.71                    boss 2, remoter,   ...43...

c48: zl  w1  x3+s2     ;    (zl == bz)
     la. w1     b38.   ;    w1:= state extract 6;
     sn  w1     1      ;    if namecommand
     am         a6     ;    then nametext
     al  w0     a10    ;    else labeltext
     rs  w0  x3+s10    ;    save text addres
     jl.        a0.    ;    display(label or name-command)

c32: rl. w3     b0.+2  ; not found:
     bz  w0  x3+s3     ;    w0:= tape state;
     bz  w1  x3+s9     ;    w1:= free and standard;
     ba  w3  x3+s1     ;    w3 := tape;
     sz  w1     1      ;    tape state:= if special or
     sl  w0     2      ;    named then
     am        -10     ;    not wanted mounted named else
     al  w0     20     ;    not wanted mounted work;
     hs  w0  x3+t0     ; not wanted:
c44: al  w1     3      ;    new station state:= in use;
     rl. w3     b0.+2  ;    w3:= station;
     jl.        a8.    ;    goto display(not wanted);

c33: jl. w3     c31.   ; unwriteable:
     jl. w2     c45.   ;    call local;
     am         a6     ;    release label write;

c34: al  w0     a3     ; mount ring:
     rs  w0  x3+s10    ;    save text addr;
     al. w1     b11.   ;
     ba  w3  x3+s1     ;
     al  w2  x3+t8     ;    w2:= tape name;
     jl. w3    (b70.)  ;    send and wait(unload);
     jl.        a0.    ;    goto display(saved text addr);
c36: jl. w3     c46.   ; write name syntax: rewind tape;
     jl. w3     c31.   ;
     am         a4-a5  ;    release label write;
c37: al  w0     a5     ; name illegal:
a7:  al  w1     5      ;    new state:= unreadable;
     jl.        a9.    ;    display(<:label name  :> or <:name illegal:>);
c38: jl. w3     c46.   ; unreadable: rewind tape
     jl. w3     c30.   ;    release label read
     al  w1     5      ;    new state:= 5;
     am         a6     ;    display(<:no label    :>);
a8:  al  w0     a2     ;    display(<:not wanted  :>);
a9:  rs  w0  x3+s10    ;    save text addr;
     hs  w1  x3+s2     ;    station state:= new state;
     jl.        a0.    ;

c39=c38-c36            ;    used in check ciffer on page 16.

e.                     ;
g17=k-b0               ;    length remoter;
\f


; kll 27.7.71                    boss 2, remoter,   ...44...

; Label write page format:
;
; The fields containing i and r are not changed
; The fields containing n, k, p are set before writing every new label.
; A page called label read of the same length is used to read labels
; into.

; The content of the n and p field in the example is used in the com-
; ments to the read and write label actions.

; A tape with the following label has number 285064, is a project tape
; for project 310495.
; When it is mounted it will get the name mt285064 so that it can be
; used in an algol program after the call   open(z, 18, <:mt285064:>, 0);

g18:                   ;
     <:VOL:>           ; 0:   iii    i ISO standard
     <:128:>           ; 2:   inn
     <:506:>           ; 4:   nnn    n tape number
     <:4p :>           ; 6:   nki    k tape kind
     <:   :>           ; 8:   iii
     <:   :>           ; 10:  iii
     <:   :>           ; 12:  iii
     <:   :>           ; 14:  iii
     <:   :>           ; 16:  iii
     <:   :>           ; 18:  iii
     <:   :>           ; 20:  iii
     <:   :>           ; 22:  iii
     <: 31:>           ; 24:  ipp    p project number
     <:049:>           ; 26:  ppp
     <:5  :>           ; 28:  pii
     <:   :>           ; 30:  iii
     <:   :>           ; 32:  iii
     <:   :>           ; 34:  iii
     <:   :>           ; 36:  iii
     <:   :>           ; 38:  iii
     <:   :>           ; 40:  iii
     <:   :>           ; 42:  iii
     <:   :>           ; 44:  iii
     <:   :>           ; 46:  iii
     <:   :>           ; 48:  iii
     <:   :>           ; 50:  iii
     <:  <94>:>        ; 52:  iir    r RC standard
     <:<94><94><94>:>  ; 54:  rrr      circonflex

i.e.     ; end c, end b names
\f


; kll 17.11.71                    boss 2, rewinder,   ...45...

; The page descriptions are used as variables and contain:
;    page 1:   own description addr
;    page 3:   saved operation, device * 2
;    page 4:   relativ rewinder

b. b9, c0  w.          ;
b0:       0, r.5       ;    page descriptions
     54<12 + 0         ;    page ident: rewinder
b91:      1            ;    send and wait
b92:      5            ;    lock chained
b93:      6            ;    open chained
b4:       0, r.5       ;    tape name
          8<12, 5      ;    unload:   code <> 1
b5:       8<12, 4      ;    rewind:   code = 1
                       ;    if stations = 0 then else
b96: h. e25*e13, 19    ;    rewinder que and
b97:    e25*e13, 19 w. ;    rewinder buf;

c0:  rl. w2     b96.   ; wait operation:
     wa. w2     b0.+8  ;
     jl. w3    (b92.)  ;    lock chained(rewinder que + rel rewinder);
g24=k-b0               ; first time start:
     rl  w0  x1+2      ;
     hs  w0  x3+12     ;    page 3:= operation code;
     rl. w2     b97.   ;
     wa. w2     b0.+8  ;
     jl. w3    (b93.)  ;    open chained(rewinder buf + rel rewinder);

     bz. w1     b0.+7  ;    w1:= device * 2;
     wa  w1     74     ;
     rs. w1     b4.+8  ;    set name table addr;
     rl  w2  x1        ;
     dl  w1  x2+4      ;
     ds. w1     b4.+2  ;    move tape name;
     dl  w1  x2+8      ;
     ds. w1     b4.+6  ;

     al. w3     b4.    ;
     jd         1<11+6 ;    initialize process;

     bz. w1     b0.+6  ;    w1:= saved operation;
     se  w1     1      ;    if saved operation = 2 then
     am        -4      ;    w1:= unload else
     al. w1     b5.    ;    w1:= rewind;
     al. w2     b4.    ;    w2:= name addr;
     jl. w3    (b91.)  ;    send and wait;
     al. w3     b4.    ;
     jd         1<11+10;    release process;

     jl.        c0.    ;    goto wait operation;

g22=b0                 ;    start
g23=k-b0               ;    length

e.                     ;
\f


; kll 27.7.71                    boss 2, watchdog,   ...46...

b. a4, b20  w.         ;
b0:       0, r.5       ;    page addresses
     56<12 + 0         ;    page ident:  watchdog
b101:     1            ;    send and wait
b102:     5            ;    lock
b103:     6            ;    open chained
b105: 0, c.e25-1, r.e25, z.;    station table
b6:       e13>1        ;    semaphor descr length
b107:     0            ;    remoterque
b9:  <:remoter:>, 0, 0 ;
b110:<:clock:>, 0, 0, 0;
b11:      0, i33       ;    clock message
b15:      0            ;    operation:   chain
          3            ;                 code
b111:c. -e25, 0  z.    ;    if stations = 0 then
     h.  e13, 19  w.   ;    else watchdog buf;
b17:      0            ;    saved station

a0:  al. w1     b11.   ; wait remote:
     al. w2     b9.    ;
     jl. w3    (b101.) ;    send and wait(remoter);
     al  w2     0      ;    station:= first station;

a1:  rl. w0 (x2+b105.) ; rep:
     sn  w0     2      ;    if state(station) = unident mounted
     jl.        a3.    ;    then remote(station);
a2:  al  w2  x2+2      ;    station:= station + 1;
     sh  w2     e25*2-1;    if station <= last station then
     jl.        a1.    ;    goto rep;

     al. w1     b11.   ;
     al. w2     b110.  ;
     jl. w3    (b101.) ;    send and wait(clock);
     jl.        a0.    ;    goto wait remote;

a3:  rs. w2     b17.   ; remote(station):
     wm. w2     b6.    ;    save station;
     wa. w2     b107.  ;    w2:= remoter que(station);
     al. w1     b15.   ;    w1:= operation;
     jl. w3    (b103.) ;    open chained;
     rl. w2     b111.  ;
     jl. w3    (b102.) ;    lock(watch dog buf);

     rl. w2     b17.   ;    w2:= saved station;
     jl.        a2.    ;    return;

g19=b0                 ;    start
g20=k-b0               ;    length
g21=a0-b0              ;    rel entry
e.                     ;
\f


; kll 25.8.71                    boss 2, commandio, name, label,   ...47...

; the parameters are packed as shown by the central logic of
; commandio. the name and label actions transform the parame-
; ters to an operation and send it to the remoter given by the
; device nr parameter.

;     parameters:                        operation:

; +0
; +2
;
; +4          device nr
; +6 = value  (integer)             +0          chain
; +8                                +2          code:   name or label
; +10                               +4          answer sem
;
; +12                               +6
; +14          tape name            +8          tape name
; +16          (text)               +10
; +18                               +12
;
; +20                               +14          project number
; +22          tape kind            +16          tape kind
; +24          (text)
; +26
;
; +28          project nr
; +30 = value  (integer)
; +32
; +34


c. 31-i46              ;    if parameter space < 4 then
m. i46 must be >= 32   ;    write(i46 must be >= 32);
z.                     ;

b. a19, b5, j5  w.     ;

b0:       0, r.5       ;    page descriptions
     58<12 + 0         ;    page ident:  commandio, name label
b1:       e13          ;    sem descr length
b113:     3            ;    lock
b114:     6            ;    open chained
b115:     8            ;    page jump
b116:     0            ;    remoter que
b117:     162          ;    virt alarm print
b118:     204          ;    rel
b119:     202          ;    virt after action
b120:     203          ;    rel
g25:                   ;    start of device list
b121: h.0, c.e25-1, r.e25, z.w. ;    device list
b124:     4            ;    open
\f


; kll 3.12.71                    boss 2, commandio, name, label,   ...48...

a13: am         2      ; nrze:
a12: am         2      ; nrz:
a11: am         2      ; even:
a1:  am         1      ; label:
a2:  al  w0     1      ; name:
j1:  rl  w1  x3+236    ;    answer sem:= commandio buf;
     ds  w1  x3+10     ;    code:= name or label;

     dl  w1  x3+22     ;    w0:= tape kind on text form;
     se  w0    -1      ;    if kind param empty then
     jl.        a7.    ;    begin
     al  w1     2      ;      w1:= kind:= 2;
     al  w0     0      ;      project:= 0;
     jl.        a8.    ;    end else
a7:  ld  w1    -16     ;    begin
     se  w1     0      ;      if second char <> 0 then
     jl.        a4.    ;      goto kind error;
     al  w1    -1      ;      w1:= -1;
     sn  w0     119    ;
     al  w1     0      ;      if w0 = <:w:> then w1:= 0 else
     sn  w0     112    ;
     al  w1     4      ;      if w0 = <:p:> then w1:=4 else
     sn  w0     114    ;
     al  w1     6      ;      if w0 = <:r:> then w1:= 6;
     sn  w1    -1      ;
     jl.        a4.    ;      if w1:= -1 then goto kind error;
     rl  w0  x3+28     ;      if project param empty then
     se  w0    -1      ;      begin
     jl.        a9.    ;
     al  w0     0      ;        project:= 0;
     se  w1     0      ;        if kind <> work then goto private missing
     jl.        a10.   ;      end;
a9:  rl  w0  x3+30     ;    end;
a8:  ds  w1  x3+22     ;    set kind, project;
     al  w2     0      ;    i:= 0;

a3:  bz. w0  x2+b121.  ; rep:
     sn  w0 (x3+6)     ;    if device param = device(i) then
     jl.        a6.    ;    goto device found;
     al  w2  x2+1      ;    i:= i+1;
     sh  w2     e25-1  ;    if i <= max device index then
     jl.        a3.    ;    goto rep;
\f


; kll 24.9.72                    boss 2, commandio, name, label,   ...48.a...


     am         17-33  ; device error:
a10: am         33-18  ; project number missing:
a5:  am         18-16  ; tape used:
a4:  al  w0     16     ; kind error:
     rs  w0  x3+4      ;
     dl. w3     b118.  ;    alarm print(device error
     jl.       (b115.) ;    or kind error);

a6:  wm. w2     b1.    ; device found:
     wa. w2     b116.  ;    sem:= i * sem length + remoter que;
     rs  w2  x3+6      ;
b125=k+1
     rl  w2  x3+221    ;    beware of deadlock.
     jl. w3    (b124.) ;    open(terminal reserve);
     rl  w2  x3+6      ;    w2:=sem;
     al  w1  x3+6      ;
     jl. w3    (b114.) ;    open chained(sem, operation);
  
j2:  rl  w2  x3+236    ;
     jl. w3    (b113.) ;    lock(commandio buf);
b126=k+1
     rl  w2  x3+221    ;
     jl. w3    (b113.) ;    lock (terminal reserve);
     rl  w0  x3+8      ;   
     se  w0     0      ;    if not ok then
     jl.        a5.    ;    goto tape used;

     dl. w3     b120.  ;
     jl.       (b115.) ;    page jump(after action);

b122=j1+1, b123=j2+1
g26=b0, g27=k-b0, g28=a2-b0, g29=a1-b0
g48=a11-b0, g49=a12-b0, g50=a13-b0

e.                     ;
\f


; kll 27.7.71                    boss 2, mounter init,   ...49...

b. j25, a9  w.         ;

j1:       g15.         ;
j2:       f0.          ;
j3:       0, r.8       ;    work
j4:       0, r.3       ;    remote or rewinder op
j5:       0            ;    index in watch dog table
j6:       -1           ;    index in device list
j7:       0            ;    virt station table index
j8:       0            ;    abs station table index
j9:       0            ;    virt tape table
j12:      g1           ;    length psjob mount
j13:      0            ;    virt remoter
j14:      g17          ;    length remoter
j15:      0            ;    virt rewinder
j16:      0            ;    virt watch dog
j17:h. 60<3+e93, g24   ;    rel entry:   rewinder
j18:    7<3+e87, g21   ;                 watchdog
j19:   80<3+e94, g16 w.;                 remoter
j20:      0            ;    rel semaphor

f2:   c. -e25, 0   z.  ;    if stations = 0 then else
      h.  e12, 18      ;    descr:    watchdog
f3:   e25*e12, 18      ;              remoter
f4:   e25*e12, 18  w.  ;              rewinder

f5:       12           ;    reserve virt
f6:       13           ;    output virt
f7:       15           ;    end init
f8:       14           ;    simulate lock
f9:       24           ;    put in activ que
f10:      0            ;    external list
f12:      27           ;    carriage return
f13:h.e25*e13, 19  w.  ;    remoter buf

f1:   c. -e25          ;    if no tape stations then
     jl. w3    (f7.)   ;    goto end init;
m. no tape stations    ;
z.                     ;
     dl. w1     b97.   ;
     ds  w1  x3+b38-f0 ;    move rewinder buf, que to psjob;

     al. w1     j3.    ;    comment set name table addr
     al. w3     b110.  ;    in clock name in watch dog;
     jd         1<11+16;    send message(clock);
     jd         1<11+18;    wait answer;
     am        -2000   ;
     rl. w0     b80.+2000;    set remoter que in
     rs. w0     b107.  ;    watch dog and
     rs. w0     b116.  ;    commandio;
     al  w0     1      ;
     am        -2000   ;
     rs. w0    (b84.+2000);    label read sem:= label write sem:= 1;
     am        -2000   ;
     rs. w0    (b86.+2000);
\f


; kll 17.11.71                    boss 2, mounter init,   ...50...

     al  w0     i87    ;
     al  w1     56     ;
     jl. w3    (f5.)   ;    reserve virt label read;
     al  w2  x2+1      ;
     am        -2000   ;
     rs. w2     b83.+2000;
     jl. w3    (f5.)   ;    reserve virt label write;
     al  w2  x2+1      ;
     am        -2000   ;
     rs. w2     b85.+2000;
     al. w0     g18.   ;
     jl. w3    (f6.)   ;    output label write;

     al  w0     i82    ;
     al  w1     g6     ;
     jl. w3    (f5.)   ;    reserve virt mount table;
     al  w2  x2+1      ;
     al  w1  x2+g3     ;
     rs. w1     j9.    ;
     rs. w2     j10.   ;
     al  w1  x2+g8     ;
     rs. w1     j7.    ;    virt station index:= start station table;

     al  w0     i98    ;
     al  w1     g32    ;
     jl. w3    (f5.)   ;    reserve virt action table;
     rs. w2     j23.   ;
     rl. w3     j2.    ;
     al. w0  x3+g31-f0+j2.; 
     jl. w3    (f6.)   ;    output virt action table;

     al  w0     i83    ;
     rl. w1     j12.   ;
     jl. w3    (f5.)   ;    reserve virt psjob mount ;
     rs. w2     j11.   ;
     rl. w3     j2.    ;
     al. w0  x3+b0-f0+j2.;
     jl. w3    (f6.)   ;    output virt psjob mount;

     al  w0     i84    ;
     rl. w1     j14.   ;
     jl. w3    (f5.)   ;    reserve virt remoter;
     rs. w2     j13.   ;
     rl. w3     j1.    ;
     al. w0  x3+j1.    ;
     jl. w3    (f6.)   ;    output virt remoter;

     al  w0     i85    ;
     al  w1     g23    ;
     jl. w3    (f5.)   ;    reserve virt rewinder;
     al  w2  x2+1      ;    add writing;
     rs. w2     j15.   ;
     al. w0     g22.   ;
     jl. w3    (f6.)   ;    output virt rewinder;

     al  w0     i86    ;
     al  w1     g20    ;
     jl. w3    (f5.)   ;    reserve virt watchdog;
     al  w2  x2+1      ;
     rs. w2     j16.   ;

     al  w0     i90    ;
     al  w1     g27    ;
     jl. w3    (f5.)   ;    reserve virt name, label;
     al. w0     g26.   ;
     jl. w3    (f6.)   ;    output virt name, label;
     rs. w2     j21.   ;
\f


; kll 27.7.71                    boss 2, mounter init,   ...51...

     ld  w1    -100    ;
     al  w2  g6-2      ;
a4:  ds. w1  x2+f11.   ;    clear mount table;
     al  w2  x2-4      ;
     sl  w2     3      ;
     jl.        a4.    ;

     al. w1     f11.   ;
     al  w1  x1+g8     ; 
     rs. w1     j8.    ;    abs station index:= start station table;
     jl. w3    (f12.)  ;    carriage return;

a1:  rl. w2     j6.    ; next device:
     al  w2  x2+1      ;    w2:= index device list;
     rs. w2     j6.    ;    index:= index+1;
     sl  w2     e25    ;    if w2 > last device then
     jl.        a2.    ;    goto end devices;
     rl. w1     j8.    ;    w1:= abs station table index;
     bz. w3  x2+g25.   ;
     ls  w3     12     ;    device(w1):= device(index);
     rs  w3  x1+s0+s1-s1;
     rl. w0     j20.   ;    rel sem, standard(w1):=
     ls  w0     12     ;    rel sem + if standard
     sh  w2     e26-1  ;    station then 1 else 0;
     ba. w0     1      ;
     rs  w0  x1+s8+s9-s9;
     rl. w0     f13.   ;
     wa. w0     j20.   ;    set remoter buf
     rs  w0  x1+s14    ;    in station table;
     al  w1  x1+g2     ;    abs station table index:= w1 + length;
     rs. w1     j8.    ;

     rl. w2     j6.    ;    w2:= device index;
     bz. w3  x2+g25.   ;
     ls  w3     1      ;    w3:= device(index) * 2;
     rl. w1     f4.    ;    w1:= rewinder descr;
     rl. w0     j20.   ;    page 3:= device * 2;
     ds  w0  x1+14     ;    page 4:= rel semaphor;

     wa  w3     74     ;
     rl  w3  x3        ;
     al  w0  x3+22     ;    watch dog table(index):=
     rl. w3     j5.    ;    state addr(device);
     rs. w0  x3+b105.  ;
     al  w3  x3+2      ;    index:= index + 2;
     rs. w3     j5.    ;

     rl. w0     j15.   ;    page 0:= virt rewinder;
     ds  w1  x1+8      ;    page 1:= rewinder descr;
     rl. w0     j17.   ;
     rs  w0  x1+4      ;    rel entry rewinder;
     rl. w2     b96.   ;
     wa. w2     j20.   ;    w2:= rewinder que + rel sem;
     jl. w3    (f8.)   ;    simulate lock(w1, w2);
     al  w1  x1+e12    ;
     rs. w1     f4.    ;    rewinder descr:= rewinder descr + length;
\f


; kll 17.11.71                    boss 2, mounter init,   ...52...

     al  w0     i88    ;
     al  w1     4      ;
     jl. w3    (f5.)   ;    reserve virt rewinder op;
     al. w0     j4.    ;
     jl. w3    (f6.)   ;    output rewinder operation;
     rl. w3     b97.   ;
     wa. w3     j20.   ;    w3:= rewinder buf + rel sem;
     al  w1  x2        ;
     ds  w2  x3+4      ;    first(w3):= last(w3):= virt new op;
     al  w0     1      ;
     rs  w0  x3        ;    rewinder buf:= 1;

     rl. w1     f3.    ;
     al  w2  x1+e12    ;    w1:= remoter;
     rs. w2     f3.    ;    remoter:= remoter + length;
     rl. w0     j9.    ;
     rs  w0  x1+12     ;    page 3:= tape table;
     rl. w3     j7.    ;
     rl. w2     j13.   ;    page 0:= virt remoter;
     ds  w3  x1+8      ;    page 1:= virt station entry;
     al  w3  x3+g2     ;    virt station entry:=
     rs. w3     j7.    ;    virt station entry + length;
     rl. w0     j19.   ;
     rs  w0  x1+4      ;    rel return remoter;
     am        -1000   ;
     rl. w2     b80.+1000;    w2:= remoter que + rel sem;
     wa. w2     j20.   ;
     jl. w3    (f8.)   ;    simulate lock(w1, w2);

     rl. w1     j20.   ;
     al  w1  x1+e13    ;    rel semaphor:= rel semaphor + length;
     rs. w1     j20.   ;
     bl. w2     j17.   ;
     al  w2  x2+1<3    ;    next rewinder
     hs. w2     j17.   ;
     bl. w2     j19.   ;
     al  w2  x2+1<3    ;    next remoter
     hs. w2     j19.   ;
     jl.        a1.    ;    goto next device;
\f


;  lkn  76.05.10               mounter init.          ...53...


a2:  dl. w1     b97.   ;
     rs. w0     j22.   ;
     rs. w1     j24.   ;
     al  w1     (:g32+511:)>9 ; ext(509):=size of action table
     al  w1  x1+(:g6+511:)>9  ;          +size of mount table
     al  w1  x1+(:g1+511:)>9  ;          +length of psjob mount code
     rs. w1     j25.          ;  (length in segments)

     jl. w3    (2)     ;    set externals;
f16:            40     ;

j22:     0  ,    77    ;    rewinder buf
j24:     0  ,    59    ;    rewinder que
j21:     0  ,   296    ;    virt name, label
         g28,   297    ;    rel name
         g29,   298    ;    rel label
         g7 ,   322    ;    reserved state tape table
j23:     0  ,   311    ;    virt action table
j10:     0  ,   312    ;    virt mount table
j11:     0  ,   313    ;    virt psjob mount
         g9 ,   314    ;    rel mount special
         g10,   315    ;    rel mount ring
         g48,   487    ;    rel even on label page
         g49,   488    ;    rel nrz on label page
         g50,   489    ;    rel nrze on label page
         g11,   316    ;    rel mount tape
         g12,   317    ;    rel suspend
         g13,   318    ;    rel release
         g14,   319    ;    rel tape ready
         g30,   477    ;    rel finis mount
j25:     0  ,   509    ;    length of tables (in segments)
         0  ,  -1000   ;    end of externals
\f


;  lkn  76.05.10               mounter init           ...54...



     al  w1 i45*e13-e13;    rel sem:=
     rs. w1     j20.   ;    (psjobs - 1) * sem length;
     al  w1     1      ;    code(remote op):= 1;
     rs. w1     j4.+2  ;
     jl. w3    (f12.)  ;    carriage return;

a3:  al  w0     i89    ; rep:
     al  w1     6      ;
     jl. w3    (f5.)   ;    reserve remoter op;
     al  w2  x2+1      ;    writing;
     rl. w1     j20.   ;

     am        -1000   ;
     wa. w1   b81.+1000;    w1:= remote buf + rel sem;
     al  w0     1      ;
     rs  w0  x1        ;    sem(w1):= 1;
     al  w3  x2        ;
     ds  w3  x1+4      ;    first(w1):= last(w1):= virt remote op;
     rs. w1     j4.+4  ;    sem(remote op):= w1;
     al  w1     6      ;
     al. w0     j4.    ;
     jl. w3    (f6.)   ;    output virt(remote op);

     rl. w1     j20.   ;
     al  w1  x1-e13    ;
     rs. w1     j20.   ;    rel sem:= rel sem - 1;
     sl  w1     0      ;    if rel sem >= 0 then
     jl.        a3.    ;    goto rep;
     jl. w3    (f12.)  ;    carriage return;

     al. w0     g19.   ;
     al  w1     g20    ;
     rl. w2     j16.   ;
     jl. w3    (f6.)   ;    output virt(watch dog);
     rl. w1     f2.    ;
     rs  w2  x1+6      ;    page 0:= virt watch dog;
     rl. w0     j18.   ;
     rs  w0  x1+4      ;    rel entry;
     jl. w3    (f9.)   ;    put in active que(w1);

     al. w0     f11.   ;
     al  w1     g6     ;
     rl. w2     j10.   ;
     jl. w3    (f6.)   ;    output mount table;
\f


; kll 17.11.71                    boss 2, mounter init,   ...55...


     rl. w1     a7.    ;    next:= w0;
a0:  bz. w1  x1+g25.   ; unload next:
     al. w3     j3.    ;    w3:= ref name;
     al  w0     0      ;    w1:= device(next);
     rs  w0  x3        ;    name:= 0;
     jd         1<11+54;    create peripheral process;
     jd         1<11+6 ;    initialize process;
     al. w1     a6.    ;
     jd         1<11+16;    send message (unload);
     al. w1     j3.    ;
     jd         1<11+18;    wait answer;
     rl. w1     a7.    ; 
     al  w1  x1+1      ;    next:= next + 1;
     rs. w1     a7.    ;
     sh  w1     e25-1  ;    if next < stations then
     jl.        a0.    ;    goto unload next;

     jl.       (f7.)   ;    goto end init;

a6:  8<12, 5           ;    unload message
a7:  0                 ;    next

; the station list in options is a byte list containing the device
; numbers of the stations. during slang translation this list is
; copied to the binary mounter segment by j.code. during initiali-
; sation this is transformed to a list of state addresses for the
; stations and placed in a table on page 0 of the watch dog. the
; list is also used to initialise the device numbers in the station
; part of the mount table.
f11:      0, 0         ;    mount table

b. a2  w.              ; j.code:

a0:  rl  w1  x2        ;    reduce segment
     al  w1  x1+a2     ;    with length of
     rs  w1  x2        ;    j.code;
c. e25-1

     al  w1     e25-1  ;
a1:  am.       (j2.)   ; rep:
     bz. w0  x1+e24-f0+j2.;
     hs. w0  x1+g25.   ;    move station list
     al  w1  x1-1      ;    from options to
     sl  w1     0      ;    binary name, label segment;
     jl.        a1.    ;
z.

     al  w0     0      ;
     al  w2     0      ;
     jl      x3        ;    return to slang;

     jl.        a0.    ;    goto j.code;

a2=a0-k                ;    length of j.code;

j.e.                   ;    jump;
e.                     ;    end j-names;
i.e.                   ;
f14=s0, f15=s1 ; final chacksums
i.e.                   ;    end g and f-names;
e. e.                  ;    end options, tmount;

▶EOF◀