Trailing-Edge
-
PDP-10 Archives
-
decuslib10-02
-
43,50242/corout.doc
There are no other files named corout.doc in the archive.
00100 BLISS COROUTINES.
00200
00300
00400 REGISTERS:
00500
00600 ALL DECLARABLE REGISTERS, WHETHER IN USE OR NOT, ARE NORMALLY
00700 SAVED IN THE STATE AREA OF THE NEW PROCESS DURING THE CREATE.
00800 THEY ARE RESTORED FROM THE STATE AREA EACH TIME THE PROCESS IS
00900 ENTERED BY AN EXCHJ, AND SAVED EACH TIME IT IS LEFT BY AN EXCHJ.
01000 THE REASON FOR SAVING ALL DECLARABLES IS THAT EXCHJ MAY BE
01100 WRITTEN WITHIN A PROCEDURE, SAY SOME GLOBAL SERVICE ROUTINE,
01200 WHICH IS DECLARED OUTSIDE OF ALL SCOPES OF DECLARED OR
01300 LOOP REGISTERS, BUT CALLED FROM WITHIN SUCH SCOPES.
01400
01500 THE USER MAY OMIT THIS SAVING AND RESTORING BY USING THE /R
01600 FLAG IN THE COMMAND STRING OR THE NORSAVE PARAMETER
01700 IN THE MODULE HEAD. UNLESS THE USER KNOWS WHAT HE IS DOING, USE
01800 OF THIS OPTION SHOULD BE UNIFORM OVER ALL CREATES AND EXCHJS.
01900 NO SPACE FOR THE REGISTERS IS RESERVED IN THE STATE AREA WHEN
02000 THE OPTION IS USED.
02100
02200 TEMPORARY REGISTERS ARE SAVED ACROSS EXCHJ'S IN THE STACK,
02300 AS FOR FUNCTION/ROUTINE CALLS.
02400
02500
02600 CREATE:
02700
02800 THE SEQUENCE OF EVALUATIONS AND EVENTS DURING
02900 CREATE E1(ELIST) AT E2 LENGTH E3 THEN E4
03000 WILL BE:
03100 E2, E3, ELIST IN SEQUENCE, E1, REGISTERS SAVED IN NEW STATE.
03200
03300 HOWEVER, IF E1 IS NOT A NAME IT WILL BE EVALUATED BEFORE E2.
03400
03500 IF E1 EVALUATES TO A FUNCTION NAME RATHER THAN A ROUTINE NAME, THE
03600 DISPLAY WILL BE COPIED FROM THE CREATOR PROCESS UPON THE FIRST
03700 ENTRY INTO THE CREATED PROCESS. IT IS THE RESPONSIBILITY OF THE USER
03800 THAT THE CREATOR EXISTS, AND WITH SUFFICIENTLY LARGE STACK, AT
03900 THIS TIME OR AT ANY TIME WHEN THE CREATED PROCESS TRIES TO REFE-
04000 RENCE VARIABLES (NON-LOCAL LOCALS) IN THE CREATOR.
04100
04200 DURING THE EVALUATION OF E4 THE VALUES OF THE RUN-TIME REGISTERS
04300 ARE AS FOR THE OUTMOST LEVEL OF THE PROCESS THAT RETURNED, EXEPT
04400 THAT THE F-REGISTER IS AS FOR THE PROCESS THAT CREATED THE ONE WHICH IS
04500 NOW RETURNING.
04600 HENCE USE OF LOCAL VARIABLES IN E4 WILL USUALLY BE MEANINGFULL.
04700 E4 IS TERMINATED BY A HALT INSTRUCTION, WITH THE VALUE OF E4
04800 IN THE VALUE-REGISTER.
04900
05000 IF THE INSPECT OPTION (/I) IS USED, THE VALUE OF A CREATE
05100 IS:
05200 --------- --------- ------------------
05300 ^ RAFL ^ RALF ^ BASE ADDRESS ^
05400 --------- --------- ------------------
05500 0 8 9 17 18 35
05600 WHERE:
05700 RAFL = RELATIVE ADDRESS OF FIRST LOCAL
05800 RALF = RELATIVE ADDRESS OF LAST FORMAL
05900 BOTH RELATIVE TO THE BASE ADDRESS, AND TAKING INTO ACCOUNT
06000 THAT THE NO. OF ACTUALS MAY DIFFER FROM THE NO. OF FORMALS.
06100 IF THE INSPECT OPTION IS NOT USED, RAFL AND RALF ARE ZERO,
06200 THEY WILL ALSO BE ZERO IF THERE ARE NO LOCALS OR ACTUALS.
06300
06400 THE SPECIAL WORD MENTIONED IN THE DESCRIPTION OF THE INSPECT-
06500 SWITCH IN THE MANUAL IS:
06600 --------- --------- ------------------
06700 ! RAFL ! NFORM ! OBJECT SIZE !
06800 --------- --------- ------------------
06900 0 8 9 17 18 35
07000 WHERE
07100 RAFL = RELATIVE ADDRESS OF FIRST LOCAL
07200 (RELATIVE TO THE LOCATION BELOW THE RETURN ADDRESS),
07300 NFORM = # OF FORMALS,
07400 OBJECT SIZE = # OF FORMALS + # OF DISPLAYS + # OF SAVED
07500 REGISTERS + # OF LOCALS + 2.
07600
07700
07800 STATE AREA:
07900
08000 THE LAYOUT OF THE STATE AREA IS:
08100
08200 ! !
08300 !------------!
08400 !THEN ADDRESS! ADDRESS OF THEN-PART OF CREATE.
08500 !------------!
08600 !LAST ACTUAL !
08700 !-- --!
08800 ! ! THIS AREA OMITTED IF NO ACTUALS.
08900 ! !
09000 !-- --!
09100 !1 ST ACTUAL !
09200 !------------!
09300 ! !
09400 ! SAVE AREA !
09500 ! FOR ALL ! THIS AREA OMITTED IF /R OPTION INVOKED.
09600 ! DECLARABLE !
09700 ! REGISTERS !
09800 ! !
09900 !------------!
10000 2 ! F REGISTER !
10100 !------------! THESE TWO ALWAYS SAVED AND RESTORED.
10200 1 ! S REGISTER !
10300 !------------!
10400 0 ! REACTIVA- ! ADDRESS WHERE EXECUTION SHOULD RESUME.
10500 ! TION POINT !__ BASE REGISTER POINTS HERE.
10600 ------------
10700 ww