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

⟦b7a19773f⟧ TextFile

    Length: 45312 (0xb100)
    Types: TextFile
    Names: »activity3tx «

Derivation

└─⟦01e83a425⟧ Bits:30008166 Bånd med SW8010 og SW8500 source code
    └─⟦75ff9bef3⟧ 
        └─⟦this⟧ »activity3tx « 

TextFile

 
; jz.fgs 1981.05.25     compile activity       algol 8, activity, page 0
 
 
 
; fp commands:
 
; (activity = slang text
; activity newactivity passivate activate wactivity)
; finis)
 
 
b. e11, g1 w. ; begin block insertproc
k=10000       ;
 
d.
p. <:fpnames:>
l.
 
s. c10,d9, f0 w.  ; begin slang segment
 
e10 = 0           ; segmentno := 0;
f0  = 20          ; table size (=no of halfs in activitytable entry)
 
\f


 
; jz 1979.008.08        declare/new_activity    algol 8, activity, page 1
 
; segment 0 (1)
 
b. a18, b112, g3 w. ;
k=10000 , g0=0      ;
h.                  ;
 
e11:                ; segment base
b0:      g1 , g2    ; rel of last point , rel of last absword
b2:  1<11 o. 1 , 0  ; ref to segment 1
b3:  g0 +  3, 0     ; rs entry  3: reserve
b4:  g0 +  4, 0     ; rs entry  4: take expression
b6:  g0 +  6, 0     ; rs entry  6: end register expression
b13: g0 + 13, 0     ; rs entry 13: last used
b23: g0 + 23, 0     ; rs entry 23: youngest zone
b30: g0 + 30, 0     ; rs entry 30: saved sref, saved w3
b61: g0 + 61, 0     ; rs entry 61: (csr, cza)
b66: g0 + 66, 0     ; rs entry 66: store words at virtual storage
b74: g0 + 74, 0     ; rs entry 74: max last used
b75: g0 + 75, 0     ; rs entry 75: limit last used
b76: g0 + 76, 0     ; rs entry 76: temp last used
b77: g0 + 77, 0     ; rs entry 77: current activity (table entry address)
b78: g0 + 78, 0     ; rs entry 78: no of activities
b79: g0 + 79, 0     ; rs entry 79: base of activity table
b80: g0 + 80, 0     ; rs entry 80: aref (sref for activity decl block)
b81: g0 + 81, 0     ; rs entry 81: top of program
b82: g0 + 82, 0     ; rs entry 82: sref,segtabaddr for latest activate/new
b83: g0 + 83, 0     ; rs entry 83: relative of return - -      -       -
b84: g0 + 84, 0     ; rs entry 84: check passivate 
b85: g0 + 85, 0     ; rs entry 85: current activity no
b86: g0 + 86, 0     ; rs entry 86: current stack bottom
b90: g0 + 90, 0     ; rs entry 90: (disable,enable) entry points
b91: g0 + 91, 0     ; rs entry 91: trapchain
g2 = k - 2 - b0     ; define rel of last absword
 
b1:  1<11 o. 1, d2  ; entry point at segment 1 (passivate2)
b110:1<11 o. 2, d6  ; entry point segment 2 (release activities);
g1 = k - 2 - b0     ; define rel of last point
w.
e0: 0, 0, s3, s4    ; start external list: empty, date and time
 
\f


 
; jz 1979.08.08    declare activity (1)      algol 8, activity, page 2
 
; segment 0 (2)
 
 
e1 = 1<23 + e10<12 + k - b0 ; entry point: activity
     rl. w2 (b13.)     ; activity:
     ds. w3 (b30.)     ;   (saved sref, saved w3) := (last used, segbase);
     rl. w0  b1.       ;   rs(entry passivate2) :=
     am.    (b84.)     ;    entry point next segment
     rs  w0  -2        ;    (passivate2);
     rl. w1 (b80.)     ;   w1 := aref;
     se  w1  0         ;   if aref <> 0 then
     jl.     a2.       ;   goto alarm2;
 
     dl  w1  x2+8      ; take integer parameter:
     so  w0  16        ;   if expression then
     jl. w3 (b4.)      ;    take expression;
     ds. w3 (b30.)     ;   (saved sref, saved w3) := lastused,segbase;
 
     rl  w1  x1        ; check param:
     sl  w1  1         ;   if value(param) < 1
     sz. w1 (b100.)    ;   or value(param) >= 2**18 then
     jl.     a1.       ;   goto alarm1;
     rs. w1 (b78.)     ;   no of activities := value(param);
 
     wm. w1  b112.     ; reserve activity table:
     ac  w1  x1+6      ;   appetite := -no of activities*table_size - 6;
     jl. w3 (b3.)      ;   reserve;
     ds. w3 (b30.)     ;   save sref,w3;
     rl  w3  x2        ;   block(call sref) . last used :=
     al  w1  x1+6      ;    last used + 6;
     rs  w1  x3-2      ;   aref :=
     rs. w3 (b80.)     ;   call sref;
 
     dl  w0  x2+2      ; move return information:
     ds  w0  x1+2-6    ;   move return information
     bz  w0  x2+5      ;   from old stack top to
     rs  w0  x1+4-6    ;   new top; appetite:=0;
 
\f


 
; jz 1979.08.08    declare activity (2)       algol 8, activity, page 3
 
; segment 0 (3)
 
 
     al  w1  x1-f0     ;   base activity table :=
     rs. w1 (b79.)     ;    last used + 6 - table_size;
 
     al  w0  0         ; clear activity table:
     al  w1  x1+f0     ;
a0:  rs  w0  x1        ;   for i:= last used + 6
     al  w1  x1+2      ;    step 2 until
     sh  w1  x2+4      ;    old top + 4
     jl.     a0.       ;   do core(i) := 0;
 
     al  w0  x2-h4     ; init azone:
     am.    (b80.)     ;   azone :=
     rs  w0  -2        ;    azone address := old last used - h4;
     rl. w1 (b23.)     ;
     rs  w1  x2+4      ;   azone.chain := youngest zone;
     rs. w0 (b23.)     ;   youngest zone := azone;
     al  w0  -6        ;   azone.block proc :=
     rl. w1  b110.     ;    entry point(segment 2,
     ds  w1  x2+2      ;     release activities);
     al  w0  x1+d8     ;
     al  w1  x1+d9     ;   rsentry(89) := entry point(segment 2,disable);
     ds. w1 (b90.)     ;   rsentry(90) := entry point(segment 2,enable );
     jl.    (b6.)      ;   goto end register expression;
 
b100:2.1111<18         ;
 
 
\f


 
; jz.fgs 1982.09.15       new activity (1)   algol 8, activity, page 4
 
; segment 0 (4)
 
 
e2 = 1<23 + e10<12 + k - b0 ; entry point: new_activity
     rl. w2 (b13.)     ; new activity:
     ds. w3 (b30.)     ;   (saved sref,saved w3):=(last used,segbase);
 
     rl  w1  x2        ; check level:
     rl. w0 (b80.)     ;   w0 := aref (sref for activity decl block);
     se  w0  x1        ;   if aref <> call sref then
     jl.     a9.       ;   goto level alarm;
     rl  w1  x2+14     ; check third param:
     sz  w1  2.11111   ;   if kind(third param) <> procedure then
     jl.     a13.      ; not procedure: goto proc alarm;
 
     dl  w1  x2+8      ; take first param:
     so  w0  16        ;   if expression then
     jl. w3 (b4.)      ;    take expression;
     ds. w3 (b30.)     ;   (saved sref,w3):=(last used,segbase);
     rl  w1  x1        ;   activity no :=
     rs  w1  x2+8      ; 
 
     rl. w3 (b78.)     ; check mode:
     sh  w3  0         ;   if neutral or activity mode
     jl.     a10.      ;    then goto mode alarm;
 
     sh  w1  x3        ; check activity no:
     sh  w1  0         ;   if activity no > no of activities
     jl.     a11.      ;   or activity no < 1 then goto activityno alarm;
 
     wm. w1  b112.     ; get activity table entry address:
     wa. w1 (b79.)     ;   current activity :=
     rs. w1 (b77.)     ;    activityno*table_size + base of activity table;
 
\f


 
; jz.fgs 1982.09.15  new activity (2)   algol 8, activity, page 5
 
; segment 0 (5)
 
 
     rl  w3  x1+4      ; check state:
     al  w1  -1        ;   w1 := -1;
     rl  w0  x2+8      ;   w0 := act_no;
     se  w3  0         ;   if current activity.last used <> 0 then
     jl.    (b6.)      ; not empty: goto end register expression;
 
     al. w3  b0.       ; take second param:
     dl  w1  x2+12     ;   w3 := segment base;
     so  w0  16        ;   if expression then
     jl. w3 (b4.)      ;    take expression;
     ds. w3 (b30.)     ;   (saved sref,w3):=(last used,segbase);
     rl  w1  x1        ;   w1 := shared virtual := value(param);
     sn  w1  0         ;   if shared virtual = 0 then
     jl.     a5.       ;   goto init resident;
 
     rl. w3 (b78.)     ; init virtual:
     sh  w1  x3        ;   if shared virtual > no of activities
     sh  w1  0         ;   or shared virtual < 1 then
     jl.     a14.      ;   goto virtual alarm 1;
  
     wm. w1  b112.     ; get shared virtual:
     wa. w1 (b79.)     ;   shared virtual :=
     rs  w1  x2+12     ;   table_size*shared virtual + base of activity table;
     rl. w0 (b77.)     ;
     sn  w0  x1        ;   if shared virtual = current activity then
     jl.     a3.       ;   goto ego virtual;
 
     rl  w3  x1+0      ; shared virtuals:
     rl  w0  x1+6      ;
     se  w3  0         ;   if shared virtual.first core = 0
     sh  w0  0         ;   or shared virtual.virtual <= 0 then
     jl.     a16.      ;   goto virtual alarm2;
 
\f


 
; jz.fgs 1982.09.13      new activity (3)      algol 8, activity, page 6
 
; segment 0 (6)
 
 
 
     rl  w3  x3-2      ; save pending virtual:
     ac  w1 (x3+8)     ;   if pending virtual.state = 2 then
     sn  w1  -2        ;   begin state := -2; goto waiting pending end;
     jl.     a17.      ;
     rl  w1  x3+4      ;   pending virtual:=(shared virtual.first core-2);
     rl  w0  x3+2      ;   w1 := pending virtual.last used;
     ws  w0  2         ;   w0 := pending virtual(oldlastused-lastused);
     rl  w2  x3+6      ;   w2 := pending virtual.virtual;
     sl  w2  1         ;   if w2 < 1
     sh  w1  0         ;   or w1 <= 0 then
     jl.     a15.      ;   goto update;
     jl. w3 (b66.)     ;   store words at virtual storage;
 
a15: rl. w2 (b13.)     ; update:
     rl. w1 (b77.)     ;   w2 := last used; w1 := current activity;
     rl  w3  x2+12     ;   w3 := shared virtual;
     dl  w0  x3+2      ;   (w3,w0) := shared virtual.(first c,old last u);
     rx  w0  x1+2      ;   swap(w0,current act.old last used);
     rx  w3  x1+0      ;   swap(w3,current act.first core);
     ws  w0  6         ;   curr act size := cuurent act.(oldlu-firstc);
     rl  w3  x1+2      ;   shared size :=
     ws  w3  x1+0      ;   shared virtual.(oldlu-firstc);
     sh  w0  x3-1      ;   if curr act size < shared size then
     jl.     a4.       ;   goto set new virtual;
 
a3:  rl  w0  x1+6      ; ego virtual:
     sh  w0  0         ;   if current activity.virtual <= 0 then
a4:  al  w0  -1        ;set new virtual:
     rs  w0  x1+6      ;   current activity.virtual := -1;
 
\f


 
; jz.fgs 1982.09.15     new activity (4)   algol 8, activity, page 7
 
; segment 0 (7)
 
 
 
a5:  rl. w1 (b77.)     ; init resident:
     al  w3  x2+6      ;   restore w1;
     ba  w3  x2+4      ;   w3 := top formals = top literals :=
     rs. w3  b103.     ;    last used + 6 + appetite(call);
     rs. w3  b102.     ;   
     rl  w0  x1+0      ;
     sh  w0  0         ;   if current activity.first core <= 0
     jl.     a7.       ;   then goto fresh init;
 
     rs. w3 (b76.)     ; reinitialize:
     rl. w0  b76.      ;   temp last used := w3;
     rs. w0 (b81.)     ;   top of program := addr(temp last used);
     rl  w3  x1+2      ;   topointer := w3 :=
     bs  w3  x2+4      ;   current act.oldlu - appetite(call)+5-6;
     al  w3  x3+5-6    ;
     al  w2  x2+5      ;   from pointer := last used + 5;
 
a6:  al  w3  x3+4      ; next param:
     al  w2  x2+4      ;   topointer := topointer + 4;
     sl. w2 (b102.)    ;   frompointer := frompointer + 4;
     jl.     a8.       ;   if frompointer >= top literals then
     dl  w1  x2        ;    goto end param;
     ds  w1  x3        ;   core(topointer) := core(frompointer);
     sl. w2 (b103.)    ;   if frompointer >= top literals then
     jl.     a6.       ;    goto next param;
     la. w0  b105.     ;   kind := kindword(param) extract 5;
     sl  w0  17        ;   if kind < 17
     sn  w0  23        ;   or kind = 23
     jl.     a6.       ;   then goto next param;
     sl  w1  x2        ;   if addressword (param) < frompointer
     sl. w1 (b102.)    ;   or addressword (param) >= top literals then
     jl.     a6.       ;   then goto next param;
     sh. w1 (b103.)    ;   if addressword (param) <= top formals then
     rs. w1  b103.     ;     top formals := addressword (param);
     ws  w1  4         ;
     wa  w1  6         ;   core(topointer) :=
     rs  w1  x3        ;    core(topointer)-frompointer+topointer;
     jl.     a6.       ;   goto next param;
 
\f


 
; jz 1979.11.03    new activity (5)   algol 8, activity, page 8
 
; segment 0 (8)
 
 
 
a7:  rs  w3  x1+2      ; fresh init:
     rl. w0  b13.      ;   current activity.oldlu := upper;
     rs. w0 (b81.)     ;   top of program := addr(last used);
 
a8:  rl. w3 (b78.)     ; end param:
     ac  w3  x3        ;   no of activities := -no of activities;
     rs. w3 (b78.)     ;   <* mode := activity mode *>
     rl. w1 (b77.)     ;   w1 := current activity;
     rl. w2 (b13.)     ;   w2 := last used;
     dl  w0  x2+2      ; save return:
     ds. w0 (b82.)     ;   move return information
     rl  w0  x2+4      ;   from old stack top to
     rs. w0 (b83.)     ;   running system variables;
     rl  w0  x2+8      ;   rs activityno :=
     rs. w0 (b85.)     ;    saved activity no;
     rl  w0  x1+0      ;   max last used :=
     rs. w0 (b74.)     ;    current activity.first core;
     rl  w3  x1+2      ;   w3 := current activity.old last used;
     bs  w3  x2+4      ;   limit last used :=
     al  w3  x3-6+18   ;   last used :=
     rs. w3 (b13.)     ;    current activity.old last used
     rs. w3 (b75.)     ;    - appetite(call) - 6 + 18;
 
\f


 
; jz 1979.11.03        new activity (5a)    algol 8, activity, page 8a
 
 
 
 
     rl  w0  x1+2      ;   current stackbottom := w2 :=
     rs. w0 (b86.)     ;    current activity.old last used;
     rl. w0 (b23.)     ;   current activity.youngest zone :=
     rs  w0  x1+10     ;    youngest zone;
     dl. w0 (b61.)     ;   current activity.(csr,cza) :=
     ds  w0  x1+14     ;    (csr,cza);
     rl. w0  b101.     ;
     al  w3  0         ;   youngest zone := 1 shift 22;
     rs. w0 (b23.)     ;   
     ds. w0 (b61.)     ;   (csr,cza):=(0,1 shift 22);
     rl. w0 (b91.)     ;
     rs  w0  x1+16     ;   current activity.trapchain := trapchain;
     rl. w3 (b75.)     ;
     rl. w2 (b80.)     ;   w2 := aref;
     dl  w1  x3-2      ;   (w0,w1):= formal(param3); <*procedure*>
     jl. w3 (b4.)      ;   take expression;
 
     rl. w3 (b2.)      ; return via final end:
     jl     x3+d0      ;   goto next segment(passivate0);
 
a17: ws. w3 (b79.)     ; waiting pending:
     ld  w0 -24        ;
     wd. w0  b112.     ;   w0 := activity no(pending virtual);
     jl.    (b6.)      ;   goto end register expression;
 
\f


 
; jz.fgs 1982.09.22new activity (6)   algol 8, activity, page 9
 
; segment 0 (9)
 
 
 
b112:          f0    ; table size

b102 = e0            ; top literals (located in unused start external list)
b103 = e0 + 2        ; top formals  ( - do - )

b105:         2.11111; mask for kind check
b101:            1<22; initial youngest zone;
  
a9:  am      c3        ; level alarm:
a2:                    ; alarm2: +decl alarm:
a10: am      c4        ; mode alarm:
a16: am      c8        ; virtual alarm2:
a13: am      c7        ; proc alarm:
a1:                    ; index alarm:
a11:                   ; activity no alarm:
a14: al  w0  c5        ; virtual alarm 1:
a18: rl. w3 (b2.)      ; call next segment:
     jl      x3+c0     ;   goto next segment(alarm0);
 
g3: c. g3-b0-506
       m. code too long, segment 0
    z.
 
    c. 502-g3+b0, jl-1, r. 252 - (:g3-b0:) > 1 z.
    <:activity:>, 0
e.                    ; end segment 0
e10 = e10 + 1     ; segment := segment + 1;
 
m. jz 1982.09.15  declare/new activity ,    segment 0
 
\f


 
; jz.fgs 1982.09.15   activate,passivate,resume  algol 8, activity, page 10
 
; segment 1 (1)
 
b. a19, b111, g2 w.  ;
k=10000, g0 = 0      ;
h.                   ;
 
b0:       g2, g1     ; segment base: rel of last poinr, rel of last absword
b3:  g0 +  3, 0      ; rs entry  3: reserve
b4:  g0 +  4, 0      ; rs entry  4: take expression
b6:  g0 +  6, 0      ; rs entry  6: end register expression
b12: g0 + 12, 0      ; rs entry 12: uv
b13: g0 + 13, 0      ; rs entry 13: last used
b21: g0 + 21, 0      ; rs entry 21: general alarm
b23: g0 + 23, 0      ; rs entry 23: youngest zone;
b30: g0 + 30, 0      ; rs entry 30: saved sref, saved w3
b61: g0 + 61, 0      ; rs entry 61: (csr,cza)
b65: g0 + 65, 0      ; rs entry 65: load words from virtual storage
b66: g0 + 66, 0      ; rs entry 66: store words at virtual storage
b74: g0 + 74, 0      ; rs entry 74: max last used
b75: g0 + 75, 0      ; rs entry 75: limit last used
b76: g0 + 76, 0      ; rs entry 76: temp last used
b77: g0 + 77, 0      ; rs entry 77: current activity (table entry address)
b78: g0 + 78, 0      ; rs entry 78: no of activities
b79: g0 + 79, 0      ; rs entry 79: base of activity table
b80: g0 + 80, 0      ; rs entry 80: aref (sref for activity decl block)
b81: g0 + 81, 0      ; rs entry 81: top of program
b82: g0 + 82, 0      ; rs entry 82: (sref,segtabaddr) for activate/new act
b83: g0 + 83, 0      ; rs entry 83: relative of return -   -      - -  -
b85: g0 + 85, 0      ; rs entry 85: activity no
b86: g0 + 86, 0      ; rs entry 86: current stack bottom
b87: g0 + 87, 0      ; rs entry 87: temp stack bottom
b91: g0 + 91, 0      ; rs entry 91: trapchain
b110:      0, 7      ; own core: kill activity (working location)
g1 = k - 2 - b0      ; define  rel of last absword
 
g2 = k - 2 - b0      ; define rel of last point
 
w.                   ;
 
\f


 
; jz.fgs 1982.09.13    passivate (1)      algol 8, activity, page 11
 
; segment 1 (2)
 
 
a2:  am      1         ; passivate2: cause := 2 else
a1:  am      1         ; passivate1: cause := 1 else
a0:  am      3         ; passivate0: cause := 0 else
     al  w0 -3         ; passivate-3: cause := -3 (from alarm seg 1)
 
d0=a0-b0, d1=a1-b0, d2=a2-b0
 
e3 = 1<23 + e10<12 + d1
     rl. w2 (b13.)     ;   w2 := last used;
     ds. w3 (b30.)     ;   (saved sref,saved w3):=(w2,segment base);
     rl. w3 (b78.)     ; check mode:
     rl. w1 (b85.)     ;
     sl  w1  0         ;   if disable mode
     sl  w3  0         ;   or no of activities >= 0 then
     jl.     a10.      ;   goto mode alarm;
 
     rl. w3 (b77.)     ;   w3 := current activity;
     sh  w0  0         ;   if cause <- 0 then
     al  w2  0         ;    last used := 0;
     rs  w2  x3+4      ;   current activity.last used := last used;
     rl  w2  0         ;   saved cause := w2 := cause;
     sh  w0  0         ;   if cause <= 0 then
     al  w0  0         ;    cause := 0;
     rs  w0  x3+8      ;   current activity.state := cause;
     rl  w0  x3+0      ;   w0 := current activity. first core;
     se  w0  0         ;   if current activity.first core <> 0 then
     jl.     a6.       ;   goto check virtual;
  
     rl  w1  x3+2      ; first init: oldlu := last used;
     rx. w1 (b13.)     ;   last used := current activity.oldlastused;
     rx. w1 (b75.)     ;   oldlim:=limit last used; limit last used:=oldlu;
     ws  w1  x3+2      ;   appetite := oldlim - current activity.oldlastused;
     sn  w0 (x3+6)     ;   if current activity.virtual <> 0 then
     jl.     a19.      ;    begin
     as  w1 -9         ;      appetite := 
     as  w1  9         ;       appetite//512*512;
a19:                   ;    end;
     al  w1  x1-2      ;   appetite := appetite - 2;
     jl. w3 (b3.)      ;   reserve(appetite);
     rs. w3 (b30.)     ;   saved w3 := return from reserve;
     rs. w1 (b76.)     ;   temp last used := last used;
 
\f


 
; jz.fgs 1982.09.15 passivate (2)   algol 8, activity, page 12
 
; segment 1 (3)
 
     rl. w3 (b80.)     ;   w3 := aref;
     rs  w1  x3-2      ;   block(aref).last used := last used;
     rl. w3 (b77.)     ;   w3 := current activity;
     al  w0  x1+2      ;   current activity.first core :=
     rs  w0  x3+0      ;    last used + 2;
 
a6:  rl  w1  x3+6      ; check virtual:
     sl  w1  0         ;   if current activity.virtual >= 0 then
     jl.     a7.       ;   goto return;
     rl  w0  x3+2      ;   w1 := appetite :=
     ws  w0  x3+0      ;    current activity.(oldlastused-first core);
     jl. w3 (b66.)     ;   reservebs(appetite);  <* note that w1<0 at this point *>
     rl. w3 (b77.)     ;   w3 := current activity;
     rs  w1  x3+6      ;   current activity.virtual:= virt.addr.area;
 
a7:  am     (x3+0)     ; return:
     rs  w3  -2        ;   core(current activity.first core - 2) :=
     al  w0  0         ;    current activity;
     rs. w0 (b74.)     ;   max last used := 0;
     rl. w1 (b85.)     ;
     ds. w2 (b12.)     ;   uv := (activity no,cause);
     jl. w2  a15.      ;   swop;
     rl. w3 (b87.)     ;   current stack bottom :=
     rs. w3 (b86.)     ;    temp stack bottom;
     rl. w3 (b78.)     ;   
     ac  w3  x3        ;   no of activities := -no of activities;
     rs. w3 (b78.)     ;   <* mode := monitormode *>
     rl. w1 (b76.)     ;
     rs. w1 (b13.)     ;   last used := temp last used;
     rl. w1  b13.      ;
     rs. w1 (b81.)     ;   top of program := addr(last used);
     rl. w0 (b83.)     ;
     hs. w0  b100.     ;   rel of return := saved rel of return;
     al  w1  0         ;
     rs. w1 (b85.)     ;   activity no:=0;
     rl. w1  b12.      ;   w1 := address(uv);
     dl. w3 (b82.)     ;   (w2,w3):=(saved sref,segtabaddr);
     rl  w3  x3        ;   w3 := abs(segbase);
b100=k+1; rel of return;
     jl      x3+0      ;   return to monitor;
\f


 
; jz.fgs 1981.05.25 activate (1)    algol 8, activity, page  13
 
; segment 1 (4)
 
e4 = 1<23 + e10<12 + k - b0 ; entry point: activate
     rl. w2 (b13.)     ; activate:
     ds. w3 (b30.)     ;   (saved sref,w3) := (last used,segbase);
     dl  w1  x2+8      ; take parameter:
     so  w0  16        ;   if expression then
     jl. w3 (b4.)      ;   take expression;
     ds. w3 (b30.)     ;   (saved sref,w3):=(last used,segbase);
     rl  w1  x1        ;   kill_activity :=
     rs. w1 (b110.)    ;    value(param);
     sh  w1  0         ;   if value(param) <= 0 then
     ac  w1  x1        ;    activity no := -value(param) else
     rs  w1  x2+8      ;    activity no := value(param);
 
     rl. w3 (b78.)     ; check mode: max := no of activities;
     rl. w0 (b85.)     ;   w0 := rs activity no;
     sl  w0  0         ;   if disable mode
     sn  w3  0         ;   or no of activities = 0 <* neutral mode *> then
     jl.     a10.      ;   goto mode alarm;
     sh  w3  0         ;   if no of activities < 0 <*activity mode*> then
     ac  w3  x3        ;   max := -no of activities;
 
     sh  w1  x3        ; check activity no:
     sh  w1  0         ;   if activity no > max
     jl.     a11.      ;   or activityno <= 0 then goto index alarm;
 
     wm. w1  b104.     ; get table entry address:
     wa. w1 (b79.)     ;   activity := base + tablesize(activityno);
 
     rl. w3 (b78.)     ; check mode:
     rl  w0  x1+4      ;   w0:=current activity.last used;
     sh  w0     0      ;   if current activity.last used <= 0
     jl.        a9.    ;   then goto return;
     sl  w3  1         ;   if no of activities >=0 <*monitor mode*> then
     jl.     a16.      ;    goto called in monitor mode;
 
\f


 
; jz.fgs 1981.05.25     activate(1a)     algol 8, activity, page 13a
 
 
 
 
     rl. w3 (b77.)     ; called in activity mode:
                       ;   w3 := current activity;
     rl  w0  x3+0      ; check new:
     sh  w0  0         ;   if old activity.first core <= 0 
     jl.     a10.      ;    then goto mode alarm; <*act. not initialized*>
 
     rs  w2  x3+4      ;   old activity.last used := last used;
     rs. w1 (b77.)     ;   current activity := activity;
     jl. w2  a15.      ;   swop;
     rl. w2 (b13.)     ;   restore w2(last used);
 
     al  w1  3         ;   cause :=
     rs  w1  x3+8      ;   old activity.state := 3;
     jl.     a8.       ;   goto set cause3;
 
 
\f


 
; jz.fgs 1981.05.25    activate (2)      algol 8, activity, page 14
  
; segment 1 (5)
  
  
  
 
a16: dl  w0  x2+2      ; called in monitor mode:
     ds. w0 (b82.)     ;   move return information
     rl  w0  x2+4      ;   from stack top to
     rs. w0 (b83.)     ;   running system variables;
     rs. w1 (b77.)     ;   current activity := activity;

     al  w3  x2+6      ; unstack call:
     ba  w3  x2+4      ;
     rs. w3 (b76.)     ;   temp last used := last used+6+appetite(call);
     rl. w0  b76.      ;
     rs. w0 (b81.)     ;   top of program := addr(temp last used);
     rl  w3  x1+4      ;   w3 := curr.activity.last used;
     rl  w1  x1+8      ;   cause := curr activity.state;
 
a8:  rl. w0 (b85.)     ; set cause3:   w0 := current activity no;
     se  w1  3         ;   if cause <> 3 then
     dl  w1  x3+8      ;    curr act.last used(6,8); <* passivate2 *>
 
     ds. w1 (b12.)     ; call activity: uv := (w0,w1); <* return value *>
     rl. w1 (b77.)     ;   <*it is assumed that uv is not spoiled below*>
     rl  w3  x1+0      ;   w1 := current activity;
     sn  w1 (x3-2)     ;   if current act = core(first core-2) then
     jl.     a17.      ;    goto set core resident;
 
     am     (x3-2)     ; pending virtual:
     ac  w1 (+8)       ;   w1 := -pending virtual.state;
     sn  w1  -2        ;   if w1 = -implicit passivate then
     jl.     a14.      ;    goto waiting pending;
 
a17: rl. w1 (b77.)     ; core resident:
     rs. w3 (b74.)     ;   w1 := current activity;
     rl  w0  x2+8      ;   max lastused := curr act.first core;
     rs. w0 (b85.)     ;   current activity no := saved activity no;
     rl  w2  x1+4      ;   w2 := last used :=
     rs. w2 (b13.)     ;    current activity.last used;
 
     rl  w0  x1+2      ;   current stack bottom :=
     rs. w0 (b86.)     ;    current activity.old last used;
     sn  w1 (x3-2)     ;   if current activity=curract.firstcore(-2)
     jl.     a13.      ;    then goto finis;
 
\f


 
; jz.fgs 1982.09.13       activate(3)         algol 8, activity, page 15
 
; segment 1 (6)
 
 
 
     rl  w3  x3-2      ; pending virtual:
     rl  w0  x3+2      ;   w0 := appetite :=
     ws  w0  x3+4      ;    pending activity.(oldlastused-lastused);
     rl  w1  x3+4      ;   w1 := pending activity.last used;
     rl  w2  x3+6      ;   w2 := pending activity.virtual;
     sl  w1  1         ;   if pending activity.last used > 0 then
     jl. w3 (b66.)     ;    store words at virtual storage;
 
     rl. w3 (b77.)     ; load virtual:
     rl  w0  x3+2      ;   w0 := appetite :=
     ws  w0  x3+4      ;    current activity.(oldlastused-lastused);
     rl  w1  x3+4      ;   w1 := current activity.last used;
     rl  w2  x3+6      ;   w2 := current activity.virtual;
     jl. w3 (b65.)     ;   load words from virtual storage;
 
a13: rl. w3 (b77.)     ; finis:
     am     (x3+0)     ;   core(current activity.first core-2) :=
     rs  w3  -2        ;   current activity;
     jl. w2  a15.      ;   swop;
     rl. w3 (b78.)     ; set activity mode:
     sl  w3  0         ;   no of activities :=
     ac  w3  x3        ;    if no of activities >= 0 then -no of activities
     rs. w3 (b78.)     ;    else no of activities;
     dl. w1 (b12.)     ;   (w0,w1) := return value := uv;
     rl. w3 (b110.)    ;
     sl  w3  0         ;   if kill_activity > 0 then
     jl.    (b6.)      ;    goto end register expression;
 
     rl. w2 (b13.)     ; kill activity:
     dl  w0  x2+4      ;   (w3,w0) := (call seg tab,call seg rel);
     rl  w3  x3        ;   w3 := segtable(w3);
     rl  w1  x3        ;   ref segment(w3); <* may transfer it *>
     hs. w0  b111.     ;   segrel := w0;
b111 = k + 1 ; seg rel ;
     al  w3  x3+0      ;   w3 := segment base + seg rel;
     al  w1  x2        ;   w1 := last used;
     al  w2  x2+6      ; unstack call: <* passivate or activate *>
     ba  w2  x2-2      ;   last used := last used + 6
     rs. w2 (b13.)     ;   + appetite(call);
     ds. w3 (b30.)     ;   (saved sref, saved w3) := (last used, w3);
     rl  w2  x1        ;    w2 := w2 of call;
     al  w0  -15       ;   w0 := -15; (=> alarm: <:killed:>)
     jl.    (b21.)     ;   goto general alarm;


 
\f


 
; jz.fgs 1981.05.25  activity(4)     algol 8, activity, page 16
 
; segment 1 (7)
 
 
 
 
a9:  al  w1  -1        ; state return:
     rl  w0  x2+8      ;   return := (activity no, -1);
     jl.    (b6.)      ;   goto end register expression;
 
a14: rl  w3  x3-2      ; waiting pending:
     ws. w3 (b79.)     ;
     ld  w0  -24       ;
     wd. w0  b104.     ;   w0 := activity no(pending virtual);
     jl.    (b6.)      ;   goto end register expression;
 
a15: rl. w0 (b23.)     ; swop:
     rx  w0  x3+10     ;
     rs. w0 (b23.)     ;   swap(youngest zone,curr act.youngest zone);
     dl. w1 (b61.)     ;
     rx  w0  x3+12     ;   swap(
     rx  w1  x3+14     ;        current activity.(csr,cza),
     ds. w1 (b61.)     ;        (csr,cza)
     dl  w1  x3+18     ;   swap ( (trapchain, limit last used) ,
     rx. w0    (b91.)  ;           current activity.
     rx. w1    (b75.)  ;          (trapchain, limit last used) );
     ds  w1  x3+18     ;
     jl      x2        ;   return;
 
 
\f


 
; jz.fgs 1982.09.15     alarms etc.    algol 8, activity, page 17
 
; segment 1 (8)
 
 
 
 
b104:              f0  ; table_size
 
b107:<:<10>level   :>  ;
b108:<:<10>proc    :>  ;
b109:<:<10>virtual :>  ;
b101:<:<10>mode    :>  ;
b106: ; param alarm    ;
b102:<:<10>index   :>  ;
 
c0 = k - b0
     am     (0)        ; alarm0: (called from segment 0)
a10: am    b101-b102+1 ; mode alarm:
a11: al. w0  b102.     ; index alarm:
     jl. w3 (b21.)     ;   general alarm(text address);
 
  
c3=b107-b101, c4=b101-b109, c5=b102-b101-1
c7=b108-b102+1, c8=b109-b108, c10 = a10 - b0
 
 
 
b2: c. b2 - b0 - 506
       m. code too long, segment 1
    z.
 
    c. 502 - b2 + b0, jl-1, r. 252 - (:b2-b0:) > 1 z.
    <:activity:>, 0
e.                     ; end segment 1
e10 = e10 + 1          ; segment := segment + 1;
 
m. jz 1982.09.15  passivate, activate  segment 1
 
\f


 
; jz 1979.08.08     utility        algol 8, activity, page 18
 
; segment 2 (0)
 
 
 
b. a30 , b109, g3 w. ;
k=10000 , g0=0      ;
h.                  ;
 
                    ; segment base
b0:      g1 , g2    ; rel of last point , rel of last absword
b107:      0, 3     ; own core: (saved limit last used,last used)
b109:      0, 5     ; own core: level count
b4:  g0 +  4, 0     ; rs entry  4: take expression
b6:  g0 +  6, 0     ; rs entry  6: end register expression
b13: g0 + 13, 0     ; rs entry 13: last used
b21: g0 + 21, 0     ; rs entry 21: general alarm
b23: g0 + 23, 0     ; rs entry 23: youngest zone
b30: g0 + 30, 0     ; rs entry 30: saved sref, saved w3
b38: g0 + 38, 0     ; rs entry 38: *** used with spare mess buf ***
b61: g0 + 61, 0     ; rs entry 61: (csr, cza)
b74: g0 + 74, 0     ; rs entry 74: max last used
b75: g0 + 75, 0     ; rs entry 75: limit last used
b76: g0 + 76, 0     ; rs entry 76: temp last used
b77: g0 + 77, 0     ; rs entry 77: current activity (table entry address)
b78: g0 + 78, 0     ; rs entry 78: no of activities
b79: g0 + 79, 0     ; rs entry 79: base of activity table
b80: g0 + 80, 0     ; rs entry 80: aref (sref for activity decl block)
b81: g0 + 81, 0     ; rs entry 81: top of program
b85: g0 + 85, 0     ; rs entry 85: current activity no
b86: g0 + 86, 0     ; rs entry 86: current stack bottom
b89: g0 + 89, 0     ; rs entry 89: disable activity
b90: g0 + 90, 0     ; rs entry 90: enable  activity
b108:1<11 o.(:-1:),0; segment 1 reference
g2 = k - 2 - b0     ; define rel of last absword
 
b1:  1<11 o. 0, d7  ; entry point: (this segment, terminate release)
g1 = k - 2 - b0     ; define rel of last point
 
w.                  ;
 
\f


 
; jz 1979.03.27      release activities (1)   algol 8, activity, page 19
 
; segment 2 (1)
  
  
b100: 1<22 ;
      0    ; b101-2: saved cza
b101: 0    ;         saved youngest zone
b102: 0    ;         saved return
b103: 0    ;         stop
 
d6 = k - b0            ; called from rs(release zones)
 
                       ; release activities:
     rs. w2  b102.     ;   save(return);
     rl. w1 (b23.)     ; change block proc(azone):
     rl. w0  b1.       ;   change blockproc(azone) defining second
     rs  w0  x1+h4+2   ;   call to: terminate release;
     al  w1  f0        ;   w1 := table_size;
     wm. w1 (b78.)     ;   stop:=table address(last activity) :=
     wa. w1 (b79.)     ;    no of activities+base activity table;
     rs. w1  b103.     ;
 
     rl. w1 (b79.)     ;   activity :=table address(activity no 0);
a0:  sn. w1 (b103.)    ; get youngest zone:
     jl.     a7.       ;   if activity=stop then goto finis3;
     al  w1  x1+f0     ;   activity := activity + table_size;
     rl  w3  x1+10     ;   yzone := activity.youngest zone;
     se  w3  0         ;   if yzone = 0
     sl  w3 (x1+2)     ;   or yzone>= activity.old last used
     jl.     a0.       ;   then goto get youngest zone;
     am     (x1+0)     ;
     se  w1 (-2)       ;   if activity<>core(act.first core-2) then
     jl.     a0.       ;    goto get youngest zone;
 
     rl. w2 (b79.)     ;   activity1 := table address(activity no 0);
a1:  sn. w2 (b103.)    ; get cza:
     jl.     a2.       ;   if activity1=stop then goto finis1;
     al  w2  x2+f0     ;   activity1:=activity1+table_size;
     rl  w0  x2+14     ;   czone := activity1.cza;
     se  w0  0         ;   if czone = 0
     sl  w0 (x2+2)     ;   or czone >= activity1.old last used
     jl.     a1.       ;   then goto get cza;
     am     (x2+0)     ;
     se  w2 (-2)       ;   if activity1<>core(act1.firstcore-2) then
     jl.     a1.       ;    goto get cza;
 
\f


 
; jz 1979.03.27      release activities (2)  algol 8, activity, page 20
 
; segment 2 (2)
 
 
 
a2:  rl  w2  0         ; finis1:
     sn  w2  0         ;   w2 := czone;
     rl. w2  b100.     ;   if czone = 0 then czone := 1 shift 22;
     ds. w3  b101.     ;   save yzone and czone;
     
a3:  rl  w0  x3+h4+4   ; next zone:
     sl  w0 (x1+2)     ;   yzone1 := yzone.chain to elder;
     jl.     a4.       ;   if yzone1>=activity.old last used then
     rl  w3  0         ;   goto next activity; yzone:=yzone1;
     se  w3  x2        ;   if yzone=czone then
     jl.     a4.       ;    begin <*context zone*>
     rl  w0  x2+h2+2   ;     czone1 := czone.oldcza;
     sh  w0 (x1+2)     ;     if czone1<=activity.old last used then
     rl  w2  0         ;     czone := czone1;
                       ;    end;
a4:  sl. w1 (b103.)    ; next activity:
     jl.     a5.       ;   if activity>=stop then goto finis;
     al  w1  x1+f0     ;   activity := activity + table_size;
     rl  w0  x1+10     ;   yzone1 := activity.youngest zone;
     se  w0  0         ;   if yzone1 = 0
     sl  w0 (x1+2)     ;   or yzone1 >= activity.old last used then
     jl.     a4.       ;    goto next activity;
     am     (x1+0)     ;
     se  w1 (-2)       ;   if activity<>core(activ.first core-2) then
     jl.     a4.       ;    goto next activity;
 
\f


 
; jz 1979.06.07    release activities (3)  algol 8, activity, page 21
 
; segment 2 (3)
 
 
 
     rs  w0  x3+h4+4   ;   yzone.chain to elder := yzone1;
     rl  w3  0         ;   yzone := yzone1;
     rl  w0  x1+14     ;   czone1 := activity.cza;
     sl  w0 (x1+2)     ;   if czone1>= activity.old last used then
     jl.     a3.       ;    goto next zone;
     rs  w0  x2+h2+2   ;   czone.oldcza := czone1;
     rl  w2  0         ;   czone := czone1;
     jl.     a3.       ;   goto next aone;
 
a5:  sn. w2 (b100.)    ; finis:
     jl.     a6.       ;   if czone=1 shift 22 then goto finis2;
     rl. w1  b101.-2   ;   w1 := saved cza;
     rx. w1 (b61.)     ;   swap(cza,saved cza);
     rs  w1  x2+h2+2   ;   czone.oldcza := saved cza;
 
a6:  rl. w1  b101.     ; finis2:
     rx. w1 (b23.)     ;   swap(youngest zone,saved youngest zone);
     rs  w1  x3+h4+4   ;   yzone.chain to elder := youngest zone;
 
                       ; exit:
a7:  jl.    (b102.)    ;   return to release zones;
 
d7 = k - b0            ; called from release zones (second time)
     rl. w1 (b23.)     ; terminate release:
     rl  w1  x1+h4+4   ;   youngest zone:=
     rs. w1 (b23.)     ;    youngest zone.chain to elder;
     rl. w1  b13.      ;   top of program :=
     rs. w1 (b81.)     ;    address of last used;
     al  w0  0         ;
     rs. w0 (b80.)     ;   aref := 0;
     rs. w0 (b78.)     ;   no of activities := 0; (neutral mode);
     rs. w0 (b85.)     ;   current activity no := 0;
     rs. w0 (b89.)     ;   entry point(disable activity) := 0;
     rs. w0 (b90.)     ;   entry point(enable  activity) := 0;
     jl.    (b102.)    ;   return to release zones;



\f




; btj 1979.05.04        activity wait (1)  algol 8, activity, page 22

; segment 2(4)


b104: f0   ; size of entry in activity table
b105: 0-0-0; abs address of last entry in activity table

e6 = 1<23 + e10<12 + k - b0 ; entry point: activity wait
     rl. w2 (b13.)     ; activity wait:
     ds. w3 (b30.)     ;   (saved sref,w3) := (last used,irrell)
     dl  w1  x2+8      ; take parameter:
     so  w0  16        ;   if expression then
     jl. w3 (b4.)      ;   take expression;
     ds. w3 (b30.)     ;   (saved sref,w3) := (last used,irrell);
     rs  w1  x2+8      ;   formal := abs addr of parameter;
     rl  w2  x1        ;   w2 := buf := value(parameter);

     rl. w1 (b78.)     ; check mode:
     sh  w1  0         ;   if no of activities <= 0 then
     jl.     a30.      ;     goto mode alarm;

     wm. w1  b104.     ;   last entry := no of activities * entry size
     wa. w1 (b79.)     ;     + base activity table;
     rs. w1  b105.     ;


\f



; jz 1979.09.26        activity wait (2)  algol 8, activity, page 23

; segment 2(5)


a15:                   ; wait next event:
     jd      1<11+24   ;   result :=wait event(buf);
     sn  w0  0         ;   if result = message then
     jl.     a25.      ;     goto take message;

     am.    (b38.)     ;   if buf = spare message buffer then
     sn  w2 (-6)       ;     <* nasty addressing, like in 'monitor 24' *>
     jl.     a15.      ;     goto wait next event;

c. +1; if old monitor then include ...
     rl  w0  90        ;   if size of message buffer <> 24 then
     se  w0  24        ;
     jl.     a17.      ;     goto skip search;

     rl. w1 (b79.)     ;   w1 := entry := base activity table;
     al  w0  2         ;   w0 := allowed activity state;

a16:                   ; compare next:
     sl. w1 (b105.)    ;   if entry >= last entry then
     jl.     a24.      ;     goto take answer;
     al  w1  x1+f0     ;   increase(entry);
     se  w0 (x1+8)     ;   if state(entry) <> waiting for answer then
     jl.     a16.      ;     goto compare next;
     rl  w3 (x1+4)     ;   w3 := zone addr := stack(last used(entry));
     rl  w3  x3+h0+4   ;   w3 := share addr := used share(zone);
     se  w2 (x3+0)     ;   if buf <> share state(share) then
     jl.     a16.      ;     goto compare next;

     jl.     a20.      ;   goto activity answer found;

a17:                   ; skip search:
z. ; end monitor condition

     rl  w1  x2-2      ;   entry := message extension(buf);
     am.    (b78.)     ;
     sh  w1 (+0)       ;   if activity no > no of activities
     sh  w1  0         ;   or activity no <= 0 then
     jl.     a24.      ;     goto take answer;

     wm. w1  b104.     ;   entry := activity no * entry size
     wa. w1 (b79.)     ;     + base activity table;
     al  w0  2         ;
     se  w0 (x1+8)     ;   if state(entry) <> waiting for answer then
     jl.     a24.      ;     goto take answer;

     rl  w3 (x1+4)     ;   w3 := zone addr := stack(last used(entry));
     rl  w3  x3+h0+4   ;   w3 := share addr := used share(zone);
     se  w2 (x3+0)     ;   if buf <> share state(share) then
     jl.     a24.      ;     goto take answer;



\f



; btj/jz 1979.07.02        activity wait (3)  algol 8, activity, page 24

; segment 2(6)


a20:                   ; activity answer found:
     ws. w1 (b79.)     ;   activity no := (entry - base activity table)
     al  w0  0         ;
     wd. w1  b104.     ;     / entry size;
; w1 = activity no
; w2 = buf
a21:                   ; wactivity return:
     rl. w3 (b13.)     ;   w3 := last used;
     rs  w2 (x3+8)     ;   param := buf addr;
     jl.    (b6.)      ;   end register expression(w1);

a24:                  ; take answer:
     am     -1         ;   w1 := -1; <* i.e. notify undef answer *>

a25:                   ; take message:
     al  w1  0         ;   w1 := 0; <* i.e. notify a message *>
     jl.     a21.      ;   goto wactivity return;

a30:                   ; mode error:
     rl. w3 (b108.)    ;
     jl     x3+c10     ;   goto mode alarm (segment 1);
 
\f


 
; jz 1979.07.02       disable activity      algol 8, activity, page 25
 
; segment 2 (7)
 
 
b. a3, i2 w.  ; begin block: disable/enable
 
 
d8 = k - b0 - d6 
 
     rl. w0 (b109.)    ; disable activity:
     ba. w0  1         ;   level count :=
     rs. w0 (b109.)    ;    level count + 1;
     rl. w1 (b85.)     ;   w1 := current act no <* mode *>;
     sh  w0  1         ;   if level count > 1
     sh  w1  0         ;   or disable mode or not activity mode
     jl.    (b6.)      ;   then goto end reg. expression;
     ac  w1  x1        ;   current actno := -current actno;
     rs. w1 (b85.)     ;   <* mode := disable mode *>
 
     rl. w1 (b13.)     ;   current stack bottom :=
     rs. w1 (b86.)     ;    last used;
 
     rl. w3 (b74.)     ;
     sh  w3  0         ;   if max last used > 0 then
     jl.     a0.       ;    begin <* in activate *>
     rl. w0 (b76.)     ;     last used :=
     rs. w0 (b13.)     ;      temp last used;
     al  w0  0         ;      max last used := 0;
     rs. w0 (b74.)     ;    end;
 
a0:  rl. w0 (b75.)     ;   saved limit last used := limit last used;
     ds. w1 (b107.)    ;   saved last used := call last used;
     rl. w0  b13.      ;   top of program :=
     rs. w0 (b81.)     ;    abs address(last used);
  
     rl  w2  x1        ; exit:
     dl  w0  x1+4      ;  
     hs. w0  i0.       ;   w2 := call sref;
     rl  w3  x3        ;
i0 = k + 1; rel        ;
     jl      x3+0      ;   return;
 
\f


 
; jz 1979.07.03         enable activity (1)   algol 8, activity, page 26
 
; segment 2 (8)
  
 
d9 = k - b0 - d6
 
     ds. w3 (b30.)     ; enable activity:
     rl. w1 (b107.)    ;   w1 := saved last used;
     rl. w0 (b109.)    ; check level:
     bs. w0  1         ;   level count :=
     rs. w0 (b109.)    ;    level count - 1;
     rl. w3 (b85.)     ;   w3 := current act no <* mode *>;
     sn  w2  0         ;   if called from alarm and disable mode
     sh  w0  0         ;   or level count > 0 
     sl  w3  0         ;   or not disable mode then
     jl.    a2.        ;    goto check alarm;
     ac  w3  x3        ;   current actno := -current actno;
     rs. w3 (b85.)     ;   <* mode := activity mode *>
  
     al  w3  x2        ;
     rl. w2 (b107.)    ;   w2 := saved last used;
     se  w3  0         ;   if called from alarm segment 1 
     jl.     a3.       ;    then goto unstack call;
     rl. w1 (b13.)     ;   w1 := last used;
     dl  w0  x1+4      ;
     ds  w0  x2+4      ;   move return information
     rl  w0  x1        ;   from current stack top
     rs  w0  x2        ;   to activity stack top;
 
a3:  rs. w2 (b13.)     ; unstack call:   
                       ;   last used := saved last used;
     rl. w3 (b77.)     ;
     rl  w0  x3+0      ;   max last used :=
     rs. w0 (b74.)     ;    current activity.first core;
     sh  w0  0         ;   if max last used > 0 then
     jl.     a1.       ;    <* in activate *>
     rl. w0  b76.      ;   top of program :=
     rs. w0 (b81.)     ;    abs addr of(temp last used);
 
\f


 
; jz 1979.07.02      enable activity (2)   algol 8, activity, page 27
 
; segment 2 (9)
 
 
 
a1:  rl  w0  x3+2      ;   current stack bottom :=
     rs. w0 (b86.)     ;    current activity.last core;
 
     dl. w1 (b107.)    ;   limit last used :=
     rs. w0 (b75.)     ;    saved limit last used;
     dl. w3 (b30.)     ;   restore w2;
 
a2:  sh  w0  -1        ; check alarm:
     al  w2  -1        ;   if level count >=0
     sn  w2  0         ;   and w2=0 <*called from program*>
     jl.    (b6.)      ;    then goto end register expression;;
     dl  w3  x1+2      ;   w2 := call sref;
     rl  w3  x3        ;
     rl  w0  x3        ;
     ba  w3  x1+5      ;   w3 := call addr;
     al  w1  x1+6      ;   last used :=
     rs. w1 (b13.)     ;    saved last used+6 (<*unstack disable call*>)
     al  w0  0         ;
     rs. w0 (b109.)    ;   level count := 0;
     al. w0  i1.       ;   w0 := textaddress;
     jl.    (b21.)     ;   goto general alarm;
 
i1 = k + 1;  odd text address to suppress number print
    <:<10>abled   :>  ;
  
 
e.  ; end disable/enable
  
\f


 
; jz 1979.06.25         end segment 2      algol 8, activity, page 28
 
; segment 2 (7)
 
 
g3: c. g3 - b0 - 506
       m. code too long, segment 2
    z.
 
    c. 502 - g3 + b0, jl-1, r. 252 - (:g3 - b0:) > 1 z.
    <:activity:>, 0
e.                 ; end segment 2
 
e10 = e10 + 1      ; segment = segment + 1
 
 
e.                 ; end slang segment
 
m. jz 1979.09.26  disable/enable , release activities , w_activity, segment 2
 
\f


 
; jz 1979.11.05       tails for insertproc   algol 8, activity, page 29
 
 
 
b. b8 w.                 ;
 
b0 = e10                 ; area length
b1 = b0<12 + 8           ; code length<12 + 8 owns
b2 = 1<23 + 4            ; shared entry
b3 = 4<12+e0-e11         ; algol external<12+start ext list
 
b4 = 1<18+19<12          ; notype procedure(int param)
b5 = 5<18+19<12          ; long procedure(int param)
b6 = 1<18                ; notype procedure
b7 = 5<18+39<12+19<6+19  ; long procedure(integer,integer,general)
b8 = 3<18 + 19<12        ; integer procedure(int param)
 
g0:  b0, 0,r.4, e1, b4, 0, b3, b1 ; activity(int)
     b2, 0,r.4, e2, b7, 0, b3, b1 ; new_activity(int,int,general)
     b2, 0,r.4, e3, b6, 0, b3, b1 ; passivate
     b2, 0,r.4, e4, b5, 0, b3, b1 ; activate(int)
     b2, 0,r.4, e6, b8, 0, b3, b1 ; wactivity(int)
g1 = k - 20 ; last entry
 
e.    ; tails

  
  
m. jz 1979.11.05  insertproc
 
d.
p. <:insertproc:>
 
▶EOF◀