This routine is called by “estabur” (1724), “swtch” (2229) and “expand” (2295), to copy the prototype segmentation registers into the actual hardware segmentation registers.
Get the base address for the data area from the appropriate element of the “proc” array;
The prototype address registers (of which there are only eight for the PDP11/40) are modified by the addition of “a” and stored in the hardware segmentation address registers;
Test if a separate text area has been allocated, and if so, reset “a” to the relative address of the text area to the data area. (Note this value may be negative! Fortunately at this point, addresses are in terms of 32 word blocks.);
The pattern of code now followed is similar to the beginning of the routine, except ...
a rather obscure piece of code adjusts the setting of the address register for segments which are not “writable” i.e. which presumably are text segments.
The code in “estabur” and “sureg” shows evidence of having been developed in several stages and is not as elegant as could be desired.