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

⟦68c730230⟧ TextFile

    Length: 30720 (0x7800)
    Types: TextFile
    Names: »hcrhcomty«

Derivation

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

TextFile

    (hcrhcom=slang list.no xref.no;
hcrhcom);
b.  g2 w.             ;
s.  a70,b22,h50,i100 w.;

;. format of message buffer
    a40=-10           ; message buffer address(other computer) or result
    a38= -8           ; receiver<12+sender (computer numbers)
    a36= -6           ; process description addr for receiver other computer
    a34= -4           ;    -         -       -    -  sender     -      -
    a32= -2           ; w2
    a0 =  0           ; next buffer
    a2 =  2           ; prev buffer
    a4 =  4           ; receiver
    a6 =  6           ; sender
                      ;               i-o (normal)    i-o (other com)   mon call
    a8 =  8           ; message       op<12 +mode       3<12            1<22+m_p_n
    a10= 10           ;    -          first address     first addr      w0
    a12= 12           ;    -          last  address     last  addr      w1
    a14= 14           ;    -          1. segment        first addr(oc)  w2
    a16= 16           ;    -                            comp no         w3
    a18= 18           ;    -
    a20= 20           ;    -
    a22= 22           ;    -
    a48=10            ; max number of buserrors
    a49=a22-a40+2     ; buffer length
    a50= 21<3         ; level 21
    a51= 22<3         ; level 22
    a54= 1            ; time out limit for mess, buff
    a55=10            ; time out limit for transfer
\f


;.
; format of message to another computer:
;
;
; do     wreg             addr
;        wa        1<23+level<3+ 2.001  send data transfer request
;                  wa > 0 :   contents irr
;                             request to send data specified by level location
;                  wa <=0 :   message
;
;
;
; di    wreg              addr
;       wb         1<23+level<3+ 2.001  start input
;                  wb > 0 :   input to addr specified in level location
;                  wb <=0 :   message
;
;                   level location   (8) + level < 3
;                   *----------*----------*----------*----------*
;                   ! number of! input or ! interrupt!          !
;                   ! bytes to ! output   ! address  ! level    !
;                   ! transfer ! address  !          !          !
;                   *----------*----------*----------*----------*
;
;
;  format of message
;
;  1<23+type<19 + mess
;
;  type = 16  input-output communication
;             mess  = mess-type < 17 + mess-id
;             mess-type = 0 send buffer request
;                         1 ready for receiving a buffer
;                         2 send data request
;                         3 ready for receiving data
;
;             mess-id is a unique number for each transfer
;
;  state for i-o transfer
;        0 nothing pendling
;
;        1 a send buffer request is sent
;        2 a buffer is sent
;        4 a send data request is sent
;        8 data is sent
;
;       32 an input buffer request is received
;       64 a start input buffer is sent
;      128 an input data request is received
;      256 a start data input is sent
;
;
;
; external interrupt  16 :  channel input finis
;    -         -      18 :  channel input start (input request)
;    -         -      20 :  channel output finis
;    -         -      22 :  character device interrupt(not used)
\f




;. all input and output actions are chained in an input chain and an
; output chain:
;
    a60=0             ; link: next link
    a61=2             ;       prev link
    a62=4             ;       type  1 and 2 for input, 3,4,5 for output
    a63=6             ;       buffer address
    a64=8             ;       mess id
    a65=10            ;       link id
    a66=12            ;       input or output addr
    a67=14            ;       halfwords
    a68=16            ; time left before time out
    a70=a68-a60       ; length of a link
                      ;
    rs. w3     h7.    ; own proc desr addr
    al  w0     6      ;
    hs  w0  x3+104    ; disable interrupt level:=6
    al. w1     h31.   ;
    al. w2     h31.   ;
    ds  w2  x2        ; output link head:=output link head
    al. w1     h32.   ;
    al. w2     h32.   ;
    ds  w2  x2        ; input link head:=input linkhead
    al. w1     h33.   ;
    al. w2     h33.   ;
    ds  w2  x2        ;
    jl. w3     b20.   ; goto chain free links
    al  w0     4      ;
    jd         1<11+32; set own process descr addr in monitor
    jd         1<11+28; set monitor mode
    al. w3     h10.   ;
    jd         1<11+4 ; w0:=process descr addr(master)
    rs. w0     h8.    ;
    rl  w3     8      ; base of controller table
    al  w3  x3+a50+2  ; +rel addr(level21)
    rs. w3     h0.    ; input location
    al  w3  x3+8      ;
    rs. w3     h1.    ; output location
    jl. w3     b18.   ; send time out limit to clock
\f


i0: rl. w1     h4.    ; w1:=i-o state
    sz  w1     2.1111 ; if output pendling then
    jl.        i3.    ; goto wait event
    al  w0     5      ;
    jl. w3     b14.   ; search link waiting for output
    jl.        i1.    ; not found: goto test input
    jl.        i15.   ; else goto send output request
i1: rl. w1     h4.    ; w1:=i-o state
    sz  w1     2.101000000; if a ready for input is sent then
    jl.        i3.    ; goto wait event
    so  w1     2.000100000; else if an input buffer request is not sent then
    jl.        i2.    ; goto test data
    al  w0     2      ; else
    jl. w3     b13.   ; goto search link in state 2
    jl.        i3.    ; not found: goto wait event
    jl.        i43.   ; else goto send input buffer ready signal
i2: so  w1     2.010000000; if an input data request is not sent then
    jl.        i3.    ; goto wait event
    al  w0     1      ; else
    jl. w3     b13.   ; search link in state 1
    jl.        i3.    ; not found: goto wait event
    jl.        i45.   ; else goto send input data ready signal
i3: al  w2     0      ;
    je.        2      ; interrupt level:=26
    jd         1<11+24; wait event
    jd.        2      ; set interrupt level=6
    sl  w0     2      ; if interrupt from hc8000 then
    jl.        i4.    ; goto i4 else
    se  w0     0      ; if not message then
    jl.        i50.   ; goto i50
    rs. w2     h2.    ; else save buf addr
    jl.        i10.   ; goto link buff
\f


i4: sn  w0     16     ; if channel input finis then
    jl.        (h29.) ; goto return point for input finis
    sn  w0     20     ; if channel output finis then
    jl.        (h28.) ; goto returnpoint for output finis
    rl. w3     h4.    ; w3:=i-o state
    sz  w3     2.010100000; if input data is expected then
    jl.        i6.    ; goto i6.
    jl. w3     b1.    ; else load message via data in
    jl.        i61.   ; if buserror then goto set result
    rl. w3     h3.    ; w3:=last di-mess
i5: bl  w0     6      ; w0:=type
    al  w1     0      ;
    ls  w0     13     ;
    ld  w1     -19    ;
    se  w0     16     ; if not i-o mess then
    jl.        i0.    ;  goto next event
    al  w0     0      ;
    ld  w1     3      ; w0:=mess-type<1
    am         (0)    ;
    jl.        2      ; case mess-type of
    jl.        i40.   ; start buffer input
    jl.        i20.   ; send a buffer
    jl.        i45.   ; start data input
    jl.        i36.   ; send data
                      ;
                      ;
i6: dl. w3     h16.   ; 
    ds. w3     (h0.)  ; set input address
    jl. w3     b1.    ; and start input
    jl.        i64.   ; if buserror then goto set result
    rl. w3     h3.    ; w3:=last di reg  value
    sh  w3     0      ;
    jl.        i5.    ; goto mess
    jl.        i0.    ; else goto wait next event
                      ;
                      ;
\f


    ;; ************************************************************
    ;
    ;          start output to hc8000
    ;
    ;; ************************************************************
i10:jl.        b6.    ; goto link buffer
                      ;
i15:rl  w2  x1+a65    ; w2:=link-id
    wa. w2     h27.   ; outputmess:=1<23+16<19+0<17+count
    rs. w2     h5.    ;
    jl. w3     b0.    ; send output message to RH8000
    jl.        i64.   ; if buserror then set result 2
    al  w0     a54    ;
    rs  w0  x1+a68    ; set time out limit
    al  w0     2.1    ;
    jl. w3     b2.    ; goto set i-o state
    jl. w3     i39.   ; goto next event
i20:rl. w0     h3.    ; w0:=
    ls  w0     13     ;
    ls  w0     -13    ; output number
    jl. w3     b15.   ; search mess-id
    jl.        i0.    ; if not found then goto next event
    rs. w1     h6.    ; set current output link
    rl  w2  x1+a63    ;
    al  w3     a49    ; w3:=buffer length
    al  w0  x2+a40    ; w0:= first addr of buff
    ds  w0  x1+a67    ;
    ds. w0     (h1.)  ; set(byte,addr)
    rs. w3     h5.    ; next reg val for data out
    jl. w3     b0.    ; send output request to hc8000
    jl.        i64.   ; if buserror then goto result 2
    al  w0     a54    ;
    rs  w0  x1+a68    ; set time out limit
    al  w0     2.10   ;
    jl. w3     b2.    ; set i-o state
    jl. w3     i39.   ; goto next event
\f


i30:rl. w2     h6.    ; w2:=current output link addr
    jl. w3     b12.   ; remove link
    rl  w2  x2+a63    ; w2:=buffer addr
    bz  w0  x2+a8     ; w0:=op
    sn  w0     3      ; if op=input then
    jl.        b10.   ; goto link input buffer
    se  w0     5      ; else if op <> output then
    jl.        i65.   ;  goto return buffer
i34:rl  w3  x1+a68    ;
    wa. w3     h25.   ; w3:=1<23+16<19+2<17+count
    rs. w3     h5.    ;
    jl. w3     b0.    ; send output data request
    jl.        i64.   ; if buserror then goto set result
    al  w0     a55    ;
    rs  w0  x1+a68    ; set time out limit
    al  w0     2.100  ;
    jl. w3     b2.    ; goto set i-o state
    jl. w3     i39.   ;
i36:rl. w0     h3.    ;
    ls  w0     13     ;
    ls  w0     -13    ; w0:=transfer-id
    jl. w3     b15.   ; search link
    jl.        i0.    ; if not found then goto next event
    rl  w2  x1+a63    ; else w2:=buf
    rl  w0  x2+a14    ; w0 first addr. at HC8000
    rl  w3  x2+a12    ;
    ws  w3  x2+a10    ;
    al  w3  x3+2      ; w3 :=number of halfwords
    sh  w3     0      ; if nothing to transfer then
    jl.        i67.   ; goto set result
    ds  w0  x1+a67    ;
    ds. w0     (h1.)  ;
    jl. w3     b0.    ; start output data
    jl.        i64.   ; if buserror then goto set result
    al  w0     2.1000 ; else
    jl. w3     b2.    ; goto set i-o state
    jl. w3     i39.   ; goto next event
    al  w0     0      ;
    jl. w3     b2.    ; set i-o state
    rl. w1     h6.    ; w1:=link
    rl  w2  x1+a63    ; w2:=buf
    rs. w2     h2.    ; set current buf
    jl. w2     b12.   ; remove link
    al. w2     h33.   ;
    jl. w3     b11.   ; chain link
    rl. w2     h2.    ; w2:=current buf
    rl  w3  x1+a66    ;
    rs  w3  x2+a10    ; set number of halfwords in buf
    jl.        i65.   ; goto set result
i39:rs. w3     h28.   ; set return addr
    jl.        i0.    ; and goto next event
\f


    ;; ************************************************************
    ;
    ;          start input from hc8000 to rh8000
    ;
    ;; ************************************************************
i40:                  ; make a buffer ready for input from hc8000
    al. w1     h12.   ;
    al. w3     h13.   ; name
    jd         1<11+16; get buffer
    rs. w2     h2.    ; curr buf
    al  w0     a54    ;
    rs  w0  x1+a68    ; set time out limit
    al  w0     2.000100000;
    jl. w3     b2.    ; goto set i-o state
    jl.        b9.    ;link buf
i43:rs. w1     h14.   ; set current link
    rl  w2  x1+a63    ; w2:=buff
    al  w0  x2+a40    ; w0:=1. addr
    al  w3     a49    ; w3:=buffer length
    ds. w0     h16.   ;
    ds  w0  x1+a64    ;
    rl. w3     h26.   ; w3:=ready for receiving a buffer signal
    hl  w3  x1+a64+1  ; +mess-id
    rs. w3     h5.    ;
    jl. w3     b0.    ; send ready signal for receiving a buffer
    jl.        i0.    ; if buserrror then goto next event
    al  w0     a54    ;
    rs  w0  x1+a68    ; set time out limit
    al  w0     2.001000000;
    jl. w3     b2.    ; set i-o state
    jl. w3     i49.   ; goto to next event
                      ;
    rl. w2     h14.   ;
    jl. w3     b12.   ; remove link
    al  w0     2.000001111;
    jl. w3     b5.    ; reset input state
    rl  w2  x2+a63    ; w2:=buff
    bz  w0  x2+a8     ;
    sn  w0     3      ; if input message then
    jl.        b10.   ; goto insert buffer in input chain
    sn  w0     5      ;
    jl.        b8.    ; goto insert buffer in output chain
    jl.        i65.   ; else link buffer to masterproc
i45:rl. w0     h3.    ;
    ls  w0     13     ;
    ls  w0     -13    ; w0:=transfer-id
    jl. w3     b15.   ; search link
    jl.        i0.    ; if not found then goto next event
    rs. w1     h14.   ; set current link
    rl  w2  x1+a63    ; w2:=buf
    jl. w3     b3.    ; if address is outside proc then
    jl.        i67.   ; goto set result
    rl  w0  x2+a14    ; else w0:=addr
    rl  w3  x2+a12    ;
    ws  w3  x2+a10    ; w3:=number of halfwords
    al  w3  x3+2      ; to transfer
    sh  w3     0      ; if nothing to transfer then
    jl.        i67.   ; goto set result
    ds  w0  x1+a64    ;
    rl. w3     h24.   ; w3:=ready signal for input
    hl  w3  x1+a64+1  ; +transfer id
    rs. w3     h5.    ;
    jl. w3     b0.    ; goto send ready signal
    jl.        i64.   ; if buserror then goto set result
    al  w0     a55    ;
    rs  w0  x1+a68    ; set time out limit
    al  w0     2.100000000;
    jl. w3     b2.    ; set i-o state
    jl. w3     i49.   ; set return point and goto next event
                      ;
    rl. w1     h14.   ;
    jl. w3     b12.   ; remove link
    rl  w2  x1+a63    ; w2:=buf
    rs. w2     h2.    ;
    al. w2     h33.   ; w2:=free lnik head
    jl. w3     b11.   ; insert link
    rl. w2     h2.    ; w2:=buff
    rl  w3  x1+a66    ;
    rs  w3  x2+a10    ; number of halfwords to buf
                      ;
i49:rs. w3     h29.   ; set return point and
    jl.        i0.    ; goto next event
\f


    ;; ************************************************************
    ;          send answer and/or move buffer
    ;; ************************************************************
i50:                  ; an answer is arrived
    se. w2     (h17.) ; if current buf <> time delay buf then
    jl.        i61.   ; goto return buf
    jd         1<11+26; else get event
    al. w1     h31.   ; else test output chain for time out
    sn. w1     h31.   ; if chain is empty then
    jl.        i54.   ; goto test input chain
    rl  w1  x1        ; next link
i51:rl  w0  x1+a68    ; time out limit:=
    bs. w0     1      ; time out limit-1
    rs  w0  x1+a68    ;
    sh  w0     -1     ; if time out then
    jl. w3     b19.   ; goto return buffer
    rl  w1  x1        ; w1:=next link
    se. w1     h31.   ; if more to test then
    jl.        i51.   ; goto next

i54:al. w1     h32.   ; test input chain
    sn. w1     h32.   ; if chain is empty then goto send mess to clcok
    jl.        i56.   ;
    rl  w1  x1        ; next link
i55:rl  w0  x1+a68    ; time out limit:=
    bs. w0     1      ; time out limit-1
    rs  w0  x1+a68    ;
    sh  w0     -1     ; if time out then
    jl. w3     b19.   ; goto return buffer
    rl  w1  x1        ; w1:=next link
    se. w1     h32.   ; if more to test then
    jl.        i55.   ; goto next

i56:jl. w3     b18.   ; else send new mess to clock
    jl.        i0.    ; goto next event
                      ;
i61:                  ;
    rl  w1  x2+a4     ; w1:=receiver
    se. w1     (h7.)  ; if receiver<>this proc then
    jl.        i64.   ; goto i64
i62:jd         1<11+26; get event
    al  w0     2      ; result=2 (rejected)
    al. w1     h9.    ; mess addr
    jd         1<11+22; send message
    jl.        i0.    ; goto next event
i67:am         -1     ; set result 3          address error
i64:am         -508   ; set result 4          rejected (buseeror)
i63:am         511    ; set result 512        time out
i65:al  w0     1      ; set result 1
    al  w1     0      ;
    se  w0     512    ; if not time out then
    jl.        i68.   ; goto set status and answer
    rl  w1     0      ; w1:=2.0010 0000 0000
    al  w0     1      ; result=1
i68:hs  w1  x2+a8+1   ; set buf.status
    rs  w0  x2+a40    ; set result
i66:al. w3     h10.   ;
    jd         1<11+34; move buf to master proc
    jl.        i0.    ; goto next event
                      ;
h0: 0                 ; controller table addr(level(21))  input
h1: 0                 ; controller table addr(level(22))  output
h2: 0                 ; buffer addr
h3: 0                 ; last di-register value
h4: 0                 ; i-o state
h5: 0                 ; next register value at data-out
h6: 0                 ; current output link
h7: 0                 ; own proc descr addr
h8: 0                 ; 
h9: 0,r.8             ; message
h10:<:masterproc:>,0,0;
h11:0,r.(:a49>1 +2:)  ;
h12:0,r.8             ; pseudo message
h13:0,r.5             ; pseudo name
h14:0                 ; current input link 
h15:0                 ; halfwords
h16:0                 ; next input addr
h17:0                 ; clock buf
h24:1<23+16<19+3<17   ; ready for receiving data
h25:1<23+16<19+2<17   ; send data request
h26:1<23+16<19+1<17   ; ready for receiving a buffer
h27:1<23+16<19+0<17   ; send buffer request
h28:0                 ; output return addr
h29:0                 ; input return point
    0                 ;
h30:0                 ; next free link
    0                 ;
h31:0                 ; output link
    0                 ;
h32:0                 ; input link
                      ;
    0                 ;
h33:0                 ; free links
    0                 ;
    ;; ************************************************************
    ;
    ;
    ; send output request to hc8000
b.  f5,g5 w.          ;
b0:                   ;
    rs. w3     g3.    ; save return
    al  w3     0      ;
    rs. w3     g1.    ; reset counter
f0: rl. w3     h5.    ; w3:=do-reg-value
    do. w3     (g0.)  ; send output request to hc8000
    sx         2.111  ; if buserror then
    jl.        f2.    ; goto f2 else
    jl.        f3.    ; goto f3
f2: rl. w0     g1.    ; w0:=counter
    ba. w0     1      ; counter:=counter+1;
    rs. w0     g1.    ; save counter
    sh  w0     a48    ; if counter<=max number of buserrors then
    jl.        f0.    ; repeat data out
    rl. w3     g3.    ; else return+0
    jl      x3+0      ;
f3: rl. w3     g3.    ; return+2
    jl      x3+2      ;
g0: 1<23 + a51 +2.001 ;
g1: 0                 ;
g3: 0                 ; return addr
e.                    ;
                      ;
    ;; ************************************************************
    ;
    ;
    ; send input request to hc8000
b.  f5,g5 w.          ;
b1:                   ;
    rs. w3     g3.    ; save return
    al  w3     0      ;
    rs. w3     g1.    ; reset counter
f0: di. w3     (g0.)  ; send input request to hc8000
    sx         2.111  ; if buserror then
    jl.        f2.    ; goto f2 else
    jl.        f3.    ; goto f3
f2: rl. w0     g1.    ; w0:=counter
    ba. w0     1      ; counter:=counter+1;
    rs. w0     g1.    ; save counter
    sh  w0     a48    ; if counter<=max number of buserrors then
    jl.        f0.    ; repeat data out
    rl. w3     g3.    ; else return+0
    jl      x3+0      ;
f3: rs. w3     h3.    ; set di-reg-value
    rl. w3     g3.    ; return+2
    jl      x3+2      ;
g0: 1<23 + a50 +2.001 ;
g1: 0                 ;
g3: 0                 ; return addr
e.                    ;
                      ;
    ;; ************************************************************
    ;
    ;
    ;
    ; set i-o state
    ; w0=state
    ;
b.  f5,g5 w.          ;
b2:                   ;
    ds. w3     g3.    ;
    al  w2     2.1111 ;
    sl  w0     2.100000; if input state then
    ls  w2     5      ; move mask
    la. w2     h4.    ; extract old mask
    wa  w2     0      ; insert new
    rs. w2     h4.    ; state and store
    dl. w3     g3.    ;
    jl      x3        ; return
g2: 0                 ;
g3: 0                 ;
e.                    ;
    ;; ***********************************************************
    ;
    ;
    ; test buffer
    ; test first.buff and last.buff in case of input buffer
    ; call: w2=buffer addr
    ; return 1 if first or last is not within proc
    ; return 2 else
    ; return: w0,w2  unchanged, w3 return addr, w1 proc addr
b.  f5,g5 w.          ;
b3:                   ;
    ds. w0     g0.    ;
    al  w3     2      ;
    bz  w0  x2+a8     ;
    se  w0     3      ; if not input buffer then
    jl.        f0.    ; return
    rl  w1  x2+a6     ; w1:=sender 
    dl  w0  x1+24     ; w3,w0:=first,last addr.proc
    wa  w3  x1+98     ; +base
    wa  w0  x1+98     ; +base
    ba. w0     1      ;
    sh  w3  x2+a10    ; if first.buf<first.proc or
    sh  w0  x2+a12    ; last.buf >= last.proc then
    am         -2     ; return 2
    al  w3     2      ; else return 1
f0: rl. w0     g0.    ;
    wa. w3     g3.    ;
    jl      x3        ;
g3: 0                 ;
g0: 0                 ;
e.                    ;
                      ;
                      ;
b.w.                  ;
b5:                   ; clear input or output state
    la. w0     h4.    ;
    rs. w0     h4.    ;
    jl      x3        ;
e.                    ;
                      ;
                      ;
b.w.                  ; link current buffer as
b6: am         1      ; a buffer waiting for send output request
b7: am         1      ; a buffer to be output
b8: am         1      ; a buffer describing an output message
b9: am         1      ; a buffer waiting for input
b10:al  w0     1      ; a buffer describing an input message
    rl. w2     h33.   ; w1:= next free link
    jl. w3     b12.   ; remove link from free chain
    rs  w0  x2+a62    ; set link type
    al  w3     10     ;
    rs  w3  x1+a68    ; init value for time out limit
    dl. w3     h3.    ; w2:=current buffer   w3:=mess-id
    ds  w3  x1+a64    ;
    sh  w0     2      ; w2:= if input then
    am         h32-h31; input link head else
    al. w2     h31.   ; output link head
    jl. w3     b11.   ; chain link
    jl.        i0.    ; and goto next event;
e.                    ;
                      ;
                      ;
b.w.                  ;
b11:                  ; insert a link
                      ; w1=element, w2=head
                      ; return: w1,w2 unchanged, w3 prev element
    rs  w3     0      ;
    rl  w3  x2+2      ; w2:=prev link
    rs  w1  x2+2      ; prev link:=curr link
    rs  w1  x3+0      ;
    rs  w2  x1+0      ;
    rs  w3  x1+2      ;
    jl         (0)    ; return
e.                    ;
b.w.                  ;
b12:                  ; remove a link
                      ; w1=element
                      ; return: w1,w2 unchanged,  w3=next element
    rs  w3     0      ;
    rl  w3  x1+0      ;
    rx  w1  x1+2      ;
    rs  w3  x1+0      ;
    rx  w1  x3+2      ;
    rs  w1  x1+0      ;
    jl         (0)    ;
e.                    ;
b.  f5,g5 w.          ;
    ;; search a link in state.w0 in input chain
    ; if found then return 0
    ; else return 2
    ; return: w0, w2 unchanged.  w1=link
b13:                  ;
    ds. w0     g0.    ;
    al. w1     h32.   ; w1:=link head for input
    sn  w1     (x1)   ; if chain is empty then
    jl.        f1.    ; return 0
f0: rl  w1  x1        ; w1:=next link
    sn  w0     (x1+a62); if link is in state.w0
    jl.        f2.    ; goto return 2;
    se. w1     h32.   ; if more links then
    jl.        f0.    ; get next
f1: am         -2     ; else return 0
f2: al  w3     2      ; return 2
    rl. w0     g0.    ;
    wa. w3     g3.    ;
    jl      x3        ;
g3: 0                 ;
g0: 0                 ;
e.                    ;
b.  f5,g5 w.          ;
    ;; search a link in state.w0 in output chain
    ; if found then return 2
    ; else return 0
    ; return: w0, w2 unchanged.  w1=link
b14:                  ;
    ds. w0     g0.    ;
    al. w1     h31.   ; w1:=link head for input
    sn  w1     (x1)   ; if chain is empty
    jl.        f1.    ; then goto return 0
f0: rl  w1  x1        ; w1:=next link
    sn  w0     (x1+a62); if link is in state.w0
    jl.        f2.    ; goto return 2;
    se. w1     h31.   ; if more links then
    jl.        f0.    ; get next
f1: am         -2     ; else return 0
f2: al  w3     2      ; return 2
    rl. w0     g0.    ;
    wa. w3     g3.    ;
    jl      x3        ;
g3: 0                 ;
g0: 0                 ;
e.                    ;
b.  f5,g5 w.          ;
    ;; search a link with i-o id=w0  in output chain
    ; if found then return 2
    ; else return 0
    ; return: w0, w2 unchanged.  w1=link
b15:                  ;
    ds. w0     g0.    ;
    al. w1     h31.   ; w1:=link head for output
    sn  w1     (x1)   ; if chain is empty then
    jl.        f1.    ; return 0
f0: rl  w1  x1        ; w1:=next link
    bz  w3  x1+a64+1  ; w3:=i-o id
    sn  w0  x3        ; if link.id is =w0
    jl.        f2.    ; goto return 2
    se. w1     h31.   ; if more links then
    jl.        f0.    ; get next
f1: am         -2     ; else return 0
f2: al  w3     2      ; return 2
    rl. w0     g0.    ;
    wa. w3     g3.    ;
    jl      x3        ;
g3: 3                 ;
g0: 0                 ;
e.                    ;
b.  f5,g5 w.          ;
    ;; search a link  with i-o id = w0   in input chain
    ; if found then return 2
    ; else return 0
    ; return: w0, w2 unchanged.  w1=link
b16:                  ;
    ds. w0     g0.    ;
    al. w2     h31.   ; w1:=link head for input
    sn  w1     (x1)   ; if chain is empty then
    jl.        f1.    ; goto return 0
f0: rl  w1  x1        ; w1:=next link
    bz  w3  x1+a64+1  ; w3:=io id.link
    sn  w0  x3        ; if link is in state.w0
    jl.        f2.    ; goto return 2
    se. w1     h32.   ; if more links then
    jl.        f0.    ; get next
f1: am         -2     ; else return 0
f2: al  w3     2      ; return 2
    rl. w0     g0.    ;
    wa. w3     g3.    ;
    jl      x3        ;
g3: 0                 ;
g0: 0                 ;
e.                    ;
b.  g5 w.             ;
b18:                  ; send message to clock
    rs. w3     g3.    ; save return
    al  w3     0      ;
    al  w0     1      ; w3,w0:=mode,delay
    al. w1     h9.    ;w1:=buf
    ds  w0  x1+2      ;
    al. w3     h11.   ;
    jd         1<11<16;

    rs. w2     h17.   ; save buf addr
    jl.        (g3.)  ;
g3: 0                 ;
e.                    ;
b.  g5 w.             ;
b19:                  ; return buf
    rs. w3     g3.    ; save return
    rl  w2  x1+a63    ; w2:= buf
    rs. w1     g1.    ; save link
    al  w3     512    ; w3:=2.0010 0000 0000
    hs  w3  x2+a8+1   ; set status
    al  w0     1      ;
    rs  w0  x2+a40    ; set result
    al. w3     h10.   ; w3:=master proc
    jd         1<11+34; move buf to master
    rl. w1     g1.    ;w1:=link
    jl. w3     b12.   ; remove link
    al. w2     h33.   ; w2:=free link head
    jl. w3     b11.   ; insert link
    jl.        (g3.)  ; return
g1: 0                 ;
g3: 0                 ;
e.                    ;
b.  f5,g5 w.          ;
b20:                  ; set up chain with free links
    rs. w3     g3.    ;
    al  w0     0      ;
    al. w2     h33.   ; w2:=head
    al. w1     h20.   ; w1:=first
f0: jl. w3     b11.   ; chain link
    rs  w0  x1+a65    ; set link-id
    ba. w0     1      ;
    al  w1  x1+a70    ; w1:=next link
    sh  w0     127    ;
    jl.        f0.    ;
    jl.        (g3.)  ;
g3: 0                 ;
e.                    ;

\f


b.  f10,g10 w.        ;
b4:                   ;
    al. w1     g0.    ;
    al. w3     g1.    ;
    jd         1<11+42; lookup(<:kkmon8004:>)
    se  w0     0      ; if not found then
    jl.        f5.    ; goto f5
    rl. w1     h7.    ; w1:=own process desc addr
    rl  w2  x1+24     ; w2:=last byte
    al. w1     h20.   ; first byte
    rs. w1     g3.    ;
    ws  w2     2      ; w2:=buffer length
    ls  w2     -9     ; in segments
    rs. w2     g9.    ;
    rl. w1     g0.    ; w:=monitor length
    al  w0     0      ;
    wd  w1     4      ; w1:=number af shares
    se  w0     0      ;
    al  w1  x1+1      ; round
    rs. w1     g6.    ;
    al. w1     g6.    ;
    al  w0     2      ;
    ds. w1     (h0.)  ; set(byte,addr)
    jl. w3     b0.    ; send output request to HC8000
    jl.        f5.    ; if buserror then goto f5
    al  w0     20     ;
    jl. w3     b2.    ; wait for channel output finis
    al. w1     h20.   ;
    rl. w0     g9.    ; w0:=share length
    ls  w0     9      ; in halfwords
    ds. w1     (h0.)  ; set(byte,addr)
    al. w3     g1.    ;
    jd         1<11+52;
    jd         1<11+8 ; create and reserve(<:kkmon8004:>)
    se  w0     0      ; if error then
    jl.        f5.    ; goto f5
f1: al. w3     g1.    ;
    al. w1     g2.    ;
    jd         1<11+16; input next share
    al. w1     g8.    ;
    jd         1<11+18;  wait for input finis
    se  w0     1      ; if error then
    jl.        f5.    ; goto f5
    jl. w3     b0.    ; send output request
    jl.        f5.    ; if buserror then
    al  w0     20     ; else wait
    jl. w3     b2.    ; for output finis
    rl. w3     g3.    ;
    wa. w3     g9.    ;
    rs. w3     g3.    ; count segments
    sl. w3     (g0.)  ; if no more then
    jl.        f3.    ; goto stop
    jl.        f1.    ; else start input
f3: al. w3     g1.    ;
    jl.        f6.    ; goto remove process
f5: al. w3     g1.    ;
    jd         1<11+4 ; if process exist then
    se  w0     0      ;
f6: jd         1<11+64; remove process
    jl.        i0.    ; goto wait
g0: 0,r.10            ; tail
g1: <:kkmon8004:>,0,0 ;
g2: 3<12 + 0          ; input message
g3: 0                 ; first addr
g4: 0                 ; last addr
g5: 0,r.5             ; segment
g6: 0                 ; number of shares
g7: 1<23              ; message
g8: 0,r.8             ;
g9: 0                 ; share length
e.                    ;
h20:                  ; buffer start addr
e.                    ;

    g2=k              ;
g1:                   ;
g0: 1                 ; size
    0,r.4             ; name
    s2                ; clock
    0                 ; file
    0                 ; block
    3<12+0            ; contents
    g2                ; size

d.                    ;
p.  <:fpnames:>       ;
p.  <:insertproc:>    ;
▶EOF◀