This procedure implements system call #17 which is described in the Section “BREAK (II)” of the UPM. The comment at the head of the procedure has confused more than one reader: clearly the identifier “break” is used in “C” programs (leave an enclosing program loop) in an entirely different way from that intended here (change the size of the program data area).
“sbreak” has clear similarities with the procedure “grow” (4136) but unlike the latter, it is only invoked explicitly and may in fact cause a contraction of the data area as well as an expansion (depending on the new desired size).
Calculate the new size for the data area (in 32 word blocks);
Check that the new size is consistent with the memory segmentation constraints;
The area is shrinking. Copy the stack area down into the former data area. Call “expand” to trim off the excess;
Call “expand” to increase the total area. Copy the stack area up into the new part, and clear the areas which were formerly occupied by the stack.
The following procedures which are also contained in “sysl.c” are described in Chapter 13:
rexit (3205) wait (3270) exit (3219)