perm filename EAL.ODL[EAL,HE]1 blob sn#677506
filedate 1982-09-27 generic text, type C, neo UTF8
COMMENT ⊗ VALID 00002 PAGES
C REC PAGE DESCRIPTION
C00002 00002 +--------------------------------------+
; | Overlay Structure of the AL system |
; The procedures and functions which constitute the AL system are divided
; into five overlay cotrees (not counting the two system cotrees).
; Conceptually, each cotree contains a "level" of procedures, with TREE5 at
; level 5 being the highest level, and TREE1 at level 1 the lowest level.
; There is also the "root" segment, containing PP, DISP and ALLOC; this can
; be thought of as level 0. (Although ALMAIN is also in the root segment,
; other routines cannot call it so it does not fit into this description.)
; The convention used in the AL system is that a procedure may, without
; difficulty, call any procedure at a lower level. A procedure MUST NOT
; call a procedure at a higher level (with only one exception; see below).
; A procedure may call another at the same level (without difficulty) only
; if the called procedure is in the same overlay segment as the calling
; procedure. The conventions used allow a procedure to call another, at the
; same level but in a different overlay segment, but only with difficulty.
; See below.
; To handle inter-overlay calls, some sophistication is needed over the
; simple "level N can call level M if M<N" method. In the simplest case, a
; procedure needs to call another procedure at the same level, but in a
; different overlay segment. To deal with this, the overlays IROOT, PROOT
; and EROOT were created. Since they are in Level 5, calling them violates
; the convention stated above (but then every rule has an exception).
; Suppose a routine proca at some level needs to call procb at the same
; level; and suppose procb is in a different overlay segment than proca.
; Then proca, instead of calling procb, calls proca', where proca' is a
; routine defined in EROOT (or IROOT if they are interpreter routines, or
; PROOT if they are parser routines). Then, in EROOT, proca' first calls
; procb (which will swap in the overlay procb is contained in), and then
; calls some small routine in the overlay in which proca is defined, in
; order to read that overlay segment back into memory. Control may then be
; returned to proca.
; That takes care of most of the cases. However, sometimes some procedure
; needs to call in an overlay (at the same or higher level -- another breach
; of policy) that will completely destroy the current overlay structure in
; memory. For example, in EDIT, when the Interpreter is called, soon after
; this call only interpreter routines will remain in memory, and to return
; to the Editor portion of the system, a lot of segments in various levels
; need to be re-read. The CALLER module, which resides in the root, is for
; this purpose. Calls from one segment to another are fixed in much the
; same manner as is described above, but more care may need to be taken in
; some cases to restore the proper overlays in memory before returning.
; There are many variations. The most complex case is where many different
; overlays call the same procedure, which then calls the Interpreter or
; Parser and destroys the overlays in memory (for example, the EMAINn
; overlays all call EDEBUG, which calls the Interpreter). To deal with this
; case, an extra parameter is passed to the called routine in EDEBUG that
; identifies the calling overlay; this overlay can then be restored by
; CALLER before control is returned to it.
; The statements below describe the modules which must appear in
; the root of a Pascal program.
P1: .FCTR LB:[1,1]PASLIB/LB:$INIT:$IO:$INPUT:$OUTPT:$ERROR:ERROR:P2ERR
P2: .FCTR LB:[1,1]PASLIB/LB:$DYNMM:$CNVRT:$SWAP:$WRINT:$ARITH
P3: .FCTR LB:[1,1]PASLIB/LB:$GETF:$PUTF:$CLOSE
; Overlays dealing with I/O
IO1: .FCTR LB:[1,1]PASLIB/LB:$OPEN
IO2: .FCTR LB:[1,1]PASLIB/LB:$SEEK:$FORT:$SET
; Note the lack of floating point I/O ! Don't try to do any!
; If floating-pt I/O is needed, use ppReal for output and getToken for input.
PASRES: .FCTR *P1-*P2-*P3-*IO2
; Some arithmetic library routines that go into individual overlays
TRIGSQ: .FCTR LB:[1,1]PASLIB/LB:$FTRIG:$FSQRT
SQ: .FCTR LB:[1,1]PASLIB/LB:$FSQRT
EXPLOG: .FCTR LB:[1,1]PASLIB/LB:$FEXP:$FLOG
ATN: .FCTR LB:[1,1]PASLIB/LB:$FATN
FTIME: .FCTR LB:[1,1]PASLIB/LB:$FTIME
; System library routines, mostly for file I/O & etc.
FINIT: .FCTR LB:[1,1]SYSLIB/LB:FINIT:ASSLUN:RETADR:RDWAIT:EOFCHK:WATSET
CSI1: .FCTR LB:[1,1]SYSLIB/LB:.CSI1
CSI2: .FCTR LB:[1,1]SYSLIB/LB:.CSI2
OPFNB: .FCTR LB:[1,1]SYSLIB/LB:OPFNB
PARSE: .FCTR LB:[1,1]SYSLIB/LB:PARSE
GETPUT: .FCTR (LB:[1,1]SYSLIB/LB:GET, LB:[1,1]SYSLIB/LB:PUT)
POSREC: .FCTR LB:[1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EEDIT4)
EADSEG: .FCTR EADDST-*(EADD1-EADD3,EADD2-EADD4,EADD5,EADD6-EADD8,EADD7)
TREE5: .FCTR DUM5-*(EROOT,PROOT,IROOT)