Trailing-Edge
-
PDP-10 Archives
-
BB-J713A-BM
-
language-sources/de0n.bli
There are 18 other files named de0n.bli in the archive. Click here to see a list.
!THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY ONLY BE USED
! OR COPIED IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE.
!
!COPYRIGHT (C) 1972,1973,1974,1977,1978 DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS. 01754
!FILENAME: LODECL.BLI
!DATE: 18 OCTOBER 73 MGM/FLD
! REVISION HISTORY :
! 5-9-77 ROUTINE DECSYN IS MODIFIED TO DECALRE FORWARD
! DECLARATIONS MORE THAN ONCE.IT ACTS LIKE EXTERNAL
! DECLARATION.
!
%3.2% GLOBAL BIND LODEV=2; !MODULE VERSION NUMBER
GLOBAL ROUTINE CHECKEXTER(STE)=
IF .ST[.STE,0]<TYPEF> EQL UNDEDT
THEN (IDERROR(0,.STE);
ST[.STE,0]<TYPEF>_EXTRNT;
ST[.STE,1]<ADDRESSF>_#777777);
%%
% "DECSYM" AND "DECSYN" ARE USED TO DECLARE A NEW SYMBOL
IN FUTSYM. IT IS REJECTED WITH ERROR CODE DMCODE (PASSED
PARAMETER) WHEN:
1. IT IS NOT A SYMBOL;
2. IT HAS BEEN DECLARED AT THE CURRENT BLOCKLEVEL.
RECOVER IS CALLED IN THE ABOVE TWO CASES; THE RETURNED VALUE
IS 0.
OTHERWISE, THE SYMBOL IS DELCARED AT THE CURRENT BLOCKLEVEL
WITH THE TYPE PASSED (DMTYPE); THE STE INDEX IS STORED
IN THE LOCATION POINTED TO BY DMWHERE. THE VALUE RETURNED IS
TRUE.
DECSYN(DNWHERE:<ADDRESS FOR RETURNED STE INDEX>,
DNTYPE:<TYPE WHICH THE SYMBOL IS TO BE DECLARED>)
(DECSYM IS THE SAME ONLY THE WINDOW IS MOVED AFTER THE CALL).
%
%%
FORWARD DECSYQ;
%5.200.41% EXTERNAL XREFTY;
GLOBAL ROUTINE DECSYN(DNWHERE,DNTYPE)=
BEGIN
LOCAL DNWORD0,DNSTE;
IF .REALFS EQL 0
THEN (RECOVER(.NFUTSYM,ERSYNAME); 0)
ELSE IF (DNWORD0_.ST[DNSTE_.DNWHERE_.REALFS,0]; .DNWORD0<BLF>)
EQL .BLOCKLEVEL
THEN IF .DNWORD0<TYPEF> EQL UNDEDT
THEN (ST[.DNSTE,0]<TYPEF>_.DNTYPE;IF .XREFLG THEN XREFTY(.DNTYPE); 1)
!! (5.200.10) - - -
!! ODD PREVIOUS FIX FOLLOWS. IT CONTRADICTS THE PRECEDING WRITE-UP
!! IF A THING HAS ALREADY BEEN DECLARED IN THIS BLOCK,
!! THEN LET US REGARD IT AS UN-RE-DECLARABLE AND RETURN 0.
!! %3.30% ELSE IF .DNWORD0<TYPEF> EQL .DNTYPE
!! %3.30% THEN 1
!! (5.200.10) - - -
! 5.200.38 .... BY POPULAR REQUEST, LET EXTERNALS OR FORWARD BE MULTIPLY DECLARED
ELSE IF .DNWORD0<TYPEF> EQL .DNTYPE
THEN IF ((.DNTYPE EQL EXTRNT) OR (
.DNTYPE EQL FORWT)) THEN 1
ELSE (RECOVER(.NFUTSYM,ERSMPREV);0)
! MAY REDECLARE AN EXTERNAL OR FORWARD, BUT NOT A LOCAL, GLOBAL, OWN, STRUCTURE, ETC.
! ....5.200.38
%3.30% ELSE (RECOVER(.NFUTSYM,ERSMPREV); 0)
ELSE (.DNWHERE_DECSYQ(.DNSTE,.DNTYPE,0);1)
END;
%3.1% GLOBAL ROUTINE DECSYM(DMWHERE,DMTYPE)=
IF DECSYN(.DMWHERE,.DMTYPE)
THEN (HRUND(); 1)
ELSE 0;
%%
% DECSYQ(DQSTE:<STE OF OLD NAME>,
DQTYPE:<TYPE FOR NEW NAME>,
DQADDL:<ADDITIONAL INFORMATION WORD>)
DECLARE THE SYMBOL WITH OLD NAME AS NEW N CURRENT CONTEXT.
VALUE IS NEW STE INDEX.
%
%%
%3.1% GLOBAL ROUTINE DECSYQ(DQSTE,DQTYPE,DQADDL)=
BEGIN
%5.200.41% LOCAL L;
ACCUM_.ST[.DQSTE,2];
(ACCUM+1)_.ST[.DQSTE,3];
L_ STINSERT((.DQTYPE^TYPEFP)+LSM, .DQADDL);
%5.200.41% IF .XREFLG THEN XREFTY(.DQTYPE);
%5.200.41% .L
END;
%%
% THE ROUTINE "GENFCN" IS USED TO CREATE A NEW FUNCTION-HEADER
AND SUB-HEADERS FOR SYMBOLS NOT ALREADY DECLARED
FORWARD. WHEN IT HAS NOT BEEN DECLARED FORWARD, WE:
1. GET SPACE FOR THE HEADER (A 2 CELL HEADER WITH 4 SUBHEADERS);
2. INITIALIZE IT FOR THE LOADER (WITH STE INDEX OF FUNCTION
AND OCTAL 7S TO INDICATE NO PROCESSING YET);
3. PUSH IT ONTO THE FUNCTION LIST.
4. SET THE ADD'L INF. WORD ADDRESS PORTION TO POINT TO THE
CREATED HEADER.
PARAMETER: THE FUNCTION/ROUTINE/STRUCTURE STE INDEX.
RETURNED VALUE: THE CTE FOR THE CREATED HEADER.
%
%%
GLOBAL ROUTINE GENFCN(GENSTE) =
BEGIN
LOCAL SAVE;
IF (SAVE_.ST[.GENSTE,1]<LXTEAF>) EQL 0
THEN
(ST[.GENSTE,1]<LXTEAF>_SAVE_SKELETON(2,FRC,4);
PUSHBOT(.FCNLIST,.SAVE);
CT[.SAVE,2]_.GENSTE;
CT[.SAVE,3]_-1);
.SAVE
END;
!END OF LODECL.BLI