43600 #include "rundecs.h" 43610 (* COPYRIGHT 1983 C.H.LINDSEY, UNIVERSITY OF MANCHESTER *) 43620 (**) 43630 (**) 43670 (*RNSTART HAD BETTER BE WRITTEN IN ASSEMBLER ON MOST SYSTEMS*) 43680 (**) 43690 (*-01() (*-05() 43700 FUNCTION GETADDRESS (VAR VARIABLE :IPOINT) :IPOINT; EXTERN; 43710 FUNCTION GETCALLER (CALLEE :IPOINT) :IPOINT; EXTERN; 43720 FUNCTION GETLINENO :INTEGER; EXTERN; 43730 PROCEDURE RNSTART; 43740 VAR TSCOPE: DEPTHRANGE; 43750 RNIB: IPOINT; 43760 CURR : INTPOINT ; 43764 PROCEDURE SETNSTATIC( N: INTEGER ) ; EXTERN ; 43770 BEGIN 43780 RNIB := DYNAMIC(ME); 43790 (*+05()SETMYSTATIC(STATIC(DYNAMIC(RNIB)));(*TO ALGOL 68 CALLER*) ()+05*) 43800 (*-05()SETMYSTATIC(GETCALLER(RNIB); ()-05*) 43810 TSCOPE := SCOPE ; 43820 (*+02()LINENO:=GETLINENO;()+02*) 43830 SETMYSTATIC(RNIB); (* TO ALGOL 68 CALLEE *) 43840 (*+05()CURR := ASPTR(RNIB-SZWORD*2);(*CURR IS NOW POINTING TO ALGOL 68 CALLEE'S STATIC LINK*) 43850 CURR ^ := RNIB ; (* SET ALGOL 68 CALLEE'S STATIC LINK TO ITSELF *) 43860 STATICP:=STATICP-192; (*ENABLING ACCESS BY OFFSET FROM PNX R2*)()+05*) 43870 SCOPE := TSCOPE+LOCRG; 43880 LEVEL := PROCBL^.LEVEL; 43890 (*-02()LINENO := 0;()-02*) 43900 WITH FIRSTRG DO WITH FIRSTW DO 43910 BEGIN LOOPCOUNT := 0; RECGEN := NIL; RGIDBLK := PROCBL ^ . IDBLOCK ; RGSCOPE := 1; 43920 RIBOFFSET := INCPTR( ASPTR( RNIB ) , IBCONST + RGCONST ); 43930 (*+05()RGLASTUSED :=ASPTR(RNIB-PARAMOFFSET);()+05*) 43940 (*-05()RGLASTUSED:=INCPTR(ASPTR(GETADDRESS(STATICP)),-PARAMOFFSET);()-05*) 43950 END; 43960 IF LEVEL > PROCBL^.SCOPELEVEL + 1 THEN SETNSTATIC( LEVEL - ( PROCBL^.SCOPELEVEL + 1 ) ) ; 43970 END; 43980 ()-05*) ()-01*) 43990 (**) 44000 (**) 44010 (*-02() 44020 BEGIN 44030 END ; 44040 ()-02*) 44050 (*+01() 44060 BEGIN (*OF MAIN PROGRAM*) 44070 END (*OF EVERYTHING*). 44080 ()+01*)