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

⟦f9bc0c076⟧ TextFile

    Length: 63744 (0xf900)
    Types: TextFile
    Names: »monhost«

Derivation

└─⟦621cfb9a2⟧ Bits:30002817 RC8000 Dump tape fra HCØ.  Detaljer om "HC8000" projekt.
    └─⟦0364f57e3⟧ 
        └─⟦3b463a713⟧ »kkmon1filer« 
            └─⟦this⟧ 

TextFile

\f


m.                monhost - host process drivers

b.i30 w.
i0=81 04 27, i1=12 00 00

; if newtime (i0,i1) > oldtime (a133,a134) then oldtime:=newtime;
c.i0-a133
  c.i0-a133-1, a133=i0, a134=i1, z.
  c.i1-a134-1,          a134=i1, z.
z.

i10=i0, i20=i1

i15=i10/100000 , i10=i10-i15*100000 , i25=i20/100000 , i20=i20-i25*100000 
i14=i10/10000  , i10=i10-i14*10000  , i24=i20/10000  , i20=i20-i24*10000 
i13=i10/1000   , i10=i10-i13*1000   , i23=i20/1000   , i20=i20-i23*1000
i12=i10/100    , i10=i10-i12*100    , i22=i20/100    , i20=i20-i22*100
i11=i10/10     , i10=i10-i11*10     , i21=i20/10     , i20=i20-i21*10

i2:  <:                              date  :>
     (:i15+48:)<16+(:i14+48:)<8+46
     (:i13+48:)<16+(:i12+48:)<8+46
     (:i11+48:)<16+(:i10+48:)<8+32

     (:i25+48:)<16+(:i24+48:)<8+46
     (:i23+48:)<16+(:i22+48:)<8+46
     (:i21+48:)<16+(:i20+48:)<8+ 0

i3:  al. w0  i2.       ; write date:
     rs  w0  x2+0      ;   first free:=start(text);
     al  w2  0         ;
     jl      x3        ;   return to slang(status ok);

     jl.     i3.       ;
e.
j.



; block containing host - and subprocess drivers.

b.u100 w.

c.-p103
p301=p71
p302=p72
p303=p73
p321=p91
p322=p92
p323=p93
z.

; block containing host and subhost drivers.

b.s120 w.

; host process.

b.i10,j10 w.

; format of the process description:

m.                host


; a48:                 ; <interval>
; a49:                 ; <interval>
; a10:                 ; <kind>=90
; a11:                 ; <name>=<:host:>
; a50:                 ; <dummy>
; a52:                 ; <dummy>
; a53:                 ; <dummy>
; a54:                 ; <next message>
; a55:                 ; <last message>
; a56:                 ; <dummy>
\f



; format of message and answer:

s0=8      , s1=s0+1    ; operation  , mode
s2=s0+2                ; first addr(buffer)
s3=s2+2                ; last addr(buffer)
s4=s3+2   , s5=s4+1    ; dh.linkno  , hostno
s6=s4+2                ; dh.host-id
s7=s6+2   , s8=s7+1    ; dh.home-reg, dh.net-id
s9=s7+2                ; jh.host-id
s10=s9+2  , s11=s10+1  ; jh.linkno  , jh.net-id

s31=22                 ; size of datas used in connection with operation=1

; the host-driver accepts the following operations and modes:

;  operation  mode    header-func     name
;      1      5             9         lookup process
;      1      6,7          13         lookup
;      1      8,9          17         lookup reserve
;      1      10,21        11         cancel reservation
;      1      12,13        25         linkup remote
;      1      14,15        29         linkup local
;      1      16,17        32         lookup link
;      2      0,1           8         release link
;      9      0,1,2,3      45         operator output
;     11      0,1,2,3      41         operator output-input
;                           2         create
;                           6         remove
\f



a0=1<23
i0:  a0>0+a0>1+a0>2+a0>9+a0>11
i1:  a0>5+a0>6+a0>7+a0>8+a0>9+a0>10+a0>11+a0>12+a0>13+a0>14+a0>15+a0>16+a0>17
i2:  a0>0+a0>1
i3:  a0>0+a0>1+a0>2+a0>3

h90: bz  w0  x2+s0     ; host process:
     rl. w1  i1.       ;
     sn  w0  2         ;   mode mask:=mode mask(operation);
     rl. w1  i2.       ;
     se  w0  16        ;
     sl  w0  3         ;
     rl. w1  i3.       ;
     rl. w0  i0.       ;
     jl  w3  g16       ;   check operation(operation mask, mode mask);

; check host-addr.
     rl  w0  x2+s1     ;
     so  w0  2.1       ;   if address mode=1 then
     jl.     j1.       ;    begin
     la  w0  g50       ;     address mode:=0;
     rs  w0  x2+s1     ;
     rl  w3  x2+s4     ;     sub:=proc desc addr(mess);
     rl  w1  b4        ;
     al  w1  x1-2      ;
j0:  al  w1  x1+2      ;   if sub is not included in device part of nametable then
     sl  w1 (b5)       ;     goto result 3;
     jl      g5        ;
     se  w3 (x1)       ;
     jl.     j0.       ;
     rl  w0  x3+a10    ;
     la  w0  g50       ;
     se  w0  p112      ;   if kind(sub)<>local or remote process then
     jl      g5        ;     goto result3;
     rl  w0  x3+a50    ;   if main(sub)=0 then
     sn  w0  0         ;     goto free sub;
     jl.     j4.       ;
     bz  w0  x3+p11    ;
     hs  w0  x2+s4     ;     dh.linkno:=dh.linkno(sub);
     rl  w0  x3+p5     ;
     rs  w0  x2+s6     ;     dh.host-id:=dh.host-id(sub);
     bz  w0  x3+p6     ;
     hs  w0  x2+s7     ;     dh.home-reg:=dh.home-reg(sub);
     bz  w0  x3+p7     ;
     hs  w0  x2+s8     ;     dh.net-id:=dh.net-id(sub);
     bz  w0  x3+p9     ;
     hs  w0  x2+s10    ;     jh.linkno:=jh.linkno(sub);
     rl  w1  x3+a50    ;
     rl  w0  x1+p202+p5;
     rs  w0  x2+s9     ;     jh.host-id:=jh.host-id(subhost);
     bz  w0  x1+p202+p7;
     hs  w0  x2+s11    ;     jh.net-id:=jh.net-id(sender host);
     bz  w0  x1+p202+p9;
     hs  w0  x2+s5     ;     hostno:=rcno(subhost(main(sub)));
                       ;    end;

; this block transfers the operation and mode of the message
; into a function mode of the format:
;    fmode:=header function<2+header mode.
j1:  bz  w0  x2+s0     ;
     se  w0  1         ;   if operation=1 then
     jl.     j2.       ;    begin
     bz  w3  x2+s1     ;     if mode(mess)<>32 then
     ls  w3  1         ;
     se  w3  32        ;       header function:=(mode(mess)+1)<1;
     al  w3  x3+1      ;     else
     ls  w3  2         ;       header function:=mode(mess)<1;
     rl  w0  x2+s3     ;
     ws  w0  x2+s2     ;   if size(data)<std data buffer size then
     sh  w0  s31-2-1   ;     goto result 3;
     jl      g5        ;    end;
     jl.     j3.       ;
j2:  al  w3  8<2       ;   if operation=2 then
     sn  w0  2         ;     header function:=8;
     jl.     j3.       ;
     sn  w0  9         ;   if operation=9 then
     al  w3  45<2      ;     header function:=45;
     sn  w0  11        ;   if operation=11 then
     al  w3  41<2      ;     header function:=41;
     bz  w0  x2+s1     ;
     se  w0  0         ;   if mode<>0 then
     al  w3  x3+1      ;     header mode:=1;
j3:  hs  w3  x2+s1     ;

; call subhost.
     bz  w3  x2+s5     ;   subhost:=
     ls  w3  1         ;     word(hostno<1+start(name table));
     wa  w3  b4        ;
     sl  w3 (b5)       ;   if host process outside name table then
     jl      g5        ;     goto result3;
     rl  w3  x3        ;
     rl  w0  x3+a10    ;
     se  w0  p111      ;   if kind(subhost)<>subhost kind then
     jl      g5        ;     goto result 3;
     rs  w3  b19       ;   current process:=subhost;
c.-p103
     jl.     h34.      ;   goto subhost-driver;
z.
c.p103-1
     jl.     h82.      ;   goto subhost-driver;
z.

j4:  rl  w0  x2+s0     ; free sub:
     se. w0 (i10.)     ;   if operation<>lookup process then
     jl      g5        ;     goto result3;
     ld  w0  -100      ;
     rs  w0  g20       ;
     ds  w0  g22       ;   status, bytes trf:=0,0;
     jl      g7        ;   goto result1;

i10: 1<12+2<1          ;

e.                     ; end host process.
\f


; subhost process.

; block including the host-process driver.

b.n130,q10,r40,t10 w.

m.                subhost

; a48:                 ; <interval>
; a49:                 ; <interval>
; a10:                 ; <kind>
; a11:                 ; <name>
; a50:                 ; <mainproc>
; a52:                 ; <reserver>
; a53:                 ; <users>
; a54:                 ; <next message>
; a55:                 ; <last message>
; a56:                 ; <external state>

; p0: start of specific part:
s40=p0                 ; mess buffer
; p1: top of specific part;

; p11: , p9 :          ; <devno> , <rcno>
; p10: , p8 :          ; <subkind=-2> , <various>
; p12:                 ; <state>
; p14:                 ; <next subproc>
; p15:                 ; <last subproc>
; p16: , p17:          ; <buffers free> , <current bufno>
; p18:                 ; <max bufsize=24>
; p7 : , p6 :          ; <net-id(subhost)> , <home reg(subhost)>
; p5 :                 ; <host-id(subhost)>
; p13:                 ; <current message>
; p19:                 ; start(mess buf table):         
;  p19+v3<1            ; top(mess buf table).

s100=p19+v3<1          ; start of output buffer:
s101=20                ;   size of output buffer
s102=s100+s101         ; start of input buffer:
s103=s101              ;   size of input buffer
\f




h99: q0                ; deliver message
     q1                ; transfer operation
     q2                ; end transfer
     q3                ; receive operation
     q4                ; end receive
;    q5                ; initiate process


; answers to create and remove operations are stored in a message buffer
; (claims are borrowed from the subprocess). the message buffers are queued
; up in the event queue until the answer can be transmitted.
; format of the save-buffer:
s16=8     , s17=s16+1  ;  -1          , header function<2
s18=s16+2 , s19=s18+1  ;  dh.linkno   , jh.linkno
s20=s18+2 , s21=s20+1  ;  bufno       , result
s22=s20+2 , s23=s22+1  ;  unused      , quality mask
s24=s22+2 , s25=s24+1  ;  jh.net-id   , jh.home-reg
s26=s24+2              ;  jh.host-id
s28=s26+2 , s29=s28+1  ;  state       , unused
s30=s28+2              ;  mode


r0:                    ; internal output buffer.
h. r1:  0 ,  r2:  0    ;   mode      , kind
   r3:  0 ,  r4:  0    ;   timeout   , buffers
w. r5:  0              ;   buffersize
   r6:  0 , r.4        ;   devicename
   r7:  0              ;   jh. linkno
   r8:  0              ;   jh. host-id
h. r9:  0 , r10: 0     ;   jh. home-reg, jh. net-id
w. r11: 0              ;   proc desc

r20:                   ; internal input buffer.
   r22: 0              ;   kind
   r24: 0              ;   max. buffers
   r25: 0              ;   max. buffersize
   r26: 0 , r.4        ;   devicename
   r27: 0              ;   jh. linkno
   r28: 0              ;   jh. host-id
h. r29: 0 , r30: 0     ;   jh. home-reg, jh. net-id
w. r31: 0              ;   process description

   r32: 0              ;   dh. linkno
\f


; entry0.

b.i10,j10 w.

q0:                    ; entry0:
     rl  w2  b18       ;
     rl  w1  x2+6      ;   proc:=sender(mess);
      
     jl  w3  g14       ;   check user;
     rl  w1  b19       ;
c.p101 b.f1 w.         ;*****test72*****
     rs. w3  f0.       ;
     jl. w3  f4.       ;
     72                ;
f0:  0                 ;
     jl.     f1.       ;
     al  w0  x2+8      ;   dump contents of mess buffer
     al  w1  x2+22     ;
     jl. w3  f5.       ;
f1:                    ;
e.z.                   ;*****test72*****
     bz  w0  x2+s1     ;
     sn  w0  9<2       ;   if fmode=9<2 then
     jl.     j0.       ;     goto lookup-process;
     jl. w3  n20.      ;   link operation;
     jl. w3  n21.      ;   testready and link;
     jl     (b101)     ; exit0: return to main;

; lookup process.
; lookup process delivers an answer equal to the one described in xxx and
; an input data buffer of the format-
;
;    +0  kind
;    +2  buffers
;    +4  max. buffersize
;    +6  name of the external process
;    +14 jh. linkno(=logical devicenumber)
;    +16 jh. host-id (=sender host)
;    +18 jh. home-reg, jh. net-id
;    +20 process description(external process)

j0:  bz  w3  x2+s10    ; lookup process:
     rs. w3  r27.      ;   jh.linkno:=jh.linkno(mess);
     ls  w3  1         ;
     wa  w3  b4        ;
     rl  w3  x3        ;   sub:=sub(rcno);
     bl  w0  x3+p10    ;
     rs. w0  r22.      ;   kind:=subkind(sub);
     sn  w0  -2        ;
     am      v3<1-v0<1 ;   if sub=subhost then
     am      v0<1      ;     number of message entries:=v3
     al  w0  x3+p19    ;   else
     rs. w0  i0.       ;     number of message entries:=v1;
     al  w1  x3+p19    ;   max. buffers:=buffers free(sub);
     al  w0  0         ;   for entry=first message entry step 1 until last entry do
     bl  w2  x3+p16    ;     if entry used(<>0) then
j1:  se  w0 (x1)       ;       number of buffers:=number of buffers+1;
     al  w2  x2+1      ;
     al  w1  x1+2      ;
     se. w1 (i0.)      ;
     jl.     j1.       ;
     rs. w2  r24.      ;   max. buffers:=number of buffers;
     rl  w0  x3+p18    ;
     ls  w0  -1        ;
     wa  w0  x3+p18    ;
     rs. w0  r25.      ;   max. buffersize:=max. buffersize(sub)//2*3;
     dl  w1  x3+a11+2  ;
     ds. w1  r26.+2    ;   name of external process:=process name(sub);
     dl  w1  x3+a11+6  ;
     ds. w1  r26.+6    ;
     rl  w1  b19       ;
     rl  w0  x1+p5     ;
     rs. w0  r28.      ;   jh. host-id:=host-id(subhost);
     rl  w0  x1+p6     ;
     hs. w0  r29.      ;   jh. home-reg:=home-reg(subhost);
     rl  w0  x1+p7     ;
     hs. w0  r30.      ;   jh. net-id:=net-id(subhost);
     rs. w3  r31.      ;   process description:=sub;
c.p101 b.f1 w.         ;*****test73*****
     rs. w3  f0.       ;
     jl. w3  f4.       ;
     73                ;
f0:  0                 ;
     jl.     f1.       ;
     al. w0  r20.      ;
     al. w1  r32.      ;   dump contents of input area
     jl. w3  f5.       ;
f1:                    ;
e.z.                   ;*****test73*****
     rl  w2  b18       ;
     jl. w3  n1.       ;   deliver data(mess);
     am      0         ;    sender stopped: impossible;
     rl. w0 (r31.)     ;   if kind(sub)=remote subkind then
     sn  w0  p112      ;     link desc:=1
     am      2-1       ;   else
     al  w0  1         ;     link desc:=2;
     ls  w0  12        ;
     rs  w0  x2+s1     ;   return value:=ok;
     al  w3  s31       ;
     al  w0  s31>1*3   ;   bytes trf(mess), chars trf(mess):=std buffer size;
j4:  ds  w0  x2+s3     ;
     jl. w3  n19.      ; deliver:  deliver answer(ok,mess);
     jl     (b101)     ; exit: return to main;

i0:  0                 ;

e.                     ; end of entry0;
\f


; entry1.

b.i10,j10,m20 w.

q1:  jl. w3 (i2.)      ; entry1: find first unprocessed message;
c.p101 b.f1 w.         ;****test74*****
     rs. w3  f0.       ;
     jl. w3  f4.       ;
     74                ;
f0:  0                 ;
     jl.     f1.       ;
     al  w0  x2        ;   dump contents of mess
     sn  w2  0         ;   if no mess then
     al  w0  x2+24     ;     no record
     al  w1  x2+22     ;
     jl. w3  f5.       ;
f1:                    ;
e.z.                   ;*****test74*****
     sn  w2  0         ;   if message queue empty then
     jl.    (i1.)      ;     goto no block;
     rs  w2  x1+s40    ;   current buffer:=mess;
     bz  w3  x2+s1     ;
     ls  w3  -2-1      ;   function:=fmode>2;
     jl.    (x3+i0.)   ;   goto case function of

i0:  m0                ;    ( 0-3   : create,
     m0                ;      4-7   : remove,
     m2                ;      8-11  : release link,
     m3                ;      12-15 : lookup,
     m3                ;      16-19 : lookup reserve,
     m3                ;      20-23 : cancel reservation,
     m6                ;      24-27 : linkup remote,
     m7                ;      28-31 : linkup local,
     m2                ;      32-35 : lookup link,
     -1                ;      36-39 : unused,
     m10               ;      40-43 : operator output/input,
     m10               ;      44-47 : operator output);

i1:  u3                ;
i2:  u12               ;

; create.
; remove.
;
m0:  rl  w3  x1+a50    ; create:
     bz  w0  x2+s1     ;
     ls  w0  -2        ;
     hs  w0  x3+p61    ; function(trm):=function( m buff)
     bz  w0  x2+10     ;
     hs  w0  x3+p69    ; receiver linkno(trm):=devno( m buff)
     bz  w0  x2+11     ;
     hs  w0  x3+p78    ; sender linkno(trm):=rcno( m buff)
     bz  w0  x2+12     ;
     hs  w0  x3+p68    ; bufno(trm):=bufno( m buff)
     bz  w0  x2+13     ;
     rs  w0  x3+p64    ; size(trm):= result( m buff)
     bz  w0  x2+20     ;
c.p103-1
     hs  w0  x3+p62    ;   state(rec):=state(mess);
     rl  w0  x2+22     ;   status(rec):=mode(mess);
     rs  w0  x3+p63    ;
z.
c.-p103
     hs  w0  x3+p74    ; various(trm):= quality mask( m buff )
z.
     rl  w0  x2+16     ; receiver net-id, home reg(trm):=
     rs  w0  x3+p301   ;        answer add1( m buff)
     rl  w0  x2+18     ; receiver host-id(trm):=
     rs  w0  x3+p303   ;        answer add2( m buff)
     jl      (b101)    ; return to main

; release.
; lookup link.
;
m2:  jl. w3  n4.       ; release: setup header1;
     jl     (b101)     ; exit: return;

; lookup.
; lookup reserve.
; cancel reservation.
;
m3:  jl. w3  n0.       ; lookup: get data buffer(mess);
     jl.     m16.      ;   sender stopped: goto stopped sender;
     ld  w0  -100      ;   ok:
     ds. w0  r8.       ;   value(unused fields):=0;
     rs. w0  r10.      ;
     jl.     j0.       ;   goto deliver;

; linkup remote.
;
m6:  jl. w3  n0.       ; linkup remote: get data buffer(mess);
     jl.     m16.      ;    sender stopped: goto stopped sender;
     al  w0  0         ;    ok:
     rs. w0  r7.       ;   jh.linkno:=0;
     se. w0 (r8.)      ;   if host-id=0 then
     jl.     j0.       ;     host-addr:=host-addr(subhost);
     rl  w0  x1+p5     ;
     rs. w0  r8.       ;
     bz  w0  x1+p6     ;
     hs. w0  r9.       ;
     bz  w0  x1+p7     ;
     hs. w0  r10.      ;
j0:  jl. w3  n2.       ; deliver:   check and packin(data);
     jl.     m17.      ;    error: goto parameter error;
j1:  jl. w3  n5.       ; setup: setup header2;
c.p101 b.f1 w.         ;*****test75*****
     rs. w3  f0.       ;
     jl. w3  f4.       ;
     75                ;
f0:  0                 ;
     jl.     f1.       ;
     al  w0  x1+s100   ;   dump output buffer
     al  w1  x1+s100+s101-2
     jl. w3  f5.       ;
f1:                    ;
e.z.                   ;*****test75*****
     jl     (b101)     ; exit: return;

; linkup local.
;
m7:  jl. w3  n0.       ; linkup local: get data buffer(mess);
     jl.     m16.      ;    sender stopped: goto stopped sender;
     rl  w0  x1+p5     ;    ok:
     rs. w0  r8.       ;   host-addr:=host-addr(subhost);
     bz  w0  x1+p6     ;
     hs. w0  r9.       ;
     bz  w0  x1+p7     ;
     hs. w0  r10.      ;
     jl. w3  n2.       ;   check and packin(data);
     jl.     m17.      ;    error: goto parameter error;
     rl. w2  r7.       ;    ok:
     am     (b18)      ;
     hs  w2  +s10      ;   jh.linkno(mess):=jh.linkno(data);
     ls  w2  1         ;
     wa  w2  b4        ;
     rl  w2  x2        ;   sub:=proc(jh. linkno);
     rs. w2  r11.      ;   process desc:=proc desc(sub);
     rl  w0  x2+a10    ;
     rl  w3  x2+a50    ;   if kind(sub)<>free subprocess
     sn  w0  p113      ;   or main(sub)<>0 then
     se  w3  0         ;     goto no resources;
     jl.     m15.      ;
     jl. w3  n25.      ;   create subprocess(sub,host);
     rl  w2  b18       ;
     rl. w3  r11.      ;
     rl  w0  x2+s6     ;
     rs  w0  x3+p5     ;   host-id(sub):=dh.host-id(mess);
     bz  w0  x2+s7     ;
     hs  w0  x3+p6     ;   home-reg(sub):=dh.home-reg(mess);
     bz  w0  x2+s8     ;
     hs  w0  x3+p7     ;   net-id(sub):=dh.net-id(mess);
     jl.     j1.       ;   goto setup;

; operator output.
; operator output-input.
;
m10:                   ; operator output:
     bz  w0  x2+s1     ;
     so  w0  2.1       ;   if function mode(mess)=1 then
     jl.     j2.       ;
     al  w0  0         ;
     hs  w0  x2+s4     ;     dh.linkno:=0;
     hs  w0  x2+s10    ;     jh.linkno:=0;
j2:  jl  w3  g34       ;   examine sender(mess);
     jl.     m16.      ;    sender stopped: goto stopped sender;
     jl  w3  g31       ;   increase stopcount(sender);
     jl. w3  n6.       ;   setup header3;
     jl     (b101)     ; exit: return to main;


; no resources in job host.
m15:                   ; no resources:
     rl  w2  b18       ;
     jl. w3  n14.      ;   return noresources answer;
     jl.     q1.       ;   goto entry1;


; stopped sender.
m16: rl  w2  b18       ; stopped sender:
     jl. w3  n12.      ;   return stopped answer;
     jl.     q1.       ;   goto entry1;

; parameter error in data.
m17: al  w0  3         ; parameter error: result:=3;
     jl  w3  g19       ;   deliver result;
     jl.     q1.       ;   goto entry1;

e.                     ; end of entry1;

\f




; entry2.

b.i5,j5 w.

q2:                    ; entry2:
     al  w0  0         ;
     rs  w0  x1+p13    ;   current message:=0;
     jl. w3 (i0.)      ;   test after header and data transmitted;
     jl.     j1.       ;    goto error;
                       ;    ok:
     rl  w2  x1+s40    ;
     bz  w0  x2+s1     ;
     so  w0  2.10<2    ;   if type(header)<>answer then
     jl.     j0.       ;     goto test next;
     rs  w2  b18       ; answer type:
     am     (x1+a50)   ;
     bz  w0  +p60      ;
     sn  w0  p161      ;   if int status=wait then
     rs  w2  x1+p13    ;    current mess:=mess;
     se  w0  p161      ;   else
     jl. w3  n27.      ;     release buffer;
     jl.     j0.       ;   goto test next;
j1:  rl  w2  x1+s40    ;   mess:= current mess;
     am      (x1+a50)  ;
     bz  w0  +p61      ;   function:= function(trm);
     se  w0  29        ;   if function = linkup local then
     jl.     j0.       ;   begin
     bz  w2  x2+s10    ;     jh.linkno:= jh.linkno(mess);
     ls  w2  1         ;
     wa  w2  b4        ;     proc:= name table(jh.linkno);
     rl  w2  x2        ; 
     jl. w3  n24.      ;     remove subprocess(proc);
                       ;   end;
j0:                    ; test next:
c.p101 b.f1 w.         ;*****test76*****
     rs. w3  f0.       ; 
     jl. w3  f4.       ;
     76                ;
f0:  0                 ;
     jl.     f1.       ;
     al  w0  x1        ;
     al  w1  x1+p19+4  ;
     jl. w3  f5.       ;
f1:                    ;
e.z.                   ;*****test76*****
     jl. w3  u12.      ;   find first unprocessed message;
     se  w2  0         ;   if mess<>0 then
     jl. w3  n21.      ;     testready and link;
     jl     (b101)     ; exit2: return;

i0:  u40               ;

e.
\f




; entry3.

b.j10,i10 w.
q3:  jl. w3  n9.       ; entry3: get mess(bufno);
c.p101 b.f1 w.         ;*****test80*****
     rs. w3  f0.       ;
     jl. w3  f4.       ;
     80                ;
f0:  0                 ;
     jl.     f1.       ;
     al  w0  x2+0      ;   dump contents of mess
     al  w1  x2+22     ;
     jl. w3  f5.       ;
f1:                    ;
e.z.                   ;*****test80*****
     rl  w3  x1+a50    ; 
     bz  w0  x3+p99    ;
     sn  w0  3         ;   if local function=reject then
     jl.     j3.       ;     goto rejected;
     bz  w0  x3+p81    ;
     se  w0  v23+1     ;   if function<>operator output-input then
     jl.     j1.       ;     goto lookup;
     jl. w3 (i0.)      ; operator output-input: test and increase stopcount;
     jl.     j0.       ;    error: goto setskip;
     rl  w3  x1+a50    ;    ok:
     rl  w0  x2+s2     ;   first:=first(mess);
     rs  w0  x3+p85    ;
c.-p103
     rl  w0  x2+s3     ;   last:=last(mess);
     rs  w0  x3+p86    ;   count:=0;
z.
c.p103-1
     al  w0  0         ;
     hs  w0  x3+p92    ;   address code:=sender area;
c. p103-1
     rs  w2  x3+p91      ; message buffer(main):= message
z.
z.
     jl.     j2.       ;   goto setok;

j3:                    ; rejected:
     bz  w0  x3+p81    ;
     se  w0  8         ;   if operation(rec)=release link
     sn  w0  29        ;   or operation(rec)=linkup local then
     jl. w3  n22.      ;     check and remove;
     jl. w3  n9.       ;   get mess buffer;
     al  w0  0         ;   bytes tranferred:=0;
     jl. w3  n11.      ;   return answer(bytes trf);

j0:  al  w0  p162      ; setskip:
     am     (x1+a50)   ;   internal status:=skip;
     hs  w0  +p80      ;
     jl. w3  u12.      ;   find first message;
     se  w2  0         ;   if mess<>0 then
     jl. w3  n21.      ;     testready and link;
     jl     (b101)     ; exit: return to main;

j1:                    ; lookup:
     al  w0  x1+s102   ;
     rs  w0  x3+p85    ;   first:=first(std input buffer);
c.-p103
     al  w0  x1+s102+s101-2
     rs  w0  x3+p86    ;   last:=first+size;
     al  w0  0         ;
     hs  w0  x3+p87    ;   charcount:=0;
z.
c.p103-1
     al  w0  s101>1*3  ;
     rs  w0  x3+p86    ;   size(rec):=std data size;
c. p103-1
     al  w0  0         ; messagebuf(main):= 0  (no buf.)
     rs  w0  x3+p91    ;
z.
     al  w0  8         ;
     hs  w0  x3+p92    ;   address code:=dirty;
z.

j2:  al  w0  p160      ; setok:
     am     (x1+a50)   ;
     hs  w0  +p80      ;   internal status:=ok;
     jl     (b101)     ; exit: return;

i0:  u21               ;

e.                     ; end of entry3;

\f


; entry 4.

b.i10,j20,m20 w.

q4:                    ; entry4:
     am     (x1+a50)   ;
     bz  w3  +p81      ;
c.p101 b.f1 w.         ;*****test84*****
     rs. w3  f0.       ;
     jl. w3  f4.       ;
     84                ;
f0:  0                 ;
     jl.     f1.       ;
     rl  w3  x1+a50    ;
     al  w0  x3+p80    ;   dump param area(rec)
     al  w1  x3+p90    ;
     jl. w3  f5.       ;
f1:                    ;
e.z.                   ;*****test84*****
     ls  w3  -1        ;
     jl.    (x3+i0.)   ;   goto case function of

i0:  m0                ;     (  0-3   : create,
     m1                ;        4-7   : remove,
     m2                ;        8-11  : release,
     m3                ;        12-15 : lookup,
     m3                ;        16-19 : lookup reserve,
     m3                ;        20-23 : cancel reservation,
     m6                ;        24-27 : linkup remote,
     m7                ;        28-31 : linkup local,
     m3                ;        32-35 : lookup link,
     -1                ;        36-39 : unused,
     m10               ;        40-43 : operator output-input,
     m11               ;        44-47 : operator output);


; create.
;
b.i10,j20 w.
m0:  jl. w3  n26.      ; create: get free buffer;
   
; initialize selected message buffer
     al  w0  -1        ;
     hs  w0  x2+8      ;
     al  w0  v32<2     ;
     hs  w0  x2+9      ;   mess(0):=-1,function;
c.-p103
     bz  w0  x3+p94    ;
     hs  w0  x2+15     ;   quality mask:=various
z.
c.p103-1
     bz  w0  x3+p82    ;
     hs  w0  x2+20     ;   state(mess):=state(rec);
     rl  w0  x3+p83    ;
     rs  w0  x2+22     ;   mode(mess):=mode(rec);
z.
     bz  w0  x3+p98    ;
     hs  w0  x2+10     ; devno(m buf):=sender lnkno(rec)
     rs. w0  i3.       ; save dh.linkno
     rl  w0  x3+p321   ; answer add1(m buf):=
     rs  w0  x2+16     ;    sender net-id, sender home reg
     rl  w0  x3+p323   ;  answer add2(m buf):=
     rs  w0  x2+18     ;      sender host-id
     rs. w0  i4.       ; save dh.id
; find free subprocess description. start searching from high device numbers.
     rl  w3  b5        ;   for dev:=dev(last dev in nametable) step -1 until 0 do
j6:  al  w3  x3-2      ;     if kind(dev) = remote subkind then
                       ;     begin
     sl  w3  (b4)      ;        if main(dev) = 0 or
     jl.     +4        ;           (dh.linkno(dev) = dh.linkno(mess) and
     jl.     j13.      ;            dh.id(dev)     = dh.id(mess)  )
     rl  w2  x3        ;            then goto found;
     al  w0  p113      ;
     se  w0  (x2+a10)  ;     end;
     jl.     j6.       ; not found: goto error 3;
     al  w0  0         ;
     sn  w0  (x2+a50)  ;
     jl.     j5.       ;
     bz  w0  x2+p11    ;
     rl  w1  x2+p5     ;
     se. w0  (i3.)     ;
     jl.     j6.       ;
     se. w1  (i4.)     ;
     jl.     j6.       ;
j5:                    ; found:
  
; free process description found: w2=free sub found, w3=add of subproc nametable entry
     ws  w3  b4        ; rcno:=(entry(sub) - entry(first dev))/2
     as  w3  -1        ;
     ds. w3  i1.       ; save sub, rcno - jobhost linkno -
     rl  w1  b19       ; w1:= host proc
     jl. w3  n25.      ; create subprocess
  
; transfer receive parameters to subprocess
     al  w3  0         ;
j7:  am      x1+a402   ;
     rl  w0  x3        ;
     am      x2+a402   ;
     rs  w0  x3        ;
     al  w3  x3+2      ;   users(proc):=proc func;
     sh  w3  a403-2    ;
     jl.     j7.       ;
     rl  w0  g49       ;
     rs  w0  x2+a402   ;
     rl  w0  x1+p84    ;
     al  w3  0         ;
     wd  w0  g48       ;
     ls  w0  1         ;   max buffersize(sub):=size(rec)/3*2;
     rs  w0  x2+p18    ;
     bz  w0  x1+p88    ;
     hs  w0  x2+p16    ; buffers free(sub):=bufno(rec)
     al  w0  8.377     ;
     la  w0  x1+p83    ;
     hs  w0  x2+p10    ; subkind(sub):=status(rec)(16:23);
     bz  w0  x1+p98    ;
     hs  w0  x2+p11    ; devno(sub):= sender linkno(rec)
     rl. w0  i1.       ;
     hs  w0  x2+p9     ; rcno(sub):= saved rcno
c.-p103
     bz  w0  x1+p94    ;
     ls  w0  -2        ;
z.
c.p103-1
     bz  w0  x1+p82    ;
     ls  w0  5         ;
     rl  w3  x1+p83    ;
     ls  w3  -8        ;
     lo  w0  6         ;   data quality(sub):=state(mess)<5+mode(mess)(0:4);
z.
     hs  w0  x2+p8     ; *data quality(sub):=quality mask(rec)
     bz  w0  x1+p321   ;
     hs  w0  x2+p7     ; receiver net-id(sub):=sender net-id(rec)
     bz  w0  x1+p322   ;
     hs  w0  x2+p6     ; receiver home reg(sub):=sender home reg(rec)
     al  w0  0         ;***until net-id and home-reg are defined in the net:
     rs  w0  x2+p6     ;   net-id, home-reg:=0,0;
     rl  w0  x1+p323   ; receiver host-id(sub):=sender host-id(rec)
     rs  w0  x2+p5     ;
c.p101 b.f1 w.         ;*****test85*****
     rs. w3  f0.       ;
     jl. w3  f4.       ;
     85                ;
f0:  0                 ;
     jl.     f1.       ;
     al  w0  x2-4      ;
     al  w1  x2+p19+14 ;
     jl. w3  f5.       ;
f1:                    ;
e.z.                   ;*****test85*****
     rl  w1  b19       ; w1:=host proc
     rl  w2  b18       ; w2:=mess buff
         
; set rcno in message  buffer; receive param internal status:= ok;
; link message to event queue of host and if host not already in
; main queue then link it first in main queue. finnally return
; to main initialize return point.
     rl  w3  x1+a50    ; w3:=main
     rl. w0  i1.       ;
     hs  w0  x2+11     ; rcno(m buf):=saved rcno
     al  w0  p160      ;
     hs  w0  x3+p80    ; internal status(rec):=ok
c.p101 b.f1 w.         ;*****test86*****
     rs. w3  f0.       ;
     jl. w3  f4.       ;
     86                ;
f0:  0                 ;
     jl.     f1.       ;
     rl. w3  f0.       ;
     al  w0  x3+p80    ;
     al  w1  x3+p90    ;
     jl. w3  f5.       ;
f1:                    ;
e.z.                   ;*****test86*****
     jl. w3  n20.      ;   link operation;
     jl. w3  n21.      ;   testready and link;
     rl. w2  i0.       ; return: w2:=sub created
     am     (b101)     ;
     jl      -2        ; return to main init

; error.
j10: am      0-1       ;
j12: am      1-3       ; error1:
j13: am      3-5       ; error3:
j9 : al  w0  5         ; error5:
c.p101 b.f1 w.         ;*****test87*****
     rs. w3  f0.       ;
     jl. w3  f4.       ;
     87                ;
f0:  0                 ;
     jl.     f1.       ;
     rs  w0  x3        ;
     al  w0  x3        ;
     al  w1  x3        ;
     jl. w3  f5.       ;
f1:                    ;
e.z.                   ;*****test87*****
     rl  w2  b18       ;
     hs  w0  x2+13     ; result(m buf):=case error _entry of ((0),1,3,5)
j14: rl  w1  b19       ; out:
     rl  w3  x1+a50    ;
     al  w0  p160      ; 
     hs  w0  x3+p80    ;  internal state(main):=ok
     jl. w3  n20.      ;   link operation;
     jl. w3  n21.      ;   testready and link;
     jl     (b101)     ;         


; remove.
;
m1:  jl. w3  n26.      ; remove: get free mess buffer;
     al  w0  -1        ;
     hs  w0  x2+8      ;
     al  w0  v38<2     ;
     hs  w0  x2+9      ;   mess(0):=-1,function;
     bz  w0  x3+p88    ;
     hs  w0  x2+12     ; bufno(m buf):= bufno(rec)
     bz  w0  x3+p98    ;
     hs  w0  x2+10     ;   dh.linkno(mess):=dh.linkno(rec);
     bz  w0  x3+p89    ;
     hs  w0  x2+11     ;   jh.linkno(mess):=jh.linkno(rec);
     rl  w0  x3+p321   ; answer add1(m buf):=
     rs  w0  x2+16     ;   sender net-id,home reg(rec)
     rl  w0  x3+p323   ; answer add2(m buf):=
     rs  w0  x2+18     ;   sender host-id
     bz  w2  x3+p89    ;
     ls  w2  1         ;
     wa  w2  b4        ;
     rl  w2  x2        ; sub:=proc(rcno)
     rl  w0  x2+a10    ;
     la  w0  g50       ; if kind(subproc kind)<>sub or
     sn  w0  p112      ;    main(sub)<>main(host)
     se  w3  (x2+a50)  ;
     jl.     j12.      ;         then goto error1
     bz  w0  x3+p98    ;
     bs  w0  x2+p11    ;
     bz  w3  x3+p89    ;
     bs  w3  x2+p9     ;
     sn  w0  0         ;   if dh.linkno(sub)<>dh.linkno(mess)
     se  w3  0         ;   or jh.linkno(sub)<>jh.linkno(mess) then
     jl.     j12.      ;     goto error1;
     jl. w3  n24.      ;   remove subprocess(sub);
c.p101 b.f1 w.         ;*****test88*****
     rs. w3  f0.       ;
     jl. w3  f4.       ;
     88                ;
f0:  0                 ;
     jl.     f1.       ;
     al  w0  x2-4      ;
     al  w1  x2+p19+14 ;
     jl. w3  f5.       ;
f1:                    ;
e.z.                   ;*****test88*****
     rl  w2  b18       ;
     jl.     j14.      ;   goto out;

j20: al  w0  p163      ; error4:
     hs  w0  x3+p80    ;   internal status:=reject;
     jl     (b101)     ;   return(std);

; parameters.

i0:  0                 ; subproc
i1:  0                 ; rcno
i2:  0                 ; devno
i3:  0                 ; save dev.host linkno
i4:  0                 ; save dev.host id

e.

; release.
;
m2:  jl. w3  n9.       ; release: 
     am     (x1+a50)   ;
     rl  w0  +p84      ;
     sn  w0  0         ;   if result=ok then
     jl.     j0.       ;     goto deliver;
     rl  w3  x2+s9     ; notok:
     bz  w0  x2+s11    ;   if jh.host-id(mess)<>jh.host-id(subhost)
     bs  w0  x1+p7     ;   or jh.net-id(mess)<>jh.net-id(subhost) then
     sn  w3 (x1+p5)    ;     goto deliver;
     se  w0  0         ;
     jl.     j0.       ;
     bz  w3  x2+s10    ;
     ls  w3  1         ;
     wa  w3  b4        ;
     rl  w3  x3        ;
     rl  w0  x2+s6     ;   sub:=proc(jh.linkno);
     bz  w1  x2+s8     ;   if dh.host-id(mess)=dh.host-id(sub)
     bs  w1  x3+p7     ;   and dh.net-id(mess)=dh.net-id(sub)
     sn  w0 (x3+p5)    ;   and dh.linkno(mess)=dh.linkno(sub)
     se  w1  0         ;   and jh.linkno(mess)=jh.linkno(sub) then
     jl.     j10.      ;     remove subprocess(sub);
     bz  w0  x2+s4     ;
     bs  w0  x3+p11    ;
     bz  w1  x2+s10    ;
     bs  w1  x3+p9     ;
     sn  w0  0         ;
     se  w1  0         ;
     jl.     j10.      ;
     al  w2  x3        ;
     jl. w3  n24.      ;
     al  w0  0         ;
     rl  w1  b19       ;
     am     (x1+a50)   ;   simulate ok-result;
     rs  w0  +p84      ;
j10: rl  w1  b19       ;
     rl  w2  b18       ;
j0:  al  w0  0         ; deliver:
j1:  jl. w3  n11.      ;   return answer;
c.p101 b.f1 w.         ;*****test89*****
     rs. w3  f0.       ;
     jl. w3  f4.       ;
     89                ;
f0:  0                 ;
     jl.     f1.       ;
     rl  w2  b18       ;
     al  w0  x2+0      ;
     al  w1  x2+22     ;   dump contents of mess
     jl. w3  f5.       ;
f1:                    ;
e.z.                   ;*****test89*****
     jl. w3  u12.      ;   find first message;
     se  w2  0         ;   if mess<>0 then
     jl. w3  n21.      ;     testready and link;
     jl     (b101)     ; exit: return to main;

; lookup.
; lookup reserve.
; cancel reservation.
; lookup link.
;
m3:  jl. w3  n9.       ; lookup:
     jl. w3  n18.      ;   return operation;
     jl.     j1.       ;   goto release;


; linkup remote.
;
m6:  jl. w3  n9.       ; linkup remote:
     jl. w3  n18.      ;   return operation;
     al  w3  8.77      ;
     am     (x1+a50)   ;   result:=size(rec);
     la  w3  +p84      ;
     se  w3  0         ;
     sn  w3  7         ;
     sz                ;   if result<>0,7 then
     jl.     j1.       ;     goto release;
     rl  w3  x2+6      ;   proc:=sender(mess);
     sh  w3  0         ;   if proc<0 then
     ac  w3  x3        ;     proc:=-proc;
     rl. w1  r31.      ;
     ba  w1  x3+a14    ;
     bz  w0  x1+a402   ;
     lo  w0  x3+a14    ;   users(proc):=id-bit(sender(mess));
     hs  w0  x1+a402   ;
     rl  w1  b19       ;
     jl.     j1.       ;
z.
     rs  w3  +a53      ;   users(sub):=sender(mess);
     jl.     j1.       ;   goto release;

; linkup local.
;
m7:  jl. w3  n9.       ; linkup local:
     rl  w3  x1+a50    ;
     rl  w0  x3+p84    ;   result:=size(18:23);
     bz  w3  x3+p99    ;
     se  w3  3         ;   if local function=reject
     sz  w0  8.77      ;   or result<>0 then
     jl.     j2.       ;     goto clear subprocess;
     jl. w3  n3.       ;   packout(buffer);
     al  w1  b4        ;
     jl.     +4        ;
j15: al  w1  x1+2      ;   for dev:= first dev. in name table step 2
     sh  w1  (b5)      ;             until last dev. in name table do
     jl.     +4        ;   begin
     jl.     j16.      ;
     rl  w2  x1        ;     if kind(dev) = remote subkind or
     rl  w0  x2+a10    ;        kind(dev) = local subkind then
     sn  w0  p112      ;     begin
     jl.     j17.      ;
     se  w0  p113      ;
     jl.     j16.      ;
j17: am      (b18)     ;        if dh.id(dev) = dh.id and
     rl  w0  +s6       ;           dh.linkno(dev) = dh.linkno(mess)
     se  w0  (x2+p5)   ;           then remove subprocess(dev);
     jl.     j15.      ;
     bz  w0  x2+p11    ;
     se. w0  (r32.)    ;
     jl.     j15.      ;
     jl. w3  n24.      ;
     jl.     j15.      ;     end;
                       ;   end;
; initiate process description.
j16: rl  w1  b19       ;
     rl. w2  r31.      ;
     al  w0  p112      ;
     rs  w0  x2+a10    ;   kind(sub):=local kind;
     am     (b18)      ;
     rl  w3  +6        ;   proc:=sender(mess);
     sh  w3  0         ;
     ac  w3  x3        ;
j7:      bz  w1  x3+a14      ;   get half word no
         am      x1          ;  
         bz  w0  x2+a402     ;  
         lo  w0  x3+a14      ;  
         am      x1          ;  
         hs  w0  x2+a402     ;   users(sub):=proc+all ancestors(proc)
         rl  w3  x3+a34      ;  
         se  w3  0           ;  
         jl.     j7.         ;  
         rl  w1  b19       ;
z.
     rl. w0  r32.      ;
     hs  w0  x2+p11    ;   dh.linkno(sub):=dh.linkno;
     rl. w0  r27.      ;
     hs  w0  x2+p9     ;   jh. linkno(sub):=jh.linkno;
     rl. w0  r22.      ;
     hs  w0  x2+p10    ;   subkind(sub):=subkind;
     rl. w0  r24.      ;
     hs  w0  x2+p16    ;   buffers free(sub):=max buffers;
     rl. w0  r25.      ;
     al  w3  0         ;
     wd  w0  g48       ;
     ls  w0  1         ;
     rs  w0  x2+p18    ;   max bufsize(sub):=max.bufsize/3*2;
     rl  w2  b18       ;
     jl. w3  n1.       ;   deliver data;
     am      0-s31     ;    error: size:=0;
     al  w0  s31       ;   ok: size:=std buffer size;
     rl. w3  r32.      ;
     hs  w3  x2+s4     ;   dh.linkno(mess):=dh.linkno;
     jl. w3  n11.      ;   return answer;
c.p101 b.f1 w.         ;*****test90*****
     rs. w3  f0.       ;
     jl. w3  f4.       ;
     90                ;
f0:  0                 ;
     jl.     f1.       ;
     rl  w2  b18       ;
     al  w0  x2+0      ;   dump contents of mess
     al  w1  x2+22     ;
     jl. w3  f5.       ;
f1:                    ;
e.z.                   ;*****test90*****
     jl. w3  u12.      ;   find first message;
     se  w2  0         ;   if mess<>0 then
     jl. w3  n21.      ;     testready and link;
     rl. w2  r31.      ; init-exit:
     am     (b101)     ;
     jl      -2        ;   return to main(init);

; clear subprocess description.
j2:  am     (b18)      ; clear process:
     bz  w2  +s10      ;
     ls  w2  1         ;
     wa  w2  b4        ;   sub:=word(jh.linkno(mess)<1+base(name table));
     rl  w2  x2        ;
     jl. w3  n24.      ;   remove subprocess(sub);
     rl  w2  b18       ;
     jl. w3  n18.      ;   return operation;
     jl.     j1.       ;   goto deliver;


; operator output-input.
;
m10: jl. w3  n9.       ; operator output-input:
     am     (x1+a50)   ;
     bz  w0  +p81      ;
     so  w0  2.1       ;   if no datas received then
     jl.     j0.       ;     goto deliver size0;
     am     (x1+a50)   ;
     bz  w2  +p88      ;   bufno:=bufno(rec);
     jl. w3  u18.      ;   test and decrease stopcount;
c.-p103
     rl  w2  b18       ;
     al  w0  2         ;
     wa  w0  x2+s3     ;   bytes trf:=last(mess)-first(mess)+2;
     ws  w0  x2+s2     ;
z.
c.p103-1
     am     (x1+a50)   ;
     rl  w0  +p86      ;   bytes trf:=size(data);
     jl. w3  u15.      ;   convert bytes8 to bytes12;
z.
     jl.     j1.       ;   goto deliver size;


; operator output.
;
m11: jl. w3  n9.       ; operator output:
     jl.     j0.       ;   goto deliver;

e.                     ; end of entry4.


c.p101
; stepping stones.
     jl.     f4.       ;
f4=k-2
     jl.     f5.       ;
f5=k-2
     jl.     f6.       ;
f6=k-2
z.
\f



; subprocedures used in subhost.

; get data.
; copies a data area defined by current message buffer from sender to std driver
; buffer.
; deliver data.
; transfers a datablock from std driver buffer to an internal process. the
; buffer is defined in a message buffer.
;        call:         return:
; w0                   destroyed
; w1     subhost       unchanged
; w2     mess          unchanged
; w3     link          destroyed
c.p103-1
b.i2 w.
n0:  am      i2        ; get data:
n1:  al. w1  i1.       ; deliver data:
     jd      1<11+84   ;   general copy;
     rl  w1  b19       ;
     se  w0  0         ;   if result<>0 then
     jl      x3+0      ;     return to link;
     jl      x3+2      ; exit: return to link+2;


i0:  2<1+0             ; function (addr pair<1+mode)
     r0                ; first
     r0+s31-2          ; last
     0                 ; relative

i1:  2<1+1             ; function (addr pair<1+mode)
     r20               ; first
     r20+s31-2         ; last
     0                 ; relative

i2=i0-i1
e.
z.

c.-p103
b.i5,j5 w.
n0:
     ds. w3  i1.       ; get data buffer:
     al  w0  s31       ;   bytecount:=std size(data);
     al. w1  r0.       ;   first addr:=start(int driver buffer);
     wa  w0  x2+10     ;
     rl  w2  x2+10     ;
j0:  rl  w3  x2        ;
     rs  w3  x1        ;
     al  w2  x2+2      ;
     al  w1  x1+2      ;
     se  w2 (0)        ;
     jl.     j0.       ;
     rl  w1  b19       ;
     dl. w3  i1.       ;
     jl      x3+2      ;
n1:
     ds. w3  i1.       ; get data buffer:
     al  w0  s31       ;   bytecount:=std size(data);
     al. w1  r20.      ;   first addr:=start(int driver buffer);
     wa  w0  x2+10     ;
     rl  w2  x2+10     ;
j0:  rl  w3  x1        ;
     rs  w3  x2        ;
     al  w2  x2+2      ;
     al  w1  x1+2      ;
     se  w2 (0)        ;
     jl.     j0.       ;
     rl  w1  b19       ;
     dl. w3  i1.       ;
     jl      x3+2      ;
i0:  0                 ;
i1:  0                 ;
e.
z.

; check and packin(buffer).
; checks the values of the different fields and packs the data buffer into the
; std output buffer in the process description of hostprocess. return to link
; in case of errors else to link+2.
;        call:         return:
; w0                   destroyed
; w1     subhost       unchanged
; w2                   unchanged
; w3     link          destroyed
b.i10 w.
n2:  rs. w3  i0.       ; check and packin:
     bl. w3  r1.       ;
     sl  w3  -1        ;   if mode<-1
     sl  w3  1<8       ;   or mode>255 then
     jl.    (i0.)      ;     return to link;
     bl. w0  r2.       ;
     sl  w0  -1        ;   if subkind<-1
     sl  w0  1<8       ;   or subkind>255 then
     jl.    (i0.)      ;     return to link;
     ls  w0  16        ;
     ld  w0  8         ;
     rl. w0  r3.       ;
     sz. w0 (i4.)      ;   if size(timeout) or size(buffers)>=8 bits then
     jl.    (i0.)      ;     return to link;
     ls  w0  4         ;
     ld  w0  8         ;   word0(outarea):=
     rs  w3  x1+s100+0 ;     mode<16+subkind<8+timeout;
     ls  w0  4         ;
     rl. w3  r5.       ;
     sz. w3 (i7.)      ;   if size(buffer size)>=16 bits then
     jl.    (i0.)      ;     return to link;
     lo  w0  6         ;
     rs  w0  x1+s100+2 ;   word1(outarea):=buffers<16+buffer size;
     rl. w3  r7.       ;
     sz. w3 (i6.)      ;   if size(jh.linkno)>=10 bits then
     jl.    (i0.)      ;     return to link;
     ls  w3  8         ;
     rl. w0  r10.      ;
     sz. w0 (i5.)      ;   if size(jh.net-id)>=8 bits then
     jl.    (i0.)      ;     return to link;
     lo  w0  6         ;
     rs  w0  x1+s100+8 ;   word4(outarea):=jh.linkno<8+jh.net-id;
     bz. w0  r9.       ;
     sz. w0 (i5.)      ;   if size(jh.home-reg)>=8 bits then
     jl.    (i0.)      ;     return to link;
     ls  w0  16        ;
     rl. w3  r8.       ;
     sz. w3 (i7.)      ;   if size(jh.host-id)>=16 bits then
     jl.    (i0.)      ;     return to link;
     lo  w0  6         ;   word5(outarea):=
     rs  w0  x1+s100+10;     jh.home-reg<16+jh.host-id;
     dl. w0  r6.+2     ;
     ds  w0  x1+s100+14;
     dl. w0  r6.+6     ;   word6-9(outarea):=
     ds  w0  x1+s100+18;     devicename;
     am.    (i0.)      ;
     jl      +2        ; exit: return to link+2;

i0:  0                 ; saved link
i4:  8.7400 7400       ;
i5:  8.7777 7400       ;
i6:  8.7777 6000       ;
i7:  8.7760 0000       ;

e.

; packout.
; packs out a buffer from the std. input buffer in the process description of
; the subhost process. the parameters are delivered in the std. driver input
; buffer.
;        call:         return:
; w0                   destroyed
; w1     subhost       unchanged
; w2                   destroyed
; w3     link          destroyed
b.i5 w.
n3:  rs. w3  i0.       ; packout:
     rl  w0  x1+s102+0 ;
     ls  w0  -8        ;
     la. w0  i4.       ;
     rs. w0  r22.      ;   subkind:=word0(8:15);
     rl  w0  x1+s102+2 ;
     al  w3  0         ;
     ld  w0  8         ;
     rs. w3  r24.      ;   max. buffers:=word1(0:7);
     ls  w0  -8        ;
     rs. w0  r25.      ;   max. buffersize:=word1(8:23);
     rl  w0  x1+s102+4 ;
     ls  w0  -8        ;
     la. w0  i5.       ;
     rs. w0  r32.      ;   dh.linkno:=word2(6:15);
     rl  w3  x1+s102+8 ;
     ld  w0  -8        ;
     la. w3  i5.       ;
     rs. w3  r27.      ;   jh.linkno:=word4(6:15);
     ld  w0  -16       ;
     hs. w0  r30.      ;   jh.net-id:=word4(16:23);
     rl  w0  x1+s102+10;
     ld  w0  8         ;
     hs. w3  r29.      ;   jh.home-reg:=word5(0:7);
     ls  w0  -8        ;
     rs. w0  r28.      ;   jh.host-id:=word5(8:23);
     al  w0  0         ;***jh.home-reg,jh.net-id:=0
     rs. w0  r29.      ;*** used until they are defined from the dev contr
     dl  w0  x1+s102+14;
     ds. w0  r26.+2    ;
     dl  w0  x1+s102+18;
     ds. w0  r26.+6    ;   devicename:=word6-9(inarea);
     rl. w3  r27.      ;
     ls  w3  1         ;
     wa  w3  b4        ;
     rl  w3  x3        ;
     bz  w0  x1+p7     ;
     bs. w0  r30.      ;
     rl  w2  x1+p5     ;
     sn  w0  0         ;   if jobhost(data)=jobhost(subhost) then
     se. w2 (r28.)     ;    proc desc:=word(jh.linkno<1+base(nametable));
     al  w3  0         ;   else
     rs. w3  r31.      ;     proc desc:=0;
     jl.    (i0.)      ; exit: return;

i0:  0                 ; saved link
i4:  8.0000 0377       ;
i5:  8.0000 1777       ;

e.

; setup header1.
; this procedure sets up the header transmission parameters according to
; the format used of release link and lookup link.
;
; setup header2.
; this procedure sets up the header transmission parameters according to 
; the format used of lookup, lookup reserve, cancel reservation, linkup
; remote and linkup local.
;
; setup header3.
; this procedure sets up the header transmission parameters according to
; the format used of operaor output and operator output-input.
;
;        call:         return:
; w0                   destroyed
; w1     subhost       unchanged
; w2     mess          unchanged
; w3     link          destroyed
b.i5,j5 w.
n4:  ds. w3  i1.       ; setup header1:
     rl  w3  x1+a50    ;
     rl  w0  x2+s9     ;
     rs  w0  x3+p64    ;   size:=jh.host-id;
     bz  w0  x2+s11    ;
     rs  w0  x3+p63    ;   mode:=jh.net-id;
     jl.     j0.       ;   goto common part;

n5:  ds. w3  i1.       ; setup header2:
     rl  w3  x1+a50    ;
     al  w0  x1+s100   ;
     rs  w0  x3+p65    ;   first:=first(outarea);
c.-p103
     al  w0  x1+s100+s101-2;
     rs  w0  x3+p66    ;   last:=last(outarea);
     al  w0  s101>1*3  ;****midlertidigt
     rs  w0  x3+p64    ;*****
z.
c.p103-1
     al  w0  s101>1*3  ;
     rs  w0  x3+p66    ;   size:=std buffer size;
     al  w0  8         ;
     hs  w0  x3+p72    ;   address code:=dirty;
z.
     jl.     j0.       ;   goto common2;

n6:  rs. w3  i1.       ; setup header3:
     al  w0  x2+1      ;
     rs. w0  i0.       ;   saved mess:=uneven mess;
     rl  w0  x2+s2     ;
     am     (x1+a50)   ;
     rs  w0  +p65      ;   first(trm):=first(mess);
     al  w0  2         ;
     wa  w0  x2+s3     ;
     ws  w0  x2+s2     ;   size12:=last(mess)+2-first(mess);
     jl. w3  u14.      ;   convert size12 to size8;
     rl  w3  x1+a50    ;
     rs  w0  x3+p64    ;   size(trm):=size8;
c.-p103
     rl  w0  x2+s3     ;
z.
     rs  w0  x3+p66    ;   last(trm):=last(mess);
                       ;   charcount(trm):=0;
c.p103-1
c. p103-1
     al  w0  0         ;
     hs  w0  x3+p72    ; address code(main):= sender area
     al  w0  x2        ;
     rs  w0  x3+p71    ; message buffer(main):= message
z.
z.
j0:  bz  w0  x2+s4     ; common1:
     hs  w0  x3+p69    ;   rec.linkno:=dh.linkno(mess);
     bz  w0  x2+s10    ;
     hs  w0  x3+p78    ;   sender linkno(trm):=jh.linkno(mess);

j1:  bz  w0  x2+s1     ; common2:
     ls  w0  -2        ;   internal status:=ok, function(trm):=header function(mess);
     hs  w0  x3+p61    ;   state(trm):=0;
     al  w0  2.11      ;
     la  w0  x2+s1     ;
     rs  w0  x3+p63    ;   mode(trm):=function mode(mess);
     bz  w0  x2+s8     ;
     hs  w0  x3+p301   ;▶aa◀h▶aa◀h▶01◀▶aa◀h▶02◀▶aa◀h▶03◀▶aa◀h▶04◀▶aa◀h▶05◀▶aa◀h▶06◀▶aa◀h▶07◀▶aa◀h«bs»▶aa◀h	▶aa◀h
▶aa◀h▶0b◀▶aa◀h\f

▶aa◀h\r▶aa◀h▶0e◀▶aa◀h▶0f◀▶aa◀h▶10◀▶aa◀h▶11◀▶aa◀h▶12◀▶aa◀h▶13◀▶aa◀h▶14◀▶aa◀h▶15◀▶aa◀h▶16◀▶aa◀h▶17◀▶aa◀h▶18◀▶aa◀h▶EOF◀