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

⟦a45ffada9⟧ TextFile

    Length: 36096 (0x8d00)
    Types: TextFile
    Names: »micronetm«

Derivation

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

TextFile


;;;;;;;;   Microcomputer network ;;;;;;;;
;;;;;;;;   M6800 version         ;;;;;;;;
m.                microcomputer network

;Anders Lindgård
;1978-10-02
;1979-02-19
;1979-06-12
;1979-11-07
;1980-10-08

;This system consist of a number of process types:
;
;micronetwork dma   process (106)
;micronetwork trm   process (108)
;micronetwork rec   process (110)
;micronetwork sys   process (112)
;micronetwork local process (114)
;micronetwork per   process (116)

; the system processes are not reentrant so only one systrm,
; sysrec,sysdma and sysmain may exist.

;;;;;;;;;;;;    common procedures   ;;;;;;;;;;
;
b. p10, f7
; p names are used for procedures common
; q names are used for calling the other processes( eq to h names)
; 
; use of q names:
; q4 =entry sys trm
; q5 =entry sys rec
; q6 =entry sys dma
; q7 =entry sys main
; q8 =entry answer dma
; q9 = entry answer trm
; q10=entry answer rec
; q14=entry send   local
; q15=entry answer local
; q17=entry answer sys main
;
; f names are used for the bufferindex table
  f0=a121
  f1=f0+1
  f2=a78+4
  f3=768 ; blocksize
  f4=12  ; size of blockheader
  f5=f3+f4;
;
  f6=3   ; max blockindex (1.2.3... maxblockindex<8)
; format of optional words of process descriptions:
; a70: <chain mask for autoload>
; a71: <entry point for send (own entry)>
; a72: <autoload chain (end of chain=0)>
; a73: <entry point answer (own entry)>
; a74: <operation mask><priviledged>
; a75: <identification word>
; a76: <exchange return point (b20)>
; a77: <work>
; a78: <work or pda>
; a78+2: <identification word of user for i/o>
; f2:  <bufindex 0><bufindex1> .... for local
; a78+2: <pda of sysxxx>
; a78+4: <pda of sysyyy>
;
; message format to transmitter
;
; operation codes
; sense              0<3
; start              2<3
; transfer completed 4<3
; stop               6<3
; autoload           8<3
; find block index  10<3
; release block     12<3
; wait block        14<3
; input              3<3
; output             5<3
;
;operation codes to local microcomputer
;
; 0<12+mode     ; sense
; 2<12+mode     ; start
; 6<12+mode     ; stop
; 8<12+mode     ; autoload
;10<12+mode     ; lock
;12<12+mode     ; unlock
; 3<12+mode     ; input
; 5<12+mode     ; output
;
; lock will reserve all processes below in the hierarchy
; and reject all pending messages.
; unlock will release all reservation below in the hierarchy
; autoload will send an autoload message and perform a lock
;
;
;  0 1           7 8              16    18      2223
;----------------------------------------------------!
; 0!  opcode      !    address     (      )      ! 0 !
;----------------------------------------------------!
;      receiver                             ! buf ! 1!
;----------------------------------------------------!
;  0                                       1920  2223
;
; answer format from receiver
;
;  0 1           7 8    1112    1516  1819    2223
;-------------------------------------------------!
; 1! status      ! no    ! level !block! pst   ! 0!
;-------------------------------------------------!
;   receiver                             ! buf ! 1!
;-------------------------------------------------!
;  0                                    1920  2223
;
; in transfer completed "address" is by convention regarded
; as a blocknumber

; message buffer format (before answer)
; +8  <operation> <mode>
; +10 <first address>
; +12 <last  address>
; +14 <coroutine index> <first address local micro>
; +16 <message or answer>
; +18 <receiver word>
; +20 <save message or answer>
; +22 <save buf+4>
\f



; procedure compute address
; computes an address from a blockindex
; given in an answer (x2+16) 
; blockindices are numbered 1,2,3,4,5,6,7
;    call      return
; w0           destroyed
; w1 proc      proc
; w2 buf       buf
; w3 link      destroyed
b. i10               ;begin
w.                   ;
m.                      compute address
i8: 0,0              ; save address
i0: 7<5              ; mask for block index
i1: a122-f6*f5       ; base for block
i2: f5               ; blocksize in bytes
i3: f6               ; maxblockindex-1
i4: 8.7760 0000      ; first byte
i5: 0                ; link
i6: 7                ; last 3 bit
i7: f4               ; header size
p7:                  ;
      rs. w3  i5.    ; begin save link
      rl  w0  x2+18  ; micro:=
      ls  w0  -20    ; receiver shift -20
      wm. w0  i3.    ; index:=micro*maxblockindex;
      rl  w3  x2+16  ; curindex:=
      ls  w3  -5     ; answer shift -5
      la. w3  i6.    ; extract 3
      al  w3  x3-1   ; -1
      wa  w0  6      ; index:=index+curindex;
      wm. w0  i2.    ; address:=index*blocksize+
      wa. w0  i1.    ; base
      wa. w0  i7.    ; +header size
      la  w0  g68    ;
      rs. w0  i8.+2  ; save address
      rl  w3  x2+14  ; message:=address and
      la. w3  i4.    ;
      lo  w0  6      ; operation
      rs  w0  x2+14  ;
      rs. w0  i8.    ; save address
      jl.    (i5.)   ; end
e.

; procedure check privilege
;     call        return
; w0              destroyed
; w1  int         int 
; w2  buf         buf
; w3  link        destroyed
b. i5
w.
p0:                     ; entry check privilege
      rs. w3  i0.       ; save link
      rl  w3  b19       ; cur:=cur proc
      rl  w0  x3+a74    ; if priv bit
      so  w0  1         ; then
      jl.    (i0.)      ; begin
      bz  w0  x1+a22    ; mask:=int.function
      so  w0  1<8>5     ; if int.func.bit(8)=0 then
      jl      g5        ; goto result 3
      jl.    (i0.)      ;
i0:   0                 ; save link
e.                      ; end

; procedure examine queue(queue empty)
;     call    return
; w0          operation
; w1          proc
; w2          buf
; w3  link    sender

b. i2
w. p1:                 ; begin
      rs. w3  i2.      ;
i0:   rl  w1  b19      ; w1:=proc
      rl  w2  x1+a54   ; exam q: proc:= current receiver;
      sn  w2  x1+a54   ; if buf=mess q(proc)
      jl.    (i2.)     ; then goto empty
      rs  w2  b18      ; current buf:=buf
      rl  w3  x2+6     ; w3:=sender
      bz  w0  x2+8     ; operation:=buf.byte(8)
      am.    (i2.)     ;
      jl      2        ; link+2;
i2: 0                  ; link;
e.

; procedure send (buffer, receiver);
;     call
; w0
; w1  receiver
; w2  buf
; w3  link
;
m.                       send
b. w.
p2:                ; send entry 1
      jl  w3  d5     ; remove buf
p3:                  ; send entry 2
      rs  w1  b19    ; current receiver:=receiver;
      jl     (x1+a71); goto receiver
e.                   ; end
;
; autoload own and all children
; all pending buffers in the queue are returned to the sender
; with dummy answer , rejected
; for both this process and all members in the autoload chain
; having curproc anded with chainmask  as receiver in buf+18.
; it is assumed that "sysmain" and "sysrec" are the last members
; of the autoload chain. The autoload chain are process description
; adresses except for the end of the chain which is zero.
;
;     call       return
; w0  childmask  destroyed
; w1  proc       proc
; w2  buf        unchanged
; w3  link       unchanged
;
b. i10, j8             ;begin
w.
m.                       autoload
j0: 0                  ; mask
j1: 0                  ; proc
    0                  ; buf
j2: 0                  ; link
j3: 0                  ; save buf
j4: 0                  ; save child
j5: 0                  ; id word
p4:                    ; entry autoload
      ds. w3  j2.      ; save buf,link
      ds. w1  j1.      ; save proc and mask
      rs. w1  j4.      ; child:=cur
      rl  w0  x1+a75   ; id word:=
      rs. w0  j5.      ; proc.id_word;
i0:                    ; start:
      rl  w2  x1+a54   ; buf:=next(mess q(proc))
      sn  w2  x1+a54   ; if buf=mess q(proc)
      jl.     i4.      ; then goto next child
      al  w0  x1+a54   ; savebuf:=buf;
      rs. w0  j3.      ;
i1:                    ; nextbuf:
      rl  w3  x2+18    ; w3:=receiver word
      la. w3  j0.      ; and child mask;
      se. w3 (j5.)     ; if id word(proc)<>receiver word(buf)
      jl.     i2.      ; then goto nextbuffer;
      al  w0  2        ; result:=2;
      hs  w0  x2+9     ; buf.byte(9):=result
      al. w3  i5.      ; return address:= new return
      rx  w3  b20      ; return:=return address
      rs  w3  x1+a76   ; save return:=old return
      rl  w1  x2+4     ; cur:=buf.receiver
      rs  w1  b19      ; curreceiver:=receiver
;      jl. w3  p8.      ; lock
      jl  w3  d5       ; remove buf
      jl     (x1+a73)  ; goto answer
i5:                    ; new return:
      rl. w1  j4.      ; child:=save child
      rs  w1  b19      ; curreceiver:=child
      rl  w3  x1+a76   ; return:=
      rs  w3  b20      ; save return
      rl. w2  j3.      ; buf:=save buf
i3:                    ; nextbuffer:
      rl  w2  x2       ; buf:=next(mess q(proc));
      sn  w2  x1+a54   ; if buf= last mess q(proc);
      jl.     i4.      ; then goto nextchild
      jl.     i1.      ; goto start;
i2:                    ; next buffer in queue:
      rs. w2  j3.      ; savebuf:=buf;
      jl.     i3.      ; goto next buffer
i4:                    ; next child
      rl  w1  x1+a72   ; cur:=next child(cur)
      rs. w1  j4.      ; save child:=cur;
      se  w1  0        ; if cur >0 then goto start
      jl.     i0.      ;
      dl. w1  j1.      ; restore
      dl. w3  j2.      ;
      rs  w1  b19      ; curproc:=saveproc
      jl      x3       ; end;
e.                     ; end autoload;


; procedure set coroutine index
;     call       return
; w0  index      destroyed
; w1
; w2
; w3  link       destroyed
;
b. i0
w. i0:0             ; link
p6:   rs. w3  i0.   ; save link
      rl  w3  x2+14 ; w2:=address
      la  w3  g68   ; w3:=micro address
      ls  w0  16    ;
      lo  w3  0     ; 
      rs  w3  x2+14 ;
      jl.    (i0.)  ; end
e.


; procedure lock processes;
; procedure unlock processes;
;     call       return
; w0             destroyed
; w1  proc       proc
; w2  buf        buf
; w3  link       link
b. i4,j6
w.                     ; begin
m.                     lock/unlock
j0: 0                  ; lock bit
j1: 0                  ; proc
j2: 0                  ; buf
j3: 0                  ; link
p8:                    ; lock:
      am      1        ;
p9:                    ; unlock:
      al  w0  0        ;
      ds. w3  j3.      ; save link, save buf
      ds. w1  j1.      ; save proc, save switch
      rl  w3  x2+6     ; w3:=sender;
      rl  w3  x3+12    ; w3:=sender.idword;
      sn  w0  0        ; if lock then reserver:=w3 else 0
      rs. w3  j0.      ;
      al  w3  x1       ; w3:=proc;
i1:                    ; search in chain:
      rl  w3  x3+a72   ; w3:=next_in_chain(w3);
      sn  w3  0        ; if chain exhausted
      jl.     i3.      ; then goto END
      rl  w0  x3+a75   ; w3:=proc.idword
      la  w0  x3+a70   ;  and chain mask;
      se  w0  x1+a75   ;  if match then
      jl.     i1.      ;  begin
      rl. w0  j0.      ;  proc.reserver:=
      rs  w0  x1+a52   ;  reserver;
      jl.     i1.      ;  end;
i3:                    ;  END:
      dl. w1  j1.      ;  restore
      dl. w3  j3.      ;  registers
      jl      x3       ; return
e.                     ; end;




;;;;;;;;;;      micronetwork dma process ;;;;;;;;;;
;
;process description format:
;
; a10: <kind=106>
; a11: <name>
; a50: <device number*64>
; a52: <reserved>
; a53: <user>
; a54: <next message>
; a55: <last message>
; a56: <interrupt address=c33>
; a78: <sysdma>
;
b. i10,  a0=1<23         ; begin
w.    a0>3+a0>5          ;
i0:   a0>0               ;
m.                       dma
h47:  jl. w3  p0.        ; check privilege
      jl  w3  g15        ; check reservation
      dl. w1  i0.        ;
      jl  w3  g16        ; check operation(3.5,0)
      rl  w1  b19        ; w1:=proc
      rl  w1  x1+a78     ; proc:=sysdma
      jl.     p3.        ; send (sysdma,buffer);

q8:                      ; answer address;
      bz  w0  x2+9       ; answer:=statue(2)
      rs  w0  x2+4       ; buf.result:=answer
      jl  w3  d15        ; send answer;
      jl     (b20)       ; goto return
e.                       ; end micronetwork dma process;


;;;;;;;;;;      micronetwork trm process ;;;;;;;;;;
;
;process description format:
;
; a10: <kind=108>
; a11: <name>
; a50: <device number*64>
; a52: <reserved>
; a53: <user>
; a54: <next message>
; a55: <last message>
; a56: <interrupt address=c33>
; a78: <systrm>
;
b. i10,  a0=1<23         ; begin
w.    a0>6+a0>8          ;
i0:   a0>0+a0>2          ;
m.                       trm
h48:  jl. w3  p0.        ; check privilege
      jl  w3  g15        ; check reservation
      dl. w1  i0.        ;
      jl  w3  g16        ; check operation(6.8,0)
      rl  w1  b19        ; proc:=curproc
      bz  w3  x2+8       ; if buf.operation=autoload then
      se  w3  8
      jl.     i3.        ; begin
      rl  w0  x1+a70     ; mask:=proc.autoloadmask
      jl. w3  p4.        ; autoload
      bz  w0  x2+9       ; mode:=buf.byte(9)
      se  w0  0          ; if mode>0 then goto answer
      jl.     i2.        ;
i3:                      ; end else begin
      dl  w0  x2+12      ; move message
      ds  w0  x2+18      ;
      rl  w1  x1+a78     ; cur:="systrm"
      jl.     p3.        ; send cur,mess);

i2:
      al  w0  1          ;
      rs  w0  x2+8       ; result:=1;
q9:                      ; answer:
      bz  w0  x2+9       ; w0:=result
      rs  w0  x2+4       ; buf.result:=result;
      jl  w3  d15        ; deliver answer;
      jl     (b20)       ; goto return
e.                       ; end micronetwork trm process;


;;;;;;;;;;      micronetwork rec process ;;;;;;;;;;
;
;process description format:
;
; a10: <kind=110>
; a11: <name>
; a50: <device number*64>
; a52: <reserved>
; a53: <user>
; a54: <next message>
; a55: <last message>
; a56: <interrupt address=c33>
; a78: <sysrec>
; a78+2: <systrm>
;
b. i10,  a0=1<23         ; begin
w.    a0>0+a0>8          ;
i0:   a0>0               ;
m.                       rec
h49:  jl. w3  p0.        ; check privilege
      jl  w3  g15        ; check reservation
      dl. w1  i0.        ;
      jl  w3  g16        ; check operation(0.8,0)
      rl  w1  b19        ; proc:=curproc
      dl  w0  x2+12      ;
      ds  w0  x2+18      ; move first and last to messarea
      bz  w3  x2+8       ; if operation=clear then
      se  w3  8
      jl.     i3.        ; begin
      rl  w0  x1+a70     ; mask:=proc.autoloadmask
      jl. w3  p4.        ; autoload
      al  w0  1          ; result:=1;
      hs  w0  x2+9       ; buf.byte(9):=result
      jl.     i2.        ; goto send answer
i3:                      ; end else begin
      rl  w1  x1+a78     ; cur:="rec"
      jl.     p3.        ; send
i2:                      ; send answer
q10:                     ; answer:
      bz  w0  x2+9       ; result:=buf.byte(9)
      rs  w0  x2+4       ; buf.result:=result;
      dl  w0  x2+18      ;
      ds  w0  x2+12      ; move answer
      jl  w3  d15        ; deliver answer;
      jl     (b20)       ; goto return
e.                       ; end micronetwork rec process;


;;;;;;;;;;      micronetwork sys dma process ;;;;;;;;;;
;
;process description format:
;
; a10: <kind=112>
; a11: <name>
; a50: <device number*64>
; a52: <reserved>
; a53: <user>
; a54: <next message>
; a55: <last message>
; a56: <interrupt address=c33>
;
b. i10,  a0=1<23         ; begin
m.                       sysdma
w. i0: 0                 ; save proc
q6:                      ; begin
      jl  w3  g17        ; link operation
i1:                      ; start:
      rs. w1  i0.        ; save proc:=proc
      jl  w3  g34        ; exam sender(done)
      jl.     i5.        ; goto end
      bz  w3  x2+8       ;w3:=operation
      sn  w3  3          ; if operation=3 then
      am      4          ; modifier:=9 else
      al  w3  5          ; else modifier=5
      rl  w0  x2+10      ; w0:=first address
      am     (x1+a50)    ;
      io  w0  x3         ; io(control,first address);
      sx      2.11       ; if exception then
      jl.     i2.        ; goto disconnect;
      rl  w3  x2+14      ; micro address:=
      la  w3  g68        ;
      am     (x1+a50)    ; buff(14) extract 16;
      am      -2<6       ; devaddress:=main-2;
      io  w3  1          ; io(control,devaddess,microaddress);
      sx      2.11       ; if exception then
      jl.     i2.        ; goto disconnect
      rl  w3  x2+12      ; words:=
      ws  w3  0          ; (last-first
      al  w0  x3+2       ; set bytes transferred;
      rs  w0  x2+10      ;
      rl  w3  x2+4       ; org:=buf.receiver
      rl  w0  x3+a10     ; kind:=org.kind
      rl  w3  x2+10      ;
      sn  w0  106        ; if kind<>dma
      jl.     i6.        ; then begin
      sh  w3  510        ; if bytes>=512 then
      jl.     i7.        ; begin
      al  w3  512        ; bytes:=512
      rs  w3  x2+10      ;
i6:   al  w3  x3-2       ;
      ls  w3  -1         ; ) //2;
      am     (x1+a50)    ;
      io  w3  1          ; io(control,words);
      sx      2.11       ; if exception then
      jl.     i2.        ; goto disconnect;
      jl  w3  g31        ; increase stopcount
      jl  w3  c32        ; wait interrupt
      jl  w3  g32        ; decrease stop count
      rl  w2  b18        ; w2:=buf
      rl  w1  b19        ; w1:=proc
      al  w3  c33        ; interrupt address:=
      rs  w3  x1+a56     ; dummy interrupt
      io  w0 (x1+a50)    ; io(sense,status);
      sx      2.11       ; if exception then
      jl.     i2.        ; goto disconnect
i3:   rs  w0  x2+8       ;
      am      -2         ; result:=1 or
i7:   am      -1         ; or 3
i2:   al  w0  4          ; disconnect: 4;
      hs  w0  x2+9       ; buff.byte(9):=result;
      al. w3  i4.        ; w3:=return
      rx  w3  b20        ; exchange return
      rs  w3  x1+a76     ; save return:=old return
      jl  w3  d5         ; remove buf
      rl  w1  x2+4       ; cur:=buf.receiver
      jl     (x1+a73)    ; goto answer
i4:                      ; return point:
      rl.  w1  i0.       ; cur:=save proc
      rs   w1  b19       ; curproc:=cur;
      rl  w3  x1+a76     ; ret:=save return
      rs  w3  b20        ; return:=save return
      jl. w3  p1.        ; examine queue
      jl     (b20)       ; goto return
      jl.     i1.        ; goto start

i5:                      ; sender stopped:
      al  w0  0          ; bytes:=
      rs  w0  x2+10      ; 0;
      al  w0  0          ; status:=0
      jl.     i3.        ; end
e.                       ; end micronetwork sys dma process;


;;;;;;;;;;      micronetwork sys trm process ;;;;;;;;;;
;
;process description format:
;
; a10: <kind=112>
; a11: <name>
; a50: <device number*64>
; a52: <reserved>
; a53: <user>
; a54: <next message>
; a55: <last message>
; a56: <interrupt address=c33>
; a77: <modifier for 1. or 2. word>
; a78: <no of interrupts>
;
b. i10,  a0=1<23         ; begin
w.                       ;
m.                       systrm
i7: 0,0                  ; save read
i5: 0,0                  ; save command
i0: 0                    ; save proc
q4:                      ; begin
      jl  w3  g17        ; link operation
      rs. w1  i0.        ; save proc
i1:                      ; start:
      al  w3  0          ; modifier:=
      rs  w3  x1+a77     ; 0;
i3:   am      x3         ; next word:
      rl  w0  x2+16      ; w0:=data
      rs. w0  x3+i5.     ; save command:=command;
      am     (x1+a50)    ;
      io  w0  3          ; io(write,data); com 0);
      sx      2.11       ; if exception then
      jl.     i2.        ; goto disconnect;
      jl  w3  c32        ; wait interrupt
      rl  w3  x1+a78     ; no of interrupts:+
      al  w3  x3+1       ; 1;
      rs  w3  x1+a78     ;
      jl.  w3  p1.       ; examine queue
      jl       (b20)     ;
      io  w0 (x1+a50)    ; io(sense,status);
      sx      2.11       ; if exception then
      jl.     i2.        ; goto disconnect
      rl  w3  x1+a77     ; w3:=modifier;
      rs. w0  x3+i7.     ; save word read
      se. w0 (x3+i5.)    ; if command<>
      jl.     i3.        ; goto repeat
      al  w3  x3+2       ; modifier:=modifier+2;
      rs  w3  x1+a77     ;
      sh  w3  2          ; if modifier<2 then goto next word
      jl.     i3.        ;
      am      -3         ; result:=1 or
i2:   al  w0  4          ; disconnect: 4;
      hs  w0  x2+9       ; buf.byte(9):=w0;
      al  w3  c33        ; interrupt return:=
      rs  w3  x1+a56     ; dummy interrupt
      al. w3  i4.        ; w3:=return
      rx  w3  b20        ; exchange return
      rs  w3  x1+a76     ; save return:=old return
      jl  w3  d5         ; remove buf
      rl  w1  x2+4       ; cur:=buf.receiver
      jl     (x1+a73)    ; goto answer
i4:                      ; return point:
      rl. w1  i0.        ; proc:=save proc
      rs  w1  b19        ; curproc:=proc
      rl  w3  x1+a76     ; return:=
      rs  w3  b20        ; save return
      jl. w3  p1.        ; examinge queue
      jl     (b20)       ; goto return
      jl.     i1.        ; goto start
e.                       ; end micronetwork trm process;


;;;;;;;;;;      micronetwork sys rec process ;;;;;;;;;;
;
;process description format:
;
; a10: <kind=112>
; a11: <name>
; a50: <device number*64>
; a52: <reserved>
; a53: <user>
; a54: <next message>
; a55: <last message>
; a56: <interrupt address=c51>
; a77: <first or second>
; a78: <no of interrupts>
;
b. i15,  a0=1<23         ; begin
w.                       ;
m.                       sysrec
i0: 0                    ; save proc
i5: 0,0                  ; save answer
i6: 0                    ; save result
q5:                      ; begin
      jl  w3  g17        ; link operation
      jl     (b20)       ; goto return
c51:                     ; wait interrupt
      rl  w3  x1+a78     ; no of interrupts:+
      al  w3  x3+1       ; 1;
      rs  w3  x1+a78     ;
      jl. w3  p1.        ; examine queue
      jl.     i8.        ; goto return
      al  w0  1          ; result:=1;
      rs. w0  i6.        ; save result:=result
      am     (x1+a50)    ;
      io  w0  4          ; io(sense,data); com 1;
      sx      2.11       ; if exception then
      jl.     i3.        ; goto disconnect;
      sz  w0   1         ; if 2.word then
      jl.      i9.       ; goto 2.
      am     (x1+a50)    ;
      io  w0  7          ; io(write,data); com 1;
      sx      2.11       ; if exception then
      jl.     i3.        ; goto disconnect
      sz  w0  1          ; if 2.word then address:=address+2;
i9:   am      2          ;
      rs. w0  i5.        ; data(i):=data
      la  w0   g63       ; extract 1
      se  w0 (x1+a77)    ; if word<> wordno.proc
      jl.     i8.        ; goto error
      al  w3  1          ; word:=
      wa  w3  0          ; (word+1)
      la  w3  g63        ; mod 2
      rs  w3  x1+a77     ;
i4:   so  w0   1         ; if 1. word then
      jl      (b20)      ; goto wait interrupt
i7:   rl  w2  x1+a54     ; buf:=head q(proc9;
      rl. w0  i5.+2      ; w0:=answer.2
i1:                      ; next buffer:
      rl  w3  x2+18      ; rec:=buf.rec
      sn  w0  x3        ; if rec<> rec(received) then
      jl.     i2.        ; begin
      rl  w2  x2         ; buf:=link(buf)
      se  w2  x1+a54     ; if buf <> last q(proc)
      jl.     i1.        ; goto start
i8:   al  w0  0          ; word.proc:=0
      rs  w0  x1+a77     ;
      jl     (b20)       ; wait interrupt
i2:                      ; found:
      rl. w0  i6.        ; if result=1 then
      se  w0  1          ; begin
      jl.     i10.       ;
      rl. w0  i5.+2      ; send 2.word
      am     (x1+a50)    ;
      io  w0  7          ; io(write,data)
      sx      2.11       ; if exception then
      jl.     i3.        ; goto diconnect;
      rl. w0  i6.        ; result:=save result
i10:  hs  w0  x2+9       ;
      dl. w0  i5.+2      ; buf.answer:=
      ds  w0  x2+18      ; answer
      jl  w3  d5         ; remove buf
      rs  w2  b18        ; curbuf:=buf
      rl  w1  x2+4       ; w1:=proc.buf
      jl     (x1+a73)    ; goto answer
i3:                      ; error
      al  w0  4          ; result:-4
      rs. w0  i6.        ;
      jl.     i7.        ; goto find buf
e.                       ; end micronetwork rec process;

;;;;;;;;;;;; micronetwork sys main ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; process description format
;
; a10: <kind=112>
; a11: <name>
; a50: <not used>
; a52: <reserved>
; a53: <user>
; a54: <next message>
; a55: <last message>
; a56: <interrupt address>
; a78: <sysdma>
; a78+2: <systrm>
; a78+4: <sysrec>
;
b. i20, j20                 ; begin
w.                          ;
m.                       sysmain
i4: 7<5                     ; blockindex
j0: j1,j2,j3,j4,j5,j6,j7,   ; coroutine
    j8,j9,j10,j11,j12,j13   ; indices
q17:                        ; entry answer
      bz  w0  x2+9          ; if result <> 1
      se  w0  1             ;
      jl.     j2.           ; goto local
      bz  w3  x2+14         ; index:=
      ls  w3  -4            ; buf.byte(14) shift -4;
      jl.    (x3+j0.)       ; case index of
q7:                         ; entry from send
      bz  w3  x2+8          ; op:=buf.operation
      sz  w3  1             ; if op=even
      jl.     i6.           ; then begin
      al  w0  0             ; coroutine index:=
      jl. w3  p6.           ; 0;
      jl.     i5.           ; goto send
j1:                         ; answer 0
      al  w0  2             ; coroutine index:=2;
      jl. w3  p6.           ;
      al  w0  0             ; clear operation
      hs  w0  x2+8          ;
      rl  w1  x1+a78+4      ; send (rec,mess)
      jl.     p3.           ;
j2:                         ; answer 2
      rl  w1  x2+22         ; proc:=save proc
      rs  w1  b19           ; curproc:=proc
      jl     (x1+a73)       ; goto local
i6:                         ; begin comment block i/o
      rl  w0  x2+18         ; if buf.level0.no<>0
      ls  w0  -20           ;
      sn  w0  0             ; then
      jl.     i9.           ; begin
      se  w3  3             ; if input then
      jl.     i8.           ; begin
      al  w0  4             ; coroutine index:=4
      jl. w3  p6.           ;
i5:                         ; send first
      rl  w3  x2+4          ; rec:=buf.receiver
      rs  w3  x2+22         ; save receiver:=rec;
      rs  w1  x2+4          ; buf.receiver:=cur;
      rl  w1  x1+a78+2      ; rec:="trm"
      jl.     p3.           ; send
j3:                         ; answer 4
      al  w0  6             ; coroutine index:=6
      jl. w3  p6.           ;
      rl  w1  x1+a78+4      ; rec:="rec"
      jl.     p3.           ; send
j4:                         ; answer 6
      al  w0  8             ; coroutine index:=
      jl. w3  p6.           ;
      jl. w3  p7.           ; compute address
      rl  w1  x1+a78        ; rec:="dma"
      jl.     p3.           ; send dma
j5:                         ; answer 8
      rl  w3  x2+16         ; move answer
      rs  w3  x2+20         ; to work
      rl  w0  x2+10         ; bytes:=buf.byte(8)
      sn  w0  0             ; if bytes=0 then op*=14 ; wait block
      am      2             ;
i7:   al  w0  12            ; op:=12 ; release block
      ls  w0  16+3          ;
      rl  w3  x2+16
      la. w3  i4.           ; blockindex:=
      lo  w0  6             ; message:=release block
      rs  w0  x2+16         ;
      bz  w0  x2+8          ; save result and status
      hs  w0  x2+15         ;
      bz  w0  x2+9          ;
      hs  w0  x2+12         ;
      al  w0  10            ; coroutine index:=
      jl. w3  p6.           ; 10
      rl  w1  x1+a78+2      ; rec:="trm"
      jl.     p3.           ; send
j6:                         ; answer 10
      al  w0  12            ; coroutine index:=
      jl. w3  p6.           ; 12;
      rl  w1  x1+a78+4      ; rec:="rec"
      jl.     p3.           ; send
j7:                         ; answer 12
      rl  w0  x2+20         ;
      rx  w0  x2+16         ; exchange answers
      rs  w0  x2+20         ;
      bz  w0  x2+15         ; result:= save
      ls  w0  12            ;
      hl  w0  x2+12         ; result;
      se  w0  1             ;
      rs  w0  x2+8          ;
      jl.     j2.           ; goto return

i8:                         ; output:
      rl  w0  x2+16         ;
      rs  w0  x2+20         ; save mess
      al  w0  10            ; op:=10 "find block index"
      ls  w0  16+3          ;
      rs  w0  x2+16         ;
      al  w0  14            ; coroutine index:=14;
      jl. w3  p6.           ; send
      jl.     i5.           ; send first("trm",findblockindex)
j8:                         ; answer 14:
      al  w0  16            ; coroutine index:=16
      jl. w3  p6.           ;
      rl  w1  x1+a78+4      ; rec:="rec"
      jl.     p3.           ; send
j9:                         ; answer 16:
      al  w0  18            ; coroutine index:=18;
      jl. w3  p6.           ;
      jl. w3  p7.           ; compute micro address
      rl  w1  x1+a78        ; rec:="dma"
      jl.     p3.           ; send
j10:                        ; answer 18 (from dma)
      rl  w3  x2+20         ; 
      rx  w3  x2+16         ; exchange output
      rs  w3  x2+20         ;
      bz  w0  x2+8          ; status:=buf.byte(8)
      se  w0  0             ; if status<>0 then send
      jl.     i7.           ; release block
      al  w0  20            ; coroutine index:=
      jl. w3  p6.           ; 20;
      rl  w1  x1+a78+2      ; rec:="trm"
      jl.     p3.           ; send
j11:                        ; answer 20 (from trm (output))
      al  w0  22            ; coroutine index:=22;
      jl. w3  p6.           ;
      rl  w1  x1+a78+4      ; rec:="rec"
      jl.     p3.           ; send
j12:
      jl.     j2.           ; goto return

i9:                         ; block input/output for main
      al  w0  24            ; coroutine index=24
      jl. w3  p6.           ;
      al  w0  0             ; message:=0;
      rs  w0  x2+16         ;
      rl  w1  x1+a78        ; rec:="dma"
      jl.     p3.           ;
j13:                        ; answer 24 (from dma)
      jl.     j2.           ; goto return
e.                          ; end



;;;;;;;;;;;; micronetwork local microcomputer process ;;;;;;;;;;;;;
;
;process description format

;
; a10: <kind=114>
; a11: <name>
; a50: <not used>
; a52: <reserved>
; a53: <user>
; a54: <next message>
; a55: <last message>
; a56: <interrupt address=c33>
; a78: <sysmain>
;
b. i10, a0=1<23          ; begin
w.    a0>0+a0>2+a0>4+a0>6+a0>8+a0>10+a0>12+a0>3+a0>5
i0:   8.77400000         ;
m.                       local
h51:                     ; wait message:
      jl. w3  p0.        ; check privilege
      jl  w3  g15        ; check reservation
      dl. w1  i0.        ;
      jl  w3  g16        ; check operation(0.2.4.6.8.10.12.3.5,0.1.2.3.4.5.6.7);
      rl  w1  b19        ; proc:=curproc
      bz  w0  x2+8       ; if operation>=8
      sh  w0  6          ; then
      jl.     i2.        ; begin
      sn  w0  12         ; if operation=unlock
      jl.     i6.        ; then goto unlock
      rl  w0  x1+a70     ; mask:=autoload mask
      jl. w3  p4.        ; autoload(mask)
      al  w3  c33        ; return:=dummy interrupt
      bz  w0  x2+8       ; if operation=lock
      se  w0  8          ; then
      jl      g26        ; deliver result(1);
      al  w3  f0         ; bufindex:=max bufindex
      jl.     i4.        ; goto buffer found
i6:                      ; unlock:
      jl. w3  p9.        ;
      al  w3  c33        ; return=dummy
      jl      g26        ; deliver reesult(1);
i2:                      ; send message:
q14:                     ; entry send
      al  w3  0          ;
i3:                      ; next index:
      am      x1+f2      ;
      bz  w0  x3         ; index:=proc.index(curindex)
      sl  w0  f0         ; if buf index<max buffer index then
      jl.     i4.        ; goto index found
      al  w3  x3+1       ; curindex:=curindex+1;
      sh  w3  f0-1       ; if curindex<maxindex then
      jl.     i3.        ; goto next index
      jl  w3  g17        ; link operation
      jl     (b20)       ; begin
i4:                      ; buffer found:
      am      x1+f2      ; proc.bufindex:=
      hs  w3  x3         ; bufindex;
      rs  w3  x1+a77     ; work:=bufindex
      bz  w0  x2+8       ; op:=buf.operation
      ls  w0  3         ; 1. word:=op shift 3
      bz  w3  x2+9       ; mode:=buf.mode
      lo  w0  6          ; 1.word:=1.word + mode
      ls  w0  16         ; shift 16
      bz  w3  x2+8       ; if buf.operation
      so  w3  1          ; then address:=
      am      -4         ; buf.10 else
      rl  w3  x2+14      ; address:=buf.14
      la  w3  g68        ; extract 16;
      la  w3  g50        ; and -2
      lo  w3  0          ;
      rs  w3  x2+16      ; buf.message:=
      rl  w0  x1+a75     ; w0:=id word
      rl  w3  x1+a77     ; w3:=bufindex
      ls  w3  1          ;
      al  w3  x3+1       ; shift 1 add 1;
      lo  w0  6          ; or bufindex
      bz  w3  x2+8       ; if buf.operation=4 or
      sn  w3  4          ;
      jl.     i5.        ;
      bz  w3  x2+9       ; if buf.mode>0
      se  w3  0          ;  or
;      jl.     i5.        ;
;      bz  w3  x2+8       ; buf.operation=odd then
;      sz  w3  1          ;
i5:   lo  w0  x1+a78+2   ; idword:=idword + 15<(level-1)
i8:   rs  w0  x2+18      ; 2. word:= receiver id and buf index
      rl  w1  x1+a78     ; rec:="sysmain"
      jl.     p3.        ; send
i10: 7<1                 ; buf index mask
q15:                     ; answer:
      rl  w3  x2+18      ; w3:=answer.2
      la. w3  i10.       ; and bufindex mask
      ls  w3  -1         ; //2;
      al  w0  -1         ;
      am      x1+f2      ; proc.bufindex:=
      hs  w0  x3         ; :=2047;
      bz  w0  x2+9       ; result:=buf.byte(9);
      rs  w0  x2+4       ; buf.result:=result;
      rl  w0  x2+16      ; status:=
      ls  w0  1          ; 1.word answer and 255<16
      ls  w0  -17        ;
      hs  w0  x2+9       ;
      rl  w0  x2+16      ; buf.progsw:=
      la. w0  i9.        ; primanswer.progsw;
      ls  w0  -1         ;
      rs  w0  x2+12      ;
      jl  w3  d15        ; send answer
      jl. w3  p1.        ; examine queue
      jl     (b20)       ; goto return
      jl  w3  d5         ; remove buf
      jl.     i2.        ; goto start
i9:   15<1               ; mask program status word;
e.                       ; end



;;;;;;;;;;;; micronetwork local peripheral process ;;;;;;;;;;;;;
;
;process description format

;
; a10: <kind=116>
; a11: <name>
; a50: <not used>
; a52: <reserved>
; a53: <user>
; a54: <next message>
; a55: <last message>
; a56: <interrupt address=c33>
; a78: <sysmain>
;
b. i10, a0=1<23          ; begin
w.    a0>0+a0>3+a0>5
i0:   8.77400000         ;
m.                       local peripheral
h52:                     ; wait message:
      jl  w3  g15        ; check reservation
      rl  w3  b19        ; cur:=curproc
      rl  w0  x1+a74     ; w0:=cur.mask
      la  w0  g50        ; - priv
      rl. w1  i0.        ;
      jl  w3  g16        ; check operation(0.3.5,0);
      rl  w1  b19        ; proc:=curproc
      rl  w1  x1+a78     ; rec:="sysmain"
      jl.     p3.        ; send
e.                       ; end
m.                       end micronetwork
e.                       ; end micronetwork system
▶EOF◀